12012-12-11 Andras Becsi <andras.becsi@digia.com>
2
3 [Qt][WK2] Fix painting on Mac with retina display
4 https://bugs.webkit.org/show_bug.cgi?id=104574
5
6 Reviewed by NOBODY (OOPS!).
7
8 Since HiDPI support has been added and enabled in Qt we ended up
9 painting incorrectly scaled content on high-resolution screens.
10 Because the intrinsic device pixel ratio is always taken into
11 account by Qt when painting to high-resolution screens we should
12 automatically obtain the scale ratio from the window in which the
13 item is rendered instead of setting it in QML.
14
15 Since Qt does not make it possible to override the device pixel ratio
16 of the native window our experimental QML API for setting a custom
17 value is of no use any more and should be removed.
18
19 This patch fixes the scaling issue on Mac retina display by querying
20 the underlying window for the device scale factor, and removes the
21 experimental API and related API tests.
22
23 * UIProcess/API/qt/qquickwebpage.cpp:
24 (QQuickWebPage::updatePaintNode):
25 * UIProcess/API/qt/qquickwebview.cpp:
26 (QQuickWebViewPrivate::QQuickWebViewPrivate):
27 (QQuickWebViewLegacyPrivate::updateViewportSize):
28 (QQuickWebViewFlickablePrivate::onComponentComplete):
29 * UIProcess/API/qt/qquickwebview_p.h:
30 * UIProcess/API/qt/tests/qmltests/WebView/tst_devicePixelRatio.qml: Removed.
31 * UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp:
32 (tst_QQuickWebView::newWebView):
33 * UIProcess/PageViewportController.cpp:
34 (WebKit::PageViewportController::syncVisibleContents):
35 * UIProcess/qt/QtWebPageSGNode.cpp:
36 (WebKit::ContentsSGNode::ContentsSGNode):
37 (WebKit::ContentsSGNode::render):
38 (WebKit::ContentsSGNode::clipRect):
39 (ContentsSGNode):
40 (WebKit::QtWebPageSGNode::QtWebPageSGNode):
41 (WebKit::QtWebPageSGNode::setRenderer):
42 * UIProcess/qt/QtWebPageSGNode.h:
43 (QtWebPageSGNode):
44