Title: [120534] trunk/Source
Revision
120534
Author
[email protected]
Date
2012-06-16 15:35:36 -0700 (Sat, 16 Jun 2012)

Log Message

Settings::devicePixelRatio doesn't do anything and is confusing
https://bugs.webkit.org/show_bug.cgi?id=89272

Reviewed by James Robinson.

Source/WebCore:

Settings::devicePixelRatio is yet another piece of state trying to
represent the device scale factor. The canonical place to store this
state is Page::m_deviceScaleFactor. Nothing in WebCore references
Settings::devicePixelRatio anymore, so we can remove it.

* page/Settings.cpp:
(WebCore::Settings::Settings):
* page/Settings.h:
(Settings):

Source/WebKit2:

* Shared/WebPreferencesStore.h:
(WebKit):
    - Remove boilerplate code for the setting.
* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewExperimental::devicePixelRatio):
(QQuickWebViewExperimental::setDevicePixelRatio):
    - Change these functions to get and set the real device scale factor.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::sendViewportAttributesChanged):
    - Use the real device scale factor for the viewport calculation.
(WebKit::WebPage::updatePreferences):
    - Remove boilerplate code for the setting.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (120533 => 120534)


--- trunk/Source/WebCore/ChangeLog	2012-06-16 22:22:03 UTC (rev 120533)
+++ trunk/Source/WebCore/ChangeLog	2012-06-16 22:35:36 UTC (rev 120534)
@@ -1,3 +1,20 @@
+2012-06-16  Adam Barth  <[email protected]>
+
+        Settings::devicePixelRatio doesn't do anything and is confusing
+        https://bugs.webkit.org/show_bug.cgi?id=89272
+
+        Reviewed by James Robinson.
+
+        Settings::devicePixelRatio is yet another piece of state trying to
+        represent the device scale factor. The canonical place to store this
+        state is Page::m_deviceScaleFactor. Nothing in WebCore references
+        Settings::devicePixelRatio anymore, so we can remove it.
+
+        * page/Settings.cpp:
+        (WebCore::Settings::Settings):
+        * page/Settings.h:
+        (Settings):
+
 2012-06-16  Huang Dongsung  <[email protected]>
 
         [Texmap] SIGSEV in WebCore::TextureMapperGL::drawTexture.

Modified: trunk/Source/WebCore/page/Settings.cpp (120533 => 120534)


--- trunk/Source/WebCore/page/Settings.cpp	2012-06-16 22:22:03 UTC (rev 120533)
+++ trunk/Source/WebCore/page/Settings.cpp	2012-06-16 22:35:36 UTC (rev 120534)
@@ -132,7 +132,6 @@
     , m_validationMessageTimerMagnification(50)
     , m_minimumAccelerated2dCanvasSize(257 * 256)
     , m_layoutFallbackWidth(980)
-    , m_devicePixelRatio(1.0)
     , m_maximumDecodedImageSize(numeric_limits<size_t>::max())
     , m_deviceWidth(0)
     , m_deviceHeight(0)

Modified: trunk/Source/WebCore/page/Settings.h (120533 => 120534)


--- trunk/Source/WebCore/page/Settings.h	2012-06-16 22:22:03 UTC (rev 120533)
+++ trunk/Source/WebCore/page/Settings.h	2012-06-16 22:35:36 UTC (rev 120534)
@@ -472,9 +472,6 @@
         void setDeviceHeight(int height) { m_deviceHeight = height; }
         int deviceHeight() const { return m_deviceHeight; }
 
-        void setDevicePixelRatio(double devicePixelRatio) { m_devicePixelRatio = devicePixelRatio; }
-        double devicePixelRatio() const { return m_devicePixelRatio; }
-
         void setForceCompositingMode(bool flag) { m_forceCompositingMode = flag; }
         bool forceCompositingMode() { return m_forceCompositingMode; }
 
@@ -617,7 +614,6 @@
         int m_validationMessageTimerMagnification;
         int m_minimumAccelerated2dCanvasSize;
         int m_layoutFallbackWidth;
-        double m_devicePixelRatio;
         size_t m_maximumDecodedImageSize;
         int m_deviceWidth;
         int m_deviceHeight;

Modified: trunk/Source/WebKit2/ChangeLog (120533 => 120534)


