Title: [150063] trunk/Source/WebKit2
Revision
150063
Author
michael.brun...@digia.com
Date
2013-05-14 04:32:01 -0700 (Tue, 14 May 2013)

Log Message

[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):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (150062 => 150063)


--- trunk/Source/WebKit2/ChangeLog	2013-05-14 10:12:35 UTC (rev 150062)
+++ trunk/Source/WebKit2/ChangeLog	2013-05-14 11:32:01 UTC (rev 150063)
@@ -1,3 +1,27 @@
+2013-05-14  Michael BrĂ¼ning  <michael.brun...@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  <achristen...@apple.com>
 
         Added testRunner.setPrinting.

Modified: trunk/Source/WebKit2/UIProcess/API/efl/EwkView.cpp (150062 => 150063)


--- trunk/Source/WebKit2/UIProcess/API/efl/EwkView.cpp	2013-05-14 10:12:35 UTC (rev 150062)
+++ trunk/Source/WebKit2/UIProcess/API/efl/EwkView.cpp	2013-05-14 11:32:01 UTC (rev 150063)
@@ -480,7 +480,7 @@
 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);

Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp (150062 => 150063)


--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp	2013-05-14 10:12:35 UTC (rev 150062)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp	2013-05-14 11:32:01 UTC (rev 150063)
@@ -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 @@
     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();

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (150062 => 150063)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2013-05-14 10:12:35 UTC (rev 150062)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2013-05-14 11:32:01 UTC (rev 150063)
@@ -3939,7 +3939,7 @@
     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;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to