[WK2] Make WebPageProxy use deviceScaleFactor() in creationParameters().
authormichael.bruning@digia.com <michael.bruning@digia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 May 2013 11:32:01 +0000 (11:32 +0000)
committermichael.bruning@digia.com <michael.bruning@digia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 May 2013 11:32:01 +0000 (11:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=110218

Reviewed by Darin Adler.

Make the WebPageProxy::creationParameters use the accessor
deviceScaleFactor() instead of using m_intrinsicDeviceScaleFactor
directly. This will restore the custom device scale factor when
reattaching to the WebProcess after a crash.

Moreover, it will enable the Qt and ELF ports to use the
existing C API for overriding the device scale factor instead
of using the WebPageProxy directly or adding new C API to set
the intrinsic device scale factor.

* UIProcess/API/efl/EwkView.cpp:
(EwkView::setDeviceScaleFactor):
* UIProcess/API/qt/qquickwebpage.cpp:
(QQuickWebPage::updatePaintNode):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@150063 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/efl/EwkView.cpp
Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp
Source/WebKit2/UIProcess/WebPageProxy.cpp

index 3de3332..b701ff8 100644 (file)
@@ -1,3 +1,27 @@
+2013-05-14  Michael BrĂ¼ning  <michael.bruning@digia.com>
+
+        [WK2] Make WebPageProxy use deviceScaleFactor() in creationParameters().
+        https://bugs.webkit.org/show_bug.cgi?id=110218
+
+        Reviewed by Darin Adler.
+
+        Make the WebPageProxy::creationParameters use the accessor
+        deviceScaleFactor() instead of using m_intrinsicDeviceScaleFactor
+        directly. This will restore the custom device scale factor when
+        reattaching to the WebProcess after a crash.
+
+        Moreover, it will enable the Qt and ELF ports to use the
+        existing C API for overriding the device scale factor instead
+        of using the WebPageProxy directly or adding new C API to set
+        the intrinsic device scale factor.
+
+        * UIProcess/API/efl/EwkView.cpp:
+        (EwkView::setDeviceScaleFactor):
+        * UIProcess/API/qt/qquickwebpage.cpp:
+        (QQuickWebPage::updatePaintNode):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::creationParameters):
+
 2013-05-13  Alex Christensen  <achristensen@apple.com>
 
         Added testRunner.setPrinting.
index cff4c9e..e381644 100644 (file)
@@ -480,7 +480,7 @@ void EwkView::setCursor(const Cursor& cursor)
 void EwkView::setDeviceScaleFactor(float scale)
 {
     const WKSize& deviceSize = WKViewGetSize(wkView());
-    page()->setIntrinsicDeviceScaleFactor(scale);
+    WKPageSetCustomBackingScaleFactor(wkPage(), scale);
 
     // Update internal viewport size after device-scale change.
     WKViewSetSize(wkView(), deviceSize);
index 02dd604..e8e646a 100644 (file)
@@ -29,6 +29,7 @@
 #include "qquickwebview_p_p.h"
 #include "qwebkittest_p.h"
 #include <QQuickWindow>
+#include <WKPage.h>
 #include <WebCore/CoordinatedGraphicsScene.h>
 
 using namespace WebKit;
@@ -78,8 +79,9 @@ QSGNode* QQuickWebPage::updatePaintNode(QSGNode* oldNode, UpdatePaintNodeData*)
     const QWindow* window = this->window();
     ASSERT(window);
 
-    if (window && webViewPrivate->deviceScaleFactor() != window->devicePixelRatio()) {
-        webViewPrivate->setIntrinsicDeviceScaleFactor(window->devicePixelRatio());
+    WKPageRef pageRef = webViewPrivate->webPage.get();
+    if (window && WKPageGetBackingScaleFactor(pageRef) != window->devicePixelRatio()) {
+        WKPageSetCustomBackingScaleFactor(pageRef, window->devicePixelRatio());
         // This signal is queued since if we are running a threaded renderer. This might cause failures
         // if tests are reading the new value between the property change and the signal emission.
         emit d->viewportItem->experimental()->test()->devicePixelRatioChanged();
index 40cf4bc..0c8ded6 100644 (file)
@@ -3939,7 +3939,7 @@ WebPageCreationParameters WebPageProxy::creationParameters() const
     parameters.highestUsedBackForwardItemID = WebBackForwardListItem::highedUsedItemID();
     parameters.canRunBeforeUnloadConfirmPanel = m_uiClient.canRunBeforeUnloadConfirmPanel();
     parameters.canRunModal = m_canRunModal;
-    parameters.deviceScaleFactor = m_intrinsicDeviceScaleFactor;
+    parameters.deviceScaleFactor = deviceScaleFactor();
     parameters.mediaVolume = m_mediaVolume;
     parameters.mayStartMediaWhenInWindow = m_mayStartMediaWhenInWindow;
     parameters.overridePrivateBrowsingEnabled = m_overridePrivateBrowsingEnabled;