[chromium] Delete code behind if (!applyXYZScaleInCompositor)
authoraelias@chromium.org <aelias@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Apr 2013 20:48:52 +0000 (20:48 +0000)
committeraelias@chromium.org <aelias@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Apr 2013 20:48:52 +0000 (20:48 +0000)
https://bugs.webkit.org/show_bug.cgi?id=111809

Reviewed by James Robinson.

Chromium is setting the flags applyPageScaleFactorInCompositor and
applyDeviceScaleFactorInCompositor permanently to true, so any code
in platform/chromium with the false setting is dead. Delete all of
it.

I also switched FrameTestHelpers and DumpRenderTree to always turn the
setting to true so that they test the code we're actually running.
This exposed a number of failing tests which I added in the
expectations file.

Note also that I made calls to setPageScaleFactor turn on
force-compositing-mode to make the layout tests work, as
pageScaleFactor is now ignored in non-composited mode.

* src/ChromeClientImpl.cpp:
(WebKit::ChromeClientImpl::dispatchViewportPropertiesDidChange):
* src/NonCompositedContentHost.cpp:
(WebKit::NonCompositedContentHost::NonCompositedContentHost):
* src/PageWidgetDelegate.cpp:
(WebKit::PageWidgetDelegate::paint):
* src/PageWidgetDelegate.h:
* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::selectRange):
(WebKit::WebFrameImpl::moveCaretSelectionTowardsWindowPoint):
* src/WebPagePopupImpl.cpp:
(WebKit::WebPagePopupImpl::paint):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::computeScaleAndScrollForHitRect):
(WebKit::WebViewImpl::scaledSize):
(WebKit::WebViewImpl::resize):
(WebKit::WebViewImpl::paint):
(WebKit::WebViewImpl::selectionBounds):
(WebKit::WebViewImpl::computeScaleAndScrollForFocusedNode):
(WebKit::WebViewImpl::clampOffsetAtScale):
(WebKit::WebViewImpl::setPageScaleFactorPreservingScrollOffset):
(WebKit::WebViewImpl::setDeviceScaleFactor):
(WebKit::WebViewImpl::contentsSize):
(WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
(WebKit::WebViewImpl::applyScrollAndScale):
* src/WebViewImpl.h:
* tests/FrameTestHelpers.cpp:
(WebKit::FrameTestHelpers::createWebView):
* tests/WebFrameTest.cpp:
* tests/WebInputEventConversionTest.cpp:
(WebCore::TEST):

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

17 files changed:
LayoutTests/platform/chromium/TestExpectations
Source/Platform/chromium/public/WebGestureCurveTarget.h
Source/WebCore/page/ChromeClient.h
Source/WebCore/page/Frame.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/ChromeClientImpl.cpp
Source/WebKit/chromium/src/ChromeClientImpl.h
Source/WebKit/chromium/src/PageWidgetDelegate.cpp
Source/WebKit/chromium/src/PageWidgetDelegate.h
Source/WebKit/chromium/src/WebFrameImpl.cpp
Source/WebKit/chromium/src/WebPagePopupImpl.cpp
Source/WebKit/chromium/src/WebViewImpl.cpp
Source/WebKit/chromium/src/WebViewImpl.h
Source/WebKit/chromium/tests/FrameTestHelpers.cpp
Source/WebKit/chromium/tests/WebFrameTest.cpp
Source/WebKit/chromium/tests/WebInputEventConversionTest.cpp
Tools/DumpRenderTree/chromium/TestRunner/src/WebPreferences.cpp

index d59c094..16b1aa5 100644 (file)
@@ -3620,8 +3620,6 @@ crbug.com/166932 [ Debug ] plugins/embed-attributes-setting.html [ Crash Pass ]
 
 webkit.org/b/106858 [ Mac Debug ] scrollingcoordinator/non-fast-scrollable-region-transformed-iframe.html [ ImageOnlyFailure Crash ]
 webkit.org/b/106858 [ Linux Win Debug ] scrollingcoordinator/non-fast-scrollable-region-transformed-iframe.html [ ImageOnlyFailure Pass ]
-webkit.org/b/106858 [ Mac Debug ] scrollingcoordinator/non-fast-scrollable-region-scaled-iframe.html [ ImageOnlyFailure ]
-webkit.org/b/106858 [ Linux Win Debug ] scrollingcoordinator/non-fast-scrollable-region-scaled-iframe.html [ ImageOnlyFailure Pass ]
 
 # This is won't fix, as the debug and release versions differ.
 
@@ -3679,18 +3677,32 @@ webkit.org/b/110568 [ MountainLion ] fast/multicol/newmulticol/positioned-split.
 
 webkit.org/b/110739 [ Release MountainLion ] fast/regions/shape-inside/shape-inside-on-regions.html [ ImageOnlyFailure ]
 
-# The following tests are are failing since chromium r184584
-webkit.org/b/110851 compositing/geometry/fixed-position-composited-page-scale-smaller-than-viewport.html [ ImageOnlyFailure ]
-webkit.org/b/110851 compositing/geometry/fixed-position-composited-page-scale.html [ ImageOnlyFailure ]
-webkit.org/b/110851 compositing/geometry/fixed-position-iframe-composited-page-scale.html [ ImageOnlyFailure ]
-webkit.org/b/110851 compositing/overflow/overflow-scaled-descendant-overlapping.html [ ImageOnlyFailure ]
-webkit.org/b/110851 compositing/repaint/page-scale-repaint.html [ ImageOnlyFailure ]
-webkit.org/b/110851 platform/chromium/virtual/gpu/compositedscrolling/overflow/overflow-scaled-descendant-overlapping.html [ ImageOnlyFailure ]
-webkit.org/b/110851 platform/chromium/virtual/softwarecompositing/geometry/fixed-position-composited-page-scale.html [ ImageOnlyFailure ]
-webkit.org/b/110851 platform/chromium/virtual/softwarecompositing/geometry/fixed-position-iframe-composited-page-scale.html [ ImageOnlyFailure ]
-webkit.org/b/110851 platform/chromium/virtual/softwarecompositing/geometry/fixed-position-composited-page-scale-smaller-than-viewport.html [ ImageOnlyFailure ]
-webkit.org/b/110851 platform/chromium/virtual/softwarecompositing/overflow/overflow-scaled-descendant-overlapping.html [ ImageOnlyFailure ]
-webkit.org/b/110851 platform/chromium/virtual/softwarecompositing/repaint/page-scale-repaint.html [ ImageOnlyFailure ]
+# Tests failing since applyPageScaleFactorInCompositor enabled
+crbug.com/225184 compositing/geometry/fixed-position-composited-page-scale.html [ ImageOnlyFailure ]
+crbug.com/225184 compositing/geometry/fixed-position-iframe-composited-page-scale.html [ ImageOnlyFailure ]
+crbug.com/225184 compositing/repaint/page-scale-repaint.html [ ImageOnlyFailure ]
+crbug.com/225184 platform/chromium/virtual/gpu/compositedscrolling/overflow/overflow-scaled-descendant-overlapping.html [ ImageOnlyFailure ]
+crbug.com/225184 platform/chromium/virtual/softwarecompositing/geometry/fixed-position-composited-page-scale.html [ ImageOnlyFailure ]
+crbug.com/225184 platform/chromium/virtual/softwarecompositing/geometry/fixed-position-iframe-composited-page-scale.html [ ImageOnlyFailure ]
+crbug.com/225184 platform/chromium/virtual/softwarecompositing/geometry/fixed-position-composited-page-scale-smaller-than-viewport.html [ ImageOnlyFailure ]
+crbug.com/225184 platform/chromium/virtual/softwarecompositing/overflow/overflow-scaled-descendant-overlapping.html [ ImageOnlyFailure ]
+crbug.com/225184 platform/chromium/virtual/softwarecompositing/repaint/page-scale-repaint.html [ ImageOnlyFailure ]
+crbug.com/225184 platform/chromium/virtual/softwarecompositing/layer-creation/fixed-position-out-of-view-scaled-scroll.html [ Failure ]
+crbug.com/225184 platform/chromium/virtual/softwarecompositing/layer-creation/fixed-position-out-of-view-scaled.html [ Failure ]
+crbug.com/225184 compositing/layer-creation/fixed-position-out-of-view-scaled.html [ Failure ]
+crbug.com/225184 compositing/layer-creation/fixed-position-out-of-view-scaled-scroll.html [ Failure ]
+crbug.com/225184 fast/events/scale-and-scroll-iframe-body.html [ ImageOnlyFailure ]
+crbug.com/225184 fast/events/scale-and-scroll-iframe-window.html [ ImageOnlyFailure ]
+crbug.com/225184 fast/frames/frame-set-rotation-hit.html [ ImageOnlyFailure ]
+crbug.com/225184 fast/frames/frame-set-scaling-hit.html [ ImageOnlyFailure ]
+crbug.com/225184 fast/repaint/background-scaling.html [ ImageOnlyFailure ]
+crbug.com/225184 fast/repaint/scale-page-shrink.html [ ImageOnlyFailure ]
+crbug.com/225184 platform/chromium/fast/repaint/relayout-fixed-position-after-scale.html [ ImageOnlyFailure ]
+crbug.com/225184 fast/events/scale-and-scroll-body.html [ Failure ]
+crbug.com/225184 fast/events/scroll-in-scaled-page-with-overflow-hidden.html [ Failure ]
+crbug.com/225184 inspector/elements/highlight-node-scaled.html [ Failure ]
+crbug.com/225184 scrollingcoordinator/non-fast-scrollable-region-scaled-iframe.html [ Failure ]
+crbug.com/225184 svg/as-image/image-respects-pageScaleFactor.html [ ImageOnlyFailure ]
 
 # Pixel tests for RTL iframe scrollbar is erroneous. Cannot observe on actual browser.
 crbug.com/192172 [ Linux Release ] compositing/rtl/rtl-iframe-absolute-overflow-scrolled.html [ ImageOnlyFailure ]
index cfc2a82..7c520d3 100644 (file)
@@ -32,10 +32,7 @@ namespace WebKit {
 
 class WebGestureCurveTarget {
 public:
-    virtual void scrollBy(const WebFloatSize& delta) { scrollBy(WebPoint(delta.width, delta.height)); }
-
-    // TODO(aelias): Delete this after WebKit roll.
-    virtual void scrollBy(const WebPoint& delta) { scrollBy(WebFloatSize(delta.x, delta.y)); }
+    virtual void scrollBy(const WebFloatSize& delta) = 0;
 
 protected:
     virtual ~WebGestureCurveTarget() { }
index f46a243..eb02797 100644 (file)
@@ -175,6 +175,7 @@ public:
     virtual void dispatchViewportPropertiesDidChange(const ViewportArguments&) const { }
 
     virtual void contentsSizeChanged(Frame*, const IntSize&) const = 0;
+    virtual void deviceOrPageScaleFactorChanged() const { }
     virtual void layoutUpdated(Frame*) const { }
     virtual void scrollRectIntoView(const IntRect&) const { }; // Currently only Mac has a non empty implementation.
 
index 7710af7..c1e2420 100644 (file)
@@ -1009,6 +1009,8 @@ void Frame::deviceOrPageScaleFactorChanged()
     RenderView* root = contentRenderer();
     if (root && root->compositor())
         root->compositor()->deviceOrPageScaleFactorChanged();
+
+    m_page->chrome()->client()->deviceOrPageScaleFactorChanged();
 }
 #endif
 void Frame::notifyChromeClientWheelEventHandlerCountChanged() const
index a5896f6..e97dbd0 100644 (file)
@@ -1,3 +1,56 @@
+2013-04-01  Alexandre Elias  <aelias@chromium.org>
+
+        [chromium] Delete code behind if (!applyXYZScaleInCompositor)
+        https://bugs.webkit.org/show_bug.cgi?id=111809
+
+        Reviewed by James Robinson.
+
+        Chromium is setting the flags applyPageScaleFactorInCompositor and
+        applyDeviceScaleFactorInCompositor permanently to true, so any code
+        in platform/chromium with the false setting is dead. Delete all of
+        it.
+
+        I also switched FrameTestHelpers and DumpRenderTree to always turn the
+        setting to true so that they test the code we're actually running.
+        This exposed a number of failing tests which I added in the
+        expectations file.
+
+        Note also that I made calls to setPageScaleFactor turn on
+        force-compositing-mode to make the layout tests work, as
+        pageScaleFactor is now ignored in non-composited mode.
+
+        * src/ChromeClientImpl.cpp:
+        (WebKit::ChromeClientImpl::dispatchViewportPropertiesDidChange):
+        * src/NonCompositedContentHost.cpp:
+        (WebKit::NonCompositedContentHost::NonCompositedContentHost):
+        * src/PageWidgetDelegate.cpp:
+        (WebKit::PageWidgetDelegate::paint):
+        * src/PageWidgetDelegate.h:
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::selectRange):
+        (WebKit::WebFrameImpl::moveCaretSelectionTowardsWindowPoint):
+        * src/WebPagePopupImpl.cpp:
+        (WebKit::WebPagePopupImpl::paint):
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::computeScaleAndScrollForHitRect):
+        (WebKit::WebViewImpl::scaledSize):
+        (WebKit::WebViewImpl::resize):
+        (WebKit::WebViewImpl::paint):
+        (WebKit::WebViewImpl::selectionBounds):
+        (WebKit::WebViewImpl::computeScaleAndScrollForFocusedNode):
+        (WebKit::WebViewImpl::clampOffsetAtScale):
+        (WebKit::WebViewImpl::setPageScaleFactorPreservingScrollOffset):
+        (WebKit::WebViewImpl::setDeviceScaleFactor):
+        (WebKit::WebViewImpl::contentsSize):
+        (WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
+        (WebKit::WebViewImpl::applyScrollAndScale):
+        * src/WebViewImpl.h:
+        * tests/FrameTestHelpers.cpp:
+        (WebKit::FrameTestHelpers::createWebView):
+        * tests/WebFrameTest.cpp:
+        * tests/WebInputEventConversionTest.cpp:
+        (WebCore::TEST):
+
 2013-03-30  Adam Barth  <abarth@webkit.org>
 
         [Chromium] Remove unused includes of stdio.h
index d45df3e..ea92f9d 100644 (file)
@@ -573,6 +573,11 @@ void ChromeClientImpl::contentsSizeChanged(Frame* frame, const IntSize& size) co
         webframe->client()->didChangeContentsSize(webframe, size);
 }
 
+void ChromeClientImpl::deviceOrPageScaleFactorChanged() const
+{
+    m_webView->deviceOrPageScaleFactorChanged();
+}
+
 void ChromeClientImpl::layoutUpdated(Frame* frame) const
 {
     m_webView->layoutUpdated(WebFrameImpl::fromFrame(frame));
@@ -625,7 +630,7 @@ void ChromeClientImpl::dispatchViewportPropertiesDidChange(const ViewportArgumen
     if (!m_webView->settings()->viewportEnabled() || !m_webView->isFixedLayoutModeEnabled() || !m_webView->client() || !m_webView->page())
         return;
 
-    IntSize viewportSize = m_webView->dipSize();
+    IntSize viewportSize = m_webView->size();
     float deviceScaleFactor = m_webView->client()->screenInfo().deviceScaleFactor;
 
     // If the window size has not been set yet don't attempt to set the viewport.
@@ -641,8 +646,6 @@ void ChromeClientImpl::dispatchViewportPropertiesDidChange(const ViewportArgumen
     }
     if (arguments.zoom == ViewportArguments::ValueAuto && !m_webView->settingsImpl()->initializeAtMinimumPageScale())
         computed.initialScale = 1.0f;
-    if (!m_webView->settingsImpl()->applyDeviceScaleFactorInCompositor())
-        computed.initialScale *= deviceScaleFactor;
 
     m_webView->setInitialPageScaleFactor(computed.initialScale);
     m_webView->setFixedLayoutSize(flooredIntSize(computed.layoutSize));
index dbccd4b..486b65a 100644 (file)
@@ -127,6 +127,7 @@ public:
     virtual WebCore::IntRect rootViewToScreen(const WebCore::IntRect&) const;
     virtual PlatformPageClient platformPageClient() const { return PlatformPageClient(this); }
     virtual void contentsSizeChanged(WebCore::Frame*, const WebCore::IntSize&) const;
+    virtual void deviceOrPageScaleFactorChanged() const;
     virtual void layoutUpdated(WebCore::Frame*) const;
     virtual void scrollRectIntoView(
         const WebCore::IntRect&) const { }
index 6598214..9404d3b 100644 (file)
@@ -81,17 +81,15 @@ void PageWidgetDelegate::layout(Page* page)
     view->updateLayoutAndStyleIfNeededRecursive();
 }
 
-void PageWidgetDelegate::paint(Page* page, PageOverlayList* overlays, WebCanvas* canvas, const WebRect& rect, CanvasBackground background, bool applyDeviceScale)
+void PageWidgetDelegate::paint(Page* page, PageOverlayList* overlays, WebCanvas* canvas, const WebRect& rect, CanvasBackground background)
 {
     if (rect.isEmpty())
         return;
     GraphicsContextBuilder builder(canvas);
     GraphicsContext& gc = builder.context();
     gc.setShouldSmoothFonts(background == Opaque);
-    if (applyDeviceScale) {
-        gc.applyDeviceScaleFactor(page->deviceScaleFactor());
-        gc.platformContext()->setDeviceScaleFactor(page->deviceScaleFactor());
-    }
+    gc.applyDeviceScaleFactor(page->deviceScaleFactor());
+    gc.platformContext()->setDeviceScaleFactor(page->deviceScaleFactor());
     IntRect dirtyRect(rect);
     gc.save();
     FrameView* view = mainFrameView(page);
index 9a03a90..c9f76bb 100644 (file)
@@ -79,7 +79,7 @@ public:
     };
     static void animate(WebCore::Page*, double monotonicFrameBeginTime);
     static void layout(WebCore::Page*);
-    static void paint(WebCore::Page*, PageOverlayList*, WebCanvas*, const WebRect&, CanvasBackground, bool applyDeviceScale);
+    static void paint(WebCore::Page*, PageOverlayList*, WebCanvas*, const WebRect&, CanvasBackground);
     static bool handleInputEvent(WebCore::Page*, PageWidgetEventHandler&, const WebInputEvent&);
 
 private:
index 0489cf7..5a07ac3 100644 (file)
@@ -1362,10 +1362,8 @@ void WebFrameImpl::selectRange(const WebPoint& base, const WebPoint& extent)
 {
     IntPoint unscaledBase = base;
     IntPoint unscaledExtent = extent;
-    if (frame()->page()->settings()->applyPageScaleFactorInCompositor()) {
-        unscaledExtent.scale(1 / view()->pageScaleFactor(), 1 / view()->pageScaleFactor());
-        unscaledBase.scale(1 / view()->pageScaleFactor(), 1 / view()->pageScaleFactor());
-    }
+    unscaledExtent.scale(1 / view()->pageScaleFactor(), 1 / view()->pageScaleFactor());
+    unscaledBase.scale(1 / view()->pageScaleFactor(), 1 / view()->pageScaleFactor());
     VisiblePosition basePosition = visiblePositionForWindowPoint(unscaledBase);
     VisiblePosition extentPosition = visiblePositionForWindowPoint(unscaledExtent);
     VisibleSelection newSelection = VisibleSelection(basePosition, extentPosition);
@@ -1382,8 +1380,7 @@ void WebFrameImpl::selectRange(const WebRange& webRange)
 void WebFrameImpl::moveCaretSelectionTowardsWindowPoint(const WebPoint& point)
 {
     IntPoint unscaledPoint(point);
-    if (frame()->page()->settings()->applyPageScaleFactorInCompositor())
-        unscaledPoint.scale(1 / view()->pageScaleFactor(), 1 / view()->pageScaleFactor());
+    unscaledPoint.scale(1 / view()->pageScaleFactor(), 1 / view()->pageScaleFactor());
 
     Element* editable = frame()->selection()->rootEditableElement();
     if (!editable)
index eef556d..4cbbcb0 100644 (file)
@@ -261,7 +261,7 @@ void WebPagePopupImpl::layout()
 void WebPagePopupImpl::paint(WebCanvas* canvas, const WebRect& rect, PaintOptions)
 {
     if (!m_closing)
-        PageWidgetDelegate::paint(m_page.get(), 0, canvas, rect, PageWidgetDelegate::Opaque, m_webView->settingsImpl()->applyDeviceScaleFactorInCompositor());
+        PageWidgetDelegate::paint(m_page.get(), 0, canvas, rect, PageWidgetDelegate::Opaque);
 }
 
 void WebPagePopupImpl::resize(const WebSize& newSize)
index 66e71a0..dd732f5 100644 (file)
@@ -1199,7 +1199,7 @@ void WebViewImpl::computeScaleAndScrollForHitRect(const WebRect& hitRect, AutoZo
         // (after double tap, find in page, etc), though the user should still
         // be allowed to manually pinch zoom in further if they desire.
         const float defaultScaleWhenAlreadyLegible = m_minimumPageScaleFactor * doubleTapZoomAlreadyLegibleRatio;
-        float legibleScale = settingsImpl()->applyDeviceScaleFactorInCompositor() ? 1 : deviceScaleFactor();
+        float legibleScale = 1;
 #if ENABLE(TEXT_AUTOSIZING)
         if (page() && page()->settings())
             legibleScale *= page()->settings()->textAutosizingFontScaleFactor();
@@ -1209,10 +1209,6 @@ void WebViewImpl::computeScaleAndScrollForHitRect(const WebRect& hitRect, AutoZo
 
         float defaultMargin = doubleTapZoomContentDefaultMargin;
         float minimumMargin = doubleTapZoomContentMinimumMargin;
-        if (!settingsImpl()->applyDeviceScaleFactorInCompositor()) {
-            defaultMargin *= deviceScaleFactor();
-            minimumMargin *= deviceScaleFactor();
-        }
         // We want the margins to have the same physical size, which means we
         // need to express them in post-scale size. To do that we'd need to know
         // the scale we're scaling to, but that depends on the margins. Instead
@@ -1223,10 +1219,7 @@ void WebViewImpl::computeScaleAndScrollForHitRect(const WebRect& hitRect, AutoZo
                 static_cast<int>(defaultMargin * rect.width / m_size.width),
                 static_cast<int>(minimumMargin * rect.width / m_size.width));
         // Fit block to screen, respecting limits.
-        if (settingsImpl()->applyPageScaleFactorInCompositor())
-            scale = static_cast<float>(m_size.width) / rect.width;
-        else
-            scale *= static_cast<float>(m_size.width) / rect.width;
+        scale = static_cast<float>(m_size.width) / rect.width;
         scale = min(scale, legibleScale);
         scale = clampPageScaleFactorToLimits(scale);
 
@@ -1249,12 +1242,8 @@ void WebViewImpl::computeScaleAndScrollForHitRect(const WebRect& hitRect, AutoZo
         // double-tap zoom strategy (fitting the containing block to the screen)
         // though.
 
-        float screenHeight = m_size.height / scale;
         float screenWidth = m_size.width / scale;
-        if (!settingsImpl()->applyPageScaleFactorInCompositor()) {
-            screenHeight *= pageScaleFactor();
-            screenWidth *= pageScaleFactor();
-        }
+        float screenHeight = m_size.height / scale;
 
         // Scroll to vertically align the block.
         if (rect.height < screenHeight) {
@@ -1278,10 +1267,6 @@ void WebViewImpl::computeScaleAndScrollForHitRect(const WebRect& hitRect, AutoZo
 
     scale = clampPageScaleFactorToLimits(scale);
     scroll = mainFrameImpl()->frameView()->windowToContents(scroll);
-    if (!settingsImpl()->applyPageScaleFactorInCompositor()) {
-        float scaleDelta = scale / pageScaleFactor();
-        scroll = WebPoint(scroll.x * scaleDelta, scroll.y * scaleDelta);
-    }
     if (!isAnchor)
         scroll = clampOffsetAtScale(scroll, scale);
 }
@@ -1664,7 +1649,7 @@ void WebViewImpl::willStartLiveResize()
 
 IntSize WebViewImpl::scaledSize(float pageScaleFactor) const
 {
-    FloatSize scaledSize = dipSize();
+    FloatSize scaledSize = IntSize(m_size);
     scaledSize.scale(1 / pageScaleFactor);
     return expandedIntSize(scaledSize);
 }
@@ -1723,12 +1708,8 @@ void WebViewImpl::resize(const WebSize& newSize)
         float viewportWidthRatio = !oldSize.width ? 1 : newSize.width / (float) oldSize.width;
         float fixedLayoutWidthRatio = !oldFixedLayoutWidth ? 1 : fixedLayoutSize().width / (float) oldFixedLayoutWidth;
         float scaleMultiplier = viewportWidthRatio / fixedLayoutWidthRatio;
-        if (scaleMultiplier != 1) {
-            IntSize scrollOffsetAtNewScale = oldScrollOffset;
-            if (!settingsImpl()->applyPageScaleFactorInCompositor())
-                scrollOffsetAtNewScale.scale(scaleMultiplier);
-            setPageScaleFactor(oldPageScaleFactor * scaleMultiplier, IntPoint(scrollOffsetAtNewScale));
-        }
+        if (scaleMultiplier != 1)
+            setPageScaleFactor(oldPageScaleFactor * scaleMultiplier, WebPoint(oldScrollOffset.width(), oldScrollOffset.height()));
     }
 #endif
 
@@ -1858,6 +1839,9 @@ void WebViewImpl::layout()
 
 void WebViewImpl::enterForceCompositingMode(bool enter)
 {
+    if (page()->settings()->forceCompositingMode() == enter)
+        return;
+
     TRACE_EVENT1("webkit", "WebViewImpl::enterForceCompositingMode", "enter", enter);
     settingsImpl()->setForceCompositingMode(enter);
     if (enter) {
@@ -1919,7 +1903,7 @@ void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect, PaintOptions opt
         }
 
         double paintStart = currentTime();
-        PageWidgetDelegate::paint(m_page.get(), pageOverlays(), canvas, rect, isTransparent() ? PageWidgetDelegate::Translucent : PageWidgetDelegate::Opaque, m_webSettings->applyDeviceScaleFactorInCompositor());
+        PageWidgetDelegate::paint(m_page.get(), pageOverlays(), canvas, rect, isTransparent() ? PageWidgetDelegate::Translucent : PageWidgetDelegate::Opaque);
         double paintEnd = currentTime();
         double pixelsPerSec = (rect.width * rect.height) / (paintEnd - paintStart);
         WebKit::Platform::current()->histogramCustomCounts("Renderer4.SoftwarePaintDurationMS", (paintEnd - paintStart) * 1000, 0, 120, 30);
@@ -2385,10 +2369,8 @@ bool WebViewImpl::selectionBounds(WebRect& anchor, WebRect& focus) const
 
     IntRect scaledAnchor(frame->view()->contentsToWindow(anchor));
     IntRect scaledFocus(frame->view()->contentsToWindow(focus));
-    if (m_webSettings->applyPageScaleFactorInCompositor()) {
-        scaledAnchor.scale(pageScaleFactor());
-        scaledFocus.scale(pageScaleFactor());
-    }
+    scaledAnchor.scale(pageScaleFactor());
+    scaledFocus.scale(pageScaleFactor());
     anchor = scaledAnchor;
     focus = scaledFocus;
 
@@ -2792,22 +2774,19 @@ void WebViewImpl::computeScaleAndScrollForFocusedNode(Node* focusedNode, float&
     IntRect textboxRect = focusedNode->document()->view()->contentsToWindow(pixelSnappedIntRect(focusedNode->Node::boundingBox()));
     WebRect caret, unusedEnd;
     selectionBounds(caret, unusedEnd);
-    if (settingsImpl()->applyPageScaleFactorInCompositor()) {
-        IntRect unscaledCaret = caret;
-        unscaledCaret.scale(1 / pageScaleFactor());
-        caret = unscaledCaret;
-    }
+    IntRect unscaledCaret = caret;
+    unscaledCaret.scale(1 / pageScaleFactor());
+    caret = unscaledCaret;
 
     // Pick a scale which is reasonably readable. This is the scale at which
     // the caret height will become minReadableCaretHeight (adjusted for dpi
     // and font scale factor).
-    float targetScale = settingsImpl()->applyDeviceScaleFactorInCompositor() ? 1 : deviceScaleFactor();
+    float targetScale = 1;
 #if ENABLE(TEXT_AUTOSIZING)
     if (page() && page()->settings())
         targetScale *= page()->settings()->textAutosizingFontScaleFactor();
 #endif
-    const float caretHeight = settingsImpl()->applyPageScaleFactorInCompositor() ? caret.height : caret.height / pageScaleFactor();
-    newScale = clampPageScaleFactorToLimits(minReadableCaretHeight * targetScale / caretHeight);
+    newScale = clampPageScaleFactorToLimits(minReadableCaretHeight * targetScale / caret.height);
     const float deltaScale = newScale / pageScaleFactor();
 
     // Convert the rects to absolute space in the new scale.
@@ -2816,15 +2795,8 @@ void WebViewImpl::computeScaleAndScrollForFocusedNode(Node* focusedNode, float&
     IntRect caretInDocumentCoordinates = caret;
     caretInDocumentCoordinates.move(mainFrame()->scrollOffset());
 
-    int viewWidth = m_size.width;
-    int viewHeight = m_size.height;
-    if (settingsImpl()->applyPageScaleFactorInCompositor()) {
-        viewWidth /= newScale;
-        viewHeight /= newScale;
-    } else {
-        textboxRectInDocumentCoordinates.scale(deltaScale);
-        caretInDocumentCoordinates.scale(deltaScale);
-    }
+    int viewWidth = m_size.width / newScale;
+    int viewHeight = m_size.height / newScale;
 
     if (textboxRectInDocumentCoordinates.width() <= viewWidth) {
         // Field is narrower than screen. Try to leave padding on left so field's
@@ -2953,21 +2925,8 @@ float WebViewImpl::clampPageScaleFactorToLimits(float scaleFactor)
 IntPoint WebViewImpl::clampOffsetAtScale(const IntPoint& offset, float scale) const
 {
     IntPoint clampedOffset = offset;
-    if (!m_page->settings()->applyPageScaleFactorInCompositor()) {
-        // This is the scaled content size. We need to convert it to the new scale factor.
-        WebSize contentSize = contentsSize();
-        int docWidthAtNewScale = contentSize.width * scale;
-        int docHeightAtNewScale = contentSize.height * scale;
-        int viewWidth = m_size.width;
-        int viewHeight = m_size.height;
-
-        // Enforce the maximum and minimum scroll positions at the new scale.
-        clampedOffset = clampedOffset.shrunkTo(IntPoint(docWidthAtNewScale - viewWidth, docHeightAtNewScale - viewHeight));
-        clampedOffset.clampNegativeToZero();
-    } else {
-        clampedOffset = clampedOffset.shrunkTo(IntPoint(contentsSize() - scaledSize(scale)));
-        clampedOffset.clampNegativeToZero();
-    }
+    clampedOffset = clampedOffset.shrunkTo(IntPoint(contentsSize() - scaledSize(scale)));
+    clampedOffset.clampNegativeToZero();
 
     return clampedOffset;
 }
@@ -2977,10 +2936,6 @@ void WebViewImpl::setPageScaleFactorPreservingScrollOffset(float scaleFactor)
     scaleFactor = clampPageScaleFactorToLimits(scaleFactor);
 
     IntPoint scrollOffset(mainFrame()->scrollOffset().width, mainFrame()->scrollOffset().height);
-    if (!m_page->settings()->applyPageScaleFactorInCompositor()) {
-        float deltaScale = scaleFactor / pageScaleFactor();
-        scrollOffset.scale(deltaScale, deltaScale);
-    }
     scrollOffset = clampOffsetAtScale(scrollOffset, scaleFactor);
 
     setPageScaleFactor(scaleFactor, scrollOffset);
@@ -3012,10 +2967,6 @@ void WebViewImpl::setPageScaleFactor(float scaleFactor, const WebPoint& origin)
         updateMainFrameScrollPosition(newScrollOffset, false);
 
     m_pageScaleFactorIsSet = true;
-
-#if USE(ACCELERATED_COMPOSITING)
-    updateLayerTreeViewport();
-#endif
 }
 
 float WebViewImpl::deviceScaleFactor() const
@@ -3033,7 +2984,7 @@ void WebViewImpl::setDeviceScaleFactor(float scaleFactor)
 
     page()->setDeviceScaleFactor(scaleFactor);
 
-    if (m_layerTreeView && m_webSettings->applyDeviceScaleFactorInCompositor())
+    if (m_layerTreeView)
         m_layerTreeView->setDeviceScaleFactor(scaleFactor);
 }
 
@@ -3114,17 +3065,9 @@ void WebViewImpl::setIgnoreViewportTagMaximumScale(bool flag)
 
 IntSize WebViewImpl::contentsSize() const
 {
-    Frame* frame = page()->mainFrame();
-    RenderView* root = frame->contentRenderer();
+    RenderView* root = page()->mainFrame()->contentRenderer();
     if (!root)
         return IntSize();
-
-    // If page scale is not applied by compositor, then the CSS transform will
-    // scale by an arbitrary amount. Return the unscaled contents size in this
-    // case.
-    if (!m_page->settings()->applyPageScaleFactorInCompositor())
-        return root->unscaledDocumentRect().size();
-
     return root->documentRect().size();
 }
 
@@ -3254,14 +3197,6 @@ void WebViewImpl::setFixedLayoutSize(const WebSize& layoutSize)
     frame->view()->setFixedLayoutSize(layoutSize);
 }
 
-WebCore::IntSize WebViewImpl::dipSize() const
-{
-    IntSize dipSize = m_size;
-    if (!m_webSettings->applyDeviceScaleFactorInCompositor())
-        dipSize.scale(1 / m_client->screenInfo().deviceScaleFactor);
-    return dipSize;
-}
-
 void WebViewImpl::performMediaPlayerAction(const WebMediaPlayerAction& action,
                                            const WebPoint& location)
 {
@@ -3823,6 +3758,15 @@ void WebViewImpl::didChangeContentsSize()
 {
 }
 
+void WebViewImpl::deviceOrPageScaleFactorChanged()
+{
+    if (pageScaleFactor() && pageScaleFactor() != 1)
+        enterForceCompositingMode(true);
+#if USE(ACCELERATED_COMPOSITING)
+    updateLayerTreeViewport();
+#endif
+}
+
 bool WebViewImpl::useExternalPopupMenus()
 {
     return shouldUseExternalPopupMenus;
@@ -4142,11 +4086,10 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active)
         m_layerTreeView = m_client->layerTreeView();
         if (m_layerTreeView) {
             m_layerTreeView->setRootLayer(*m_rootLayer);
-            if (m_webSettings->applyDeviceScaleFactorInCompositor() && page()->deviceScaleFactor() != 1)
-                setDeviceScaleFactor(page()->deviceScaleFactor());
 
             bool visible = page()->visibilityState() == PageVisibilityStateVisible;
             m_layerTreeView->setVisible(visible);
+            m_layerTreeView->setDeviceScaleFactor(page()->deviceScaleFactor());
             m_layerTreeView->setPageScaleFactorAndLimits(pageScaleFactor(), m_minimumPageScaleFactor, m_maximumPageScaleFactor);
             m_layerTreeView->setHasTransparentBackground(isTransparent());
             updateLayerTreeViewport();
@@ -4212,14 +4155,6 @@ void WebViewImpl::applyScrollAndScale(const WebSize& scrollDelta, float pageScal
         scrollOffset.height += scrollDelta.height;
 
         WebPoint scrollPoint(scrollOffset.width, scrollOffset.height);
-        if (!m_page->settings()->applyPageScaleFactorInCompositor()) {
-            // The old scroll offset (and passed-in delta) are in the old
-            // coordinate space, so we first need to multiply them by the page
-            // scale delta.
-            scrollPoint.x = scrollPoint.x * pageScaleDelta;
-            scrollPoint.y = scrollPoint.y * pageScaleDelta;
-        }
-
         setPageScaleFactor(pageScaleFactor() * pageScaleDelta, scrollPoint);
         m_doubleTapZoomPending = false;
     }
index 283d4cf..978f382 100644 (file)
@@ -419,6 +419,7 @@ public:
     void layoutUpdated(WebFrameImpl*);
 
     void didChangeContentsSize();
+    void deviceOrPageScaleFactorChanged();
 
     // Returns true if popup menus should be rendered by the browser, false if
     // they should be rendered by WebKit (which is the default).
@@ -444,7 +445,6 @@ public:
         return m_maxAutoSize;
     }
 
-    WebCore::IntSize dipSize() const;
     WebCore::IntSize scaledSize(float) const;
 
     // Set the disposition for how this webview is to be initially shown.
index 6238068..412a49e 100644 (file)
@@ -83,6 +83,9 @@ WebView* createWebView(bool enableJavascript, WebFrameClient* webFrameClient, We
     WebView* webView = WebView::create(webViewClient);
     webView->settings()->setJavaScriptEnabled(enableJavascript);
     webView->settings()->setDeviceSupportsMouse(false);
+    webView->settings()->setApplyPageScaleFactorInCompositor(true);
+    webView->settings()->setApplyDeviceScaleFactorInCompositor(true);
+    webView->settings()->setForceCompositingMode(true);
     webView->initializeMainFrame(webFrameClient);
 
     return webView;
index f084932..005801c 100644 (file)
@@ -264,8 +264,6 @@ TEST_F(WebFrameTest, FrameViewNeedsLayoutOnFixedLayoutResize)
     // Make sure we initialize to minimum scale, even if the window size
     // only becomes available after the load begins.
     m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client);
-    m_webView->settings()->setApplyDeviceScaleFactorInCompositor(true);
-    m_webView->settings()->setApplyPageScaleFactorInCompositor(true);
     m_webView->enableFixedLayoutMode(true);
     m_webView->settings()->setViewportEnabled(true);
     m_webView->resize(WebSize(viewportWidth, viewportHeight));
@@ -294,8 +292,6 @@ TEST_F(WebFrameTest, DeviceScaleFactorUsesDefaultWithoutViewportTag)
 
     m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "no_viewport_tag.html", true, 0, &client);
 
-    m_webView->settings()->setApplyDeviceScaleFactorInCompositor(true);
-    m_webView->settings()->setApplyPageScaleFactorInCompositor(true);
     m_webView->settings()->setViewportEnabled(true);
     m_webView->enableFixedLayoutMode(true);
     m_webView->resize(WebSize(viewportWidth, viewportHeight));
@@ -325,8 +321,6 @@ TEST_F(WebFrameTest, FixedLayoutInitializeAtMinimumPageScale)
     // Make sure we initialize to minimum scale, even if the window size
     // only becomes available after the load begins.
     m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client);
-    m_webView->settings()->setApplyDeviceScaleFactorInCompositor(true);
-    m_webView->settings()->setApplyPageScaleFactorInCompositor(true);
     m_webView->enableFixedLayoutMode(true);
     m_webView->settings()->setViewportEnabled(true);
     m_webView->resize(WebSize(viewportWidth, viewportHeight));
@@ -362,8 +356,6 @@ TEST_F(WebFrameTest, setInitializeAtMinimumPageScaleToFalse)
     int viewportHeight = 480;
 
     m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "viewport-auto-initial-scale.html", true, 0, &client);
-    m_webView->settings()->setApplyDeviceScaleFactorInCompositor(true);
-    m_webView->settings()->setApplyPageScaleFactorInCompositor(true);
     m_webView->enableFixedLayoutMode(true);
     m_webView->settings()->setViewportEnabled(true);
     m_webView->settings()->setInitializeAtMinimumPageScale(false);
@@ -383,8 +375,6 @@ TEST_F(WebFrameTest, PageViewportInitialScaleOverridesInitializeAtMinimumScale)
     int viewportHeight = 480;
 
     m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "viewport-2x-initial-scale.html", true, 0, &client);
-    m_webView->settings()->setApplyDeviceScaleFactorInCompositor(true);
-    m_webView->settings()->setApplyPageScaleFactorInCompositor(true);
     m_webView->enableFixedLayoutMode(true);
     m_webView->settings()->setViewportEnabled(true);
     m_webView->settings()->setInitializeAtMinimumPageScale(false);
@@ -403,8 +393,6 @@ TEST_F(WebFrameTest, setInitialPageScaleFactorPermanently)
     float enforcedPageScalePactor = 2.0f;
 
     m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client);
-    m_webView->settings()->setApplyDeviceScaleFactorInCompositor(true);
-    m_webView->settings()->setApplyPageScaleFactorInCompositor(true);
     m_webView->setInitialPageScaleOverride(enforcedPageScalePactor);
 
     EXPECT_EQ(enforcedPageScalePactor, m_webView->pageScaleFactor());
@@ -440,8 +428,6 @@ TEST_F(WebFrameTest, PermanentInitialPageScaleFactorOverridesInitializeAtMinimum
     float enforcedPageScalePactor = 0.5f;
 
     m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "viewport-auto-initial-scale.html", true, 0, &client);
-    m_webView->settings()->setApplyDeviceScaleFactorInCompositor(true);
-    m_webView->settings()->setApplyPageScaleFactorInCompositor(true);
     m_webView->enableFixedLayoutMode(true);
     m_webView->settings()->setViewportEnabled(true);
     m_webView->settings()->setInitializeAtMinimumPageScale(false);
@@ -462,8 +448,6 @@ TEST_F(WebFrameTest, PermanentInitialPageScaleFactorOverridesPageViewportInitial
     float enforcedPageScalePactor = 0.5f;
 
     m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "viewport-2x-initial-scale.html", true, 0, &client);
-    m_webView->settings()->setApplyDeviceScaleFactorInCompositor(true);
-    m_webView->settings()->setApplyPageScaleFactorInCompositor(true);
     m_webView->enableFixedLayoutMode(true);
     m_webView->settings()->setViewportEnabled(true);
     m_webView->setInitialPageScaleOverride(enforcedPageScalePactor);
@@ -498,8 +482,6 @@ TEST_F(WebFrameTest, setPageScaleFactorDoesNotLayout)
     int viewportHeight = 480;
 
     m_webView = static_cast<WebViewImpl*>(FrameTestHelpers::createWebViewAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client));
-    m_webView->settings()->setApplyDeviceScaleFactorInCompositor(true);
-    m_webView->settings()->setApplyPageScaleFactorInCompositor(true);
     m_webView->enableFixedLayoutMode(true);
     m_webView->settings()->setViewportEnabled(true);
     m_webView->resize(WebSize(viewportWidth, viewportHeight));
@@ -522,8 +504,6 @@ TEST_F(WebFrameTest, pageScaleFactorWrittenToHistoryItem)
     int viewportHeight = 480;
 
     m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client);
-    m_webView->settings()->setApplyDeviceScaleFactorInCompositor(true);
-    m_webView->settings()->setApplyPageScaleFactorInCompositor(true);
     m_webView->enableFixedLayoutMode(true);
     m_webView->settings()->setViewportEnabled(true);
     m_webView->resize(WebSize(viewportWidth, viewportHeight));
@@ -547,8 +527,6 @@ TEST_F(WebFrameTest, pageScaleFactorShrinksViewport)
     int viewportHeight = 480;
 
     m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client);
-    m_webView->settings()->setApplyDeviceScaleFactorInCompositor(true);
-    m_webView->settings()->setApplyPageScaleFactorInCompositor(true);
     m_webView->enableFixedLayoutMode(true);
     m_webView->settings()->setViewportEnabled(true);
     m_webView->resize(WebSize(viewportWidth, viewportHeight));
@@ -583,8 +561,6 @@ TEST_F(WebFrameTest, pageScaleFactorDoesNotApplyCssTransform)
     int viewportHeight = 480;
 
     m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client);
-    m_webView->settings()->setApplyDeviceScaleFactorInCompositor(true);
-    m_webView->settings()->setApplyPageScaleFactorInCompositor(true);
     m_webView->enableFixedLayoutMode(true);
     m_webView->settings()->setViewportEnabled(true);
     m_webView->resize(WebSize(viewportWidth, viewportHeight));
@@ -609,8 +585,6 @@ TEST_F(WebFrameTest, pageScaleFactorScalesPaintClip)
     int viewportHeight = 50;
 
     m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client);
-    m_webView->settings()->setApplyDeviceScaleFactorInCompositor(true);
-    m_webView->settings()->setApplyPageScaleFactorInCompositor(true);
     m_webView->enableFixedLayoutMode(true);
     m_webView->settings()->setViewportEnabled(true);
     m_webView->resize(WebSize(viewportWidth, viewportHeight));
@@ -652,8 +626,6 @@ TEST_F(WebFrameTest, CanOverrideMaximumScaleFactor)
     int viewportHeight = 480;
 
     m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "no_scale_for_you.html", true, 0, &client);
-    m_webView->settings()->setApplyDeviceScaleFactorInCompositor(true);
-    m_webView->settings()->setApplyPageScaleFactorInCompositor(true);
     m_webView->enableFixedLayoutMode(true);
     m_webView->settings()->setViewportEnabled(true);
     m_webView->resize(WebSize(viewportWidth, viewportHeight));
@@ -681,8 +653,6 @@ TEST_F(WebFrameTest, DivAutoZoomParamsTest)
     int viewportWidth = 640 / deviceScaleFactor;
     int viewportHeight = 1280 / deviceScaleFactor;
     m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "get_scale_for_auto_zoom_into_div_test.html"); //
-    m_webView->settings()->setApplyDeviceScaleFactorInCompositor(true);
-    m_webView->settings()->setApplyPageScaleFactorInCompositor(true);
     m_webView->setDeviceScaleFactor(deviceScaleFactor);
     m_webView->setPageScaleFactorLimits(0.01f, 4);
     m_webView->setPageScaleFactor(0.5f, WebPoint(0, 0));
@@ -750,8 +720,6 @@ TEST_F(WebFrameTest, DivAutoZoomMultipleDivsTest)
     int viewportHeight = 1280 / deviceScaleFactor;
     float doubleTapZoomAlreadyLegibleRatio = 1.2f;
     m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "get_multiple_divs_for_auto_zoom_test.html");
-    m_webView->settings()->setApplyDeviceScaleFactorInCompositor(true);
-    m_webView->settings()->setApplyPageScaleFactorInCompositor(true);
     m_webView->enableFixedLayoutMode(true);
     m_webView->resize(WebSize(viewportWidth, viewportHeight));
     m_webView->setPageScaleFactorLimits(0.5f, 4);
@@ -801,8 +769,6 @@ TEST_F(WebFrameTest, DivAutoZoomScaleBoundsTest)
     int viewportHeight = 480;
     float doubleTapZoomAlreadyLegibleRatio = 1.2f;
     m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "get_scale_bounds_check_for_auto_zoom_test.html");
-    m_webView->settings()->setApplyDeviceScaleFactorInCompositor(true);
-    m_webView->settings()->setApplyPageScaleFactorInCompositor(true);
     m_webView->enableFixedLayoutMode(true);
     m_webView->resize(WebSize(viewportWidth, viewportHeight));
     m_webView->setDeviceScaleFactor(1.5f);
@@ -867,8 +833,6 @@ TEST_F(WebFrameTest, DivAutoZoomScaleFontScaleFactorTest)
     float doubleTapZoomAlreadyLegibleRatio = 1.2f;
     float textAutosizingFontScaleFactor = 1.13f;
     m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "get_scale_bounds_check_for_auto_zoom_test.html");
-    m_webView->settings()->setApplyDeviceScaleFactorInCompositor(true);
-    m_webView->settings()->setApplyPageScaleFactorInCompositor(true);
     m_webView->enableFixedLayoutMode(true);
     m_webView->resize(WebSize(viewportWidth, viewportHeight));
     m_webView->layout();
@@ -949,8 +913,6 @@ TEST_F(WebFrameTest, DivScrollIntoEditableTest)
     int caretPadding = 10;
     float minReadableCaretHeight = 18.0f;
     m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "get_scale_for_zoom_into_editable_test.html");
-    m_webView->settings()->setApplyDeviceScaleFactorInCompositor(true);
-    m_webView->settings()->setApplyPageScaleFactorInCompositor(true);
     m_webView->enableFixedLayoutMode(true);
     m_webView->resize(WebSize(viewportWidth, viewportHeight));
     m_webView->setPageScaleFactorLimits(1, 4);
@@ -2073,8 +2035,6 @@ TEST_F(WebFrameTest, DisambiguationPopup)
     // Make sure we initialize to minimum scale, even if the window size
     // only becomes available after the load begins.
     m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + htmlFile, true, 0, &client);
-    m_webView->settings()->setApplyDeviceScaleFactorInCompositor(true);
-    m_webView->settings()->setApplyPageScaleFactorInCompositor(true);
     m_webView->resize(WebSize(1000, 1000));
     m_webView->layout();
 
@@ -2122,8 +2082,6 @@ TEST_F(WebFrameTest, DisambiguationPopupNoContainer)
     // Make sure we initialize to minimum scale, even if the window size
     // only becomes available after the load begins.
     m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "disambiguation_popup_no_container.html", true, 0, &client);
-    m_webView->settings()->setApplyDeviceScaleFactorInCompositor(true);
-    m_webView->settings()->setApplyPageScaleFactorInCompositor(true);
     m_webView->resize(WebSize(1000, 1000));
     m_webView->layout();
 
@@ -2145,8 +2103,6 @@ TEST_F(WebFrameTest, DisambiguationPopupMobileSite)
     // Make sure we initialize to minimum scale, even if the window size
     // only becomes available after the load begins.
     m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + htmlFile, true, 0, &client);
-    m_webView->settings()->setApplyDeviceScaleFactorInCompositor(true);
-    m_webView->settings()->setApplyPageScaleFactorInCompositor(true);
     m_webView->resize(WebSize(1000, 1000));
     m_webView->layout();
 
@@ -2187,8 +2143,6 @@ TEST_F(WebFrameTest, DisambiguationPopupBlacklist)
     // Make sure we initialize to minimum scale, even if the window size
     // only becomes available after the load begins.
     m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + htmlFile, true, 0, &client);
-    m_webView->settings()->setApplyDeviceScaleFactorInCompositor(true);
-    m_webView->settings()->setApplyPageScaleFactorInCompositor(true);
     m_webView->resize(WebSize(viewportWidth, viewportHeight));
     m_webView->layout();
 
@@ -2220,8 +2174,6 @@ TEST_F(WebFrameTest, DisambiguationPopupPageScale)
     // Make sure we initialize to minimum scale, even if the window size
     // only becomes available after the load begins.
     m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "disambiguation_popup_page_scale.html", true, 0, &client);
-    m_webView->settings()->setApplyDeviceScaleFactorInCompositor(true);
-    m_webView->settings()->setApplyPageScaleFactorInCompositor(true);
     m_webView->resize(WebSize(1000, 1000));
     m_webView->layout();
 
index 829535f..82892a0 100644 (file)
@@ -97,8 +97,6 @@ TEST(WebInputEventConversionTest, InputEventsScaling)
 
     URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(baseURL.c_str()), WebString::fromUTF8("fixed_layout.html"));
     WebViewImpl* webViewImpl = static_cast<WebViewImpl*>(FrameTestHelpers::createWebViewAndLoad(baseURL + fileName, true));
-    webViewImpl->settings()->setApplyDeviceScaleFactorInCompositor(true);
-    webViewImpl->settings()->setApplyPageScaleFactorInCompositor(true);
     webViewImpl->enableFixedLayoutMode(true);
     webViewImpl->settings()->setViewportEnabled(true);
     int pageWidth = 640;
index 5d882ae..7f0216f 100644 (file)
@@ -214,6 +214,7 @@ void WebPreferences::applyTo(WebView* webView)
     settings->setVisualWordMovementEnabled(false);
     settings->setPasswordEchoEnabled(false);
     settings->setApplyDeviceScaleFactorInCompositor(true);
+    settings->setApplyPageScaleFactorInCompositor(true);
     settings->setSmartInsertDeleteEnabled(true);
 #ifdef WIN32
     settings->setSelectTrailingWhitespaceEnabled(true);