[BlackBerry] Change how devicePixelRatio is set.
authorkpiascik@rim.com <kpiascik@rim.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Aug 2012 21:31:32 +0000 (21:31 +0000)
committerkpiascik@rim.com <kpiascik@rim.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Aug 2012 21:31:32 +0000 (21:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=93385

Reviewed by Antonio Gomes.

Source/WebCore:

Update the theme to adjust to a constant devicePixelRatio.

Not testable.

* platform/blackberry/RenderThemeBlackBerry.cpp:
(WebCore::determineFullScreenMultiplier):

Source/WebKit/blackberry:

Change devicePixelRatio to be set immediately after the page is created based
on the WebSetting.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::init):
(BlackBerry::WebKit::WebPagePrivate::recomputeVirtualViewportFromViewportArguments):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp
Source/WebKit/blackberry/Api/WebPage.cpp
Source/WebKit/blackberry/ChangeLog

index 4a55e9f52ae26d1b58d00f90b993089cf0dd500b..f3f39c282514e9059e53fe952d256c18a2d4d946 100644 (file)
@@ -1,3 +1,17 @@
+2012-08-07  Konrad Piascik  <kpiascik@rim.com>
+
+        [BlackBerry] Change how devicePixelRatio is set.
+        https://bugs.webkit.org/show_bug.cgi?id=93385
+
+        Reviewed by Antonio Gomes.
+
+        Update the theme to adjust to a constant devicePixelRatio.
+
+        Not testable.
+
+        * platform/blackberry/RenderThemeBlackBerry.cpp:
+        (WebCore::determineFullScreenMultiplier):
+
 2012-08-07  James Robinson  <jamesr@chromium.org>
 
         [chromium] Move WebCompositor interface into Platform API
index bbad4fb070b999a1598d7066b7578de9cb77bdbb..26928accb1a2784490ade8e3b578f5efc1f8bb56 100644 (file)
@@ -175,7 +175,7 @@ static float determineFullScreenMultiplier(Element* element)
         // To fix that, lets strips out the Page scale factor from the media controls multiplier.
         float scaleFactor = element->document()->view()->hostWindow()->platformPageClient()->currentZoomFactor();
         static ViewportArguments defaultViewportArguments;
-        float scaleFactorFudge = element->document()->page()->viewportArguments() != defaultViewportArguments ? .5 : .85;
+        float scaleFactorFudge = 1 / element->document()->page()->deviceScaleFactor();
         fullScreenMultiplier /= scaleFactor * scaleFactorFudge;
     }
 #endif
index 6cb71c4ef45e2de90ef9fa66b310d722db443141..7198a3115f28f3c827ddba8cdce9fa3363a7ca52 100644 (file)
@@ -533,6 +533,7 @@ void WebPagePrivate::init(const WebString& pageGroupName)
 
     m_webSettings = WebSettings::createFromStandardSettings();
     m_webSettings->setUserAgentString(defaultUserAgent());
+    m_page->setDeviceScaleFactor(m_webSettings->devicePixelRatio());
 
 #if USE(ACCELERATED_COMPOSITING)
     m_tapHighlight = DefaultTapHighlight::create(this);
@@ -3563,16 +3564,13 @@ void WebPage::resetVirtualViewportOnCommitted(bool reset)
 IntSize WebPagePrivate::recomputeVirtualViewportFromViewportArguments()
 {
     static const ViewportArguments defaultViewportArguments;
-    if (m_viewportArguments == defaultViewportArguments) {
-        m_page->setDeviceScaleFactor(1.0);
+    if (m_viewportArguments == defaultViewportArguments)
         return IntSize();
-    }
 
     int desktopWidth = defaultMaxLayoutSize().width();
     int deviceWidth = Platform::Graphics::Screen::primaryScreen()->width();
     int deviceHeight = Platform::Graphics::Screen::primaryScreen()->height();
     ViewportAttributes result = computeViewportAttributes(m_viewportArguments, desktopWidth, deviceWidth, deviceHeight, m_webSettings->devicePixelRatio(), m_defaultLayoutSize);
-    m_page->setDeviceScaleFactor(result.devicePixelRatio);
 
     setUserScalable(m_userScalable && result.userScalable);
     if (result.initialScale > 0)
index 1bb78d65f5627b72aea1fbe2bc215b930d96c2c2..1d022c49309fbdbd13f3c8e800d9f5833f47df2b 100644 (file)
@@ -1,3 +1,17 @@
+2012-08-07  Konrad Piascik  <kpiascik@rim.com>
+
+        [BlackBerry] Change how devicePixelRatio is set.
+        https://bugs.webkit.org/show_bug.cgi?id=93385
+
+        Reviewed by Antonio Gomes.
+
+        Change devicePixelRatio to be set immediately after the page is created based
+        on the WebSetting.
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPagePrivate::init):
+        (BlackBerry::WebKit::WebPagePrivate::recomputeVirtualViewportFromViewportArguments):
+
 2012-08-07  Antonio Gomes  <agomes@rim.com>
 
         [BlackBerry] [FullScreen] No need to scroll 'x' to 0 before entering fullscreen