--- trunk/Source/WebKit2/ChangeLog	2012-06-16 22:22:03 UTC (rev 120533)
+++ trunk/Source/WebKit2/ChangeLog	2012-06-16 22:35:36 UTC (rev 120534)
@@ -1,3 +1,23 @@
+2012-06-16  Adam Barth  <[email protected]>
+
+        Settings::devicePixelRatio doesn't do anything and is confusing
+        https://bugs.webkit.org/show_bug.cgi?id=89272
+
+        Reviewed by James Robinson.
+
+        * Shared/WebPreferencesStore.h:
+        (WebKit):
+            - Remove boilerplate code for the setting.
+        * UIProcess/API/qt/qquickwebview.cpp:
+        (QQuickWebViewExperimental::devicePixelRatio):
+        (QQuickWebViewExperimental::setDevicePixelRatio):
+            - Change these functions to get and set the real device scale factor.
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::sendViewportAttributesChanged):
+            - Use the real device scale factor for the viewport calculation.
+        (WebKit::WebPage::updatePreferences):
+            - Remove boilerplate code for the setting.
+
 2012-06-15  Christophe Dumez  <[email protected]>
 
         [WK2] Add support for explicit intents

Modified: trunk/Source/WebKit2/Shared/WebPreferencesStore.h (120533 => 120534)


--- trunk/Source/WebKit2/Shared/WebPreferencesStore.h	2012-06-16 22:22:03 UTC (rev 120533)
+++ trunk/Source/WebKit2/Shared/WebPreferencesStore.h	2012-06-16 22:35:36 UTC (rev 120534)
@@ -117,7 +117,6 @@
     \
 
 #define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \
-    macro(DevicePixelRatio, devicePixelRatio, Double, double, 1.0) \
     macro(PDFScaleFactor, pdfScaleFactor, Double, double, 0) \
     \
 

Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp (120533 => 120534)


--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp	2012-06-16 22:22:03 UTC (rev 120533)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp	2012-06-16 22:35:36 UTC (rev 120534)
@@ -1202,7 +1202,7 @@
 double QQuickWebViewExperimental::devicePixelRatio() const
 {
     Q_D(const QQuickWebView);
-    return d->webPageProxy->pageGroup()->preferences()->devicePixelRatio();
+    return d->webPageProxy->deviceScaleFactor();
 }
 
 void QQuickWebViewExperimental::setDevicePixelRatio(double devicePixelRatio)
@@ -1211,7 +1211,7 @@
     if (devicePixelRatio == this->devicePixelRatio())
         return;
 
-    d->webPageProxy->pageGroup()->preferences()->setDevicePixelRatio(devicePixelRatio);
+    d->webPageProxy->setCustomDeviceScaleFactor(devicePixelRatio);
     emit devicePixelRatioChanged();
 }
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (120533 => 120534)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-06-16 22:22:03 UTC (rev 120533)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-06-16 22:35:36 UTC (rev 120534)
@@ -902,7 +902,7 @@
     int deviceWidth = (settings->deviceWidth() > 0) ? settings->deviceWidth() : m_viewportSize.width();
     int deviceHeight = (settings->deviceHeight() > 0) ? settings->deviceHeight() : m_viewportSize.height();
 
-    ViewportAttributes attr = computeViewportAttributes(m_page->viewportArguments(), minimumLayoutFallbackWidth, deviceWidth, deviceHeight, static_cast<int>(160 * settings->devicePixelRatio()), m_viewportSize);
+    ViewportAttributes attr = computeViewportAttributes(m_page->viewportArguments(), minimumLayoutFallbackWidth, deviceWidth, deviceHeight, static_cast<int>(160 * m_page->deviceScaleFactor()), m_viewportSize);
 
     setResizesToContentsUsingLayoutSize(IntSize(static_cast<int>(attr.layoutSize.width()), static_cast<int>(attr.layoutSize.height())));
     send(Messages::WebPageProxy::DidChangeViewportProperties(attr));
@@ -1974,7 +1974,6 @@
     settings->setDefaultFontSize(store.getUInt32ValueForKey(WebPreferencesKey::defaultFontSizeKey()));
     settings->setDefaultFixedFontSize(store.getUInt32ValueForKey(WebPreferencesKey::defaultFixedFontSizeKey()));
     settings->setLayoutFallbackWidth(store.getUInt32ValueForKey(WebPreferencesKey::layoutFallbackWidthKey()));
-    settings->setDevicePixelRatio(store.getDoubleValueForKey(WebPreferencesKey::devicePixelRatioKey()));
     settings->setDeviceWidth(store.getUInt32ValueForKey(WebPreferencesKey::deviceWidthKey()));
     settings->setDeviceHeight(store.getUInt32ValueForKey(WebPreferencesKey::deviceHeightKey()));
     settings->setEditableLinkBehavior(static_cast<WebCore::EditableLinkBehavior>(store.getUInt32ValueForKey(WebPreferencesKey::editableLinkBehaviorKey())));
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to