[chromium] Fix scaleDelta zoom-out visibility rect bug
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Nov 2011 04:08:20 +0000 (04:08 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Nov 2011 04:08:20 +0000 (04:08 +0000)
https://bugs.webkit.org/show_bug.cgi?id=72208

Since the scroll is no longer applied at the top layer of the layer
tree, the scaleDelta transformation needs to be moved down to the
same level.

Also fix zoomAnimator to be applied the same way.  I removed zoom
animator layout tests, as they aren't testing the actual impl-side
codepath, and are hard to continue supporting -- we should cover zoom
features with unit tests in the future.

Patch by Alexandre Elias <aelias@google.com> on 2011-11-14
Reviewed by James Robinson.

No new tests (planning to add later: https://bugs.webkit.org/show_bug.cgi?id=71529)

* platform/graphics/chromium/LayerChromium.h:
(WebCore::LayerChromium::scaleDelta):
* platform/graphics/chromium/LayerRendererChromium.cpp:
(WebCore::LayerRendererChromium::drawLayersInternal):
* platform/graphics/chromium/LayerRendererChromium.h:
* platform/graphics/chromium/cc/CCLayerImpl.cpp:
(WebCore::CCLayerImpl::CCLayerImpl):
(WebCore::CCLayerImpl::setScaleDelta):
* platform/graphics/chromium/cc/CCLayerImpl.h:
(WebCore::CCLayerImpl::scaleDelta):
* platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
(WebCore::calculateDrawTransformsAndVisibilityInternal):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::setScaleDelta):
(WebCore::CCLayerTreeHostImpl::setZoomAnimatorTransform):

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

21 files changed:
LayoutTests/platform/chromium-gpu-cg-mac/platform/chromium/compositing/zoom-animator-scale-test-expected.png [deleted file]
LayoutTests/platform/chromium-gpu-linux/platform/chromium/compositing/zoom-animator-scale-test-expected.png [deleted file]
LayoutTests/platform/chromium-gpu-linux/platform/chromium/compositing/zoom-animator-scale-test2-expected.png [deleted file]
LayoutTests/platform/chromium-gpu-mac/platform/chromium/compositing/zoom-animator-scale-test-expected.png [deleted file]
LayoutTests/platform/chromium-gpu-win/platform/chromium/compositing/zoom-animator-scale-test-expected.png [deleted file]
LayoutTests/platform/chromium-gpu-win/platform/chromium/compositing/zoom-animator-scale-test2-expected.png [deleted file]
LayoutTests/platform/chromium-gpu/platform/chromium/compositing/zoom-animator-scale-test-expected.txt [deleted file]
LayoutTests/platform/chromium/compositing/zoom-animator-scale-test.html [deleted file]
LayoutTests/platform/chromium/compositing/zoom-animator-scale-test2-expected.txt [deleted file]
LayoutTests/platform/chromium/compositing/zoom-animator-scale-test2.html [deleted file]
LayoutTests/platform/chromium/test_expectations.txt
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/LayerChromium.h
Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h
Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
Source/WebKit/chromium/tests/CCLayerImplTest.cpp

diff --git a/LayoutTests/platform/chromium-gpu-cg-mac/platform/chromium/compositing/zoom-animator-scale-test-expected.png b/LayoutTests/platform/chromium-gpu-cg-mac/platform/chromium/compositing/zoom-animator-scale-test-expected.png
deleted file mode 100644 (file)
index d747e66..0000000
Binary files a/LayoutTests/platform/chromium-gpu-cg-mac/platform/chromium/compositing/zoom-animator-scale-test-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-gpu-linux/platform/chromium/compositing/zoom-animator-scale-test-expected.png b/LayoutTests/platform/chromium-gpu-linux/platform/chromium/compositing/zoom-animator-scale-test-expected.png
deleted file mode 100644 (file)
index c10be31..0000000
Binary files a/LayoutTests/platform/chromium-gpu-linux/platform/chromium/compositing/zoom-animator-scale-test-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-gpu-linux/platform/chromium/compositing/zoom-animator-scale-test2-expected.png b/LayoutTests/platform/chromium-gpu-linux/platform/chromium/compositing/zoom-animator-scale-test2-expected.png
deleted file mode 100644 (file)
index d4466b8..0000000
Binary files a/LayoutTests/platform/chromium-gpu-linux/platform/chromium/compositing/zoom-animator-scale-test2-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-gpu-mac/platform/chromium/compositing/zoom-animator-scale-test-expected.png b/LayoutTests/platform/chromium-gpu-mac/platform/chromium/compositing/zoom-animator-scale-test-expected.png
deleted file mode 100644 (file)
index d747e66..0000000
Binary files a/LayoutTests/platform/chromium-gpu-mac/platform/chromium/compositing/zoom-animator-scale-test-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-gpu-win/platform/chromium/compositing/zoom-animator-scale-test-expected.png b/LayoutTests/platform/chromium-gpu-win/platform/chromium/compositing/zoom-animator-scale-test-expected.png
deleted file mode 100644 (file)
index c10be31..0000000
Binary files a/LayoutTests/platform/chromium-gpu-win/platform/chromium/compositing/zoom-animator-scale-test-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-gpu-win/platform/chromium/compositing/zoom-animator-scale-test2-expected.png b/LayoutTests/platform/chromium-gpu-win/platform/chromium/compositing/zoom-animator-scale-test2-expected.png
deleted file mode 100644 (file)
index 44c96c6..0000000
Binary files a/LayoutTests/platform/chromium-gpu-win/platform/chromium/compositing/zoom-animator-scale-test2-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-gpu/platform/chromium/compositing/zoom-animator-scale-test-expected.txt b/LayoutTests/platform/chromium-gpu/platform/chromium/compositing/zoom-animator-scale-test-expected.txt
deleted file mode 100644 (file)
index 8b13789..0000000
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/LayoutTests/platform/chromium/compositing/zoom-animator-scale-test.html b/LayoutTests/platform/chromium/compositing/zoom-animator-scale-test.html
deleted file mode 100644 (file)
index 6d388f3..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<html>
-  <head>
-    <script>
-        if (window.internals) {
-            window.internals.setForceCompositingMode(document, true);
-            window.internals.setZoomParameters(document, 1.25, 100, 100);
-        }
-        if (window.layoutTestController) {
-            window.layoutTestController.dumpAsText(true);
-        }
-
-        function doTest() {
-            document.getElementById("aBox").style.backgroundColor = "green";
-        }
-
-        window.addEventListener("load", doTest, false);
-    </script>
-  </head>
-<body>
-  <!--    If successful, the box should enlarge to be 125x125 at (125,125).
-    -->
-  <div id="aBox" style="width:100px; height:100px; position:absolute; left:100px; top:100px; background-color:#FF0000"></div>
-</body>
-</html>
diff --git a/LayoutTests/platform/chromium/compositing/zoom-animator-scale-test2-expected.txt b/LayoutTests/platform/chromium/compositing/zoom-animator-scale-test2-expected.txt
deleted file mode 100644 (file)
index 8b13789..0000000
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/LayoutTests/platform/chromium/compositing/zoom-animator-scale-test2.html b/LayoutTests/platform/chromium/compositing/zoom-animator-scale-test2.html
deleted file mode 100644 (file)
index 4321b26..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<html>
-  <head>
-    <script>
-        if (window.internals) {
-            window.internals.setEnableScrollAnimator(document, true);
-            window.internals.setForceCompositingMode(document, true);
-        }
-
-        if (window.layoutTestController) {
-            window.layoutTestController.dumpAsText(true);
-            window.layoutTestController.waitUntilDone();
-        }
-
-        var timer;
-        var count = 0;
-        var maxCount = 60;
-        var newScale = 1.25;
-
-        function finishTest() {
-            count++;
-            if (!window.internals || (window.internals.getPageScaleFactor(document) == newScale || count > maxCount)) {
-                clearInterval(timer);
-
-                if (count > maxCount) {
-                    document.getElementById("aBox").style.backgroundColor = "red";
-                    document.getElementById("aBox").innerHTML = "<center>FAIL!</center>";
-                }
-
-                document.documentElement.style.overflow = "hidden";
-                if (window.layoutTestController)
-                    window.layoutTestController.notifyDone();
-            }
-        }
-
-        function doTest() {
-            document.getElementById("aBox").style.backgroundColor = "green";
-            if (window.internals) {
-                window.internals.setZoomAnimatorTransform(document, newScale, 100.0, 100.0);
-                // Check periodically for animation completion.
-                timer = setInterval("finishTest()", 250);
-            }
-        }
-
-        window.addEventListener("load", doTest, false);
-    </script>
-  </head>
-<body id="theBody">
-  <!--    If successful, the box should enlarge to be 125x125 at (125,125).
-    -->
-  <div id="aBox" style="width:100px; height:100px; position:absolute; left:100px; top:100px; background-color:#FF0000"></div>
-</body>
-</html>
index b469f7ded65f633549e841183f8339982e87e2ee..b209de79053fc93c222fc88e64ac69929746a3af 100644 (file)
@@ -2709,10 +2709,6 @@ BUGWK55968 WIN DEBUG GPU : compositing/webgl/webgl-nonpremultiplied-blend.html =
 
 BUGWK58587 : media/video-controls-rendering.html = IMAGE
 
-// Take new baselines from the bots when 68035 lands.
-//BUGWK69624 SLOW WIN GPU : platform/chromium/compositing/zoom-animator-scale-test2.html = IMAGE+TEXT
-//BUGWK70046 SLOW MAC : platform/chromium/compositing/zoom-animator-scale-test2.html = PASS MISSING
-
 BUGWK53868 : fast/notifications/notifications-document-close-crash.html = PASS TEXT
 
 BUGWK54051 MAC : plugins/invalidate_rect.html = TEXT
@@ -3816,7 +3812,6 @@ BUGENNE GPU : compositing/geometry/vertical-scroll-composited.html = FAIL
 BUGENNE GPU : compositing/overflow/fixed-position-ancestor-clip.html = FAIL
 BUGENNE GPU : compositing/scaling/tiled-layer-recursion.html = FAIL
 // Uncomment the above results for this when removing.
-BUGENNE GPU GPU-CG : platform/chromium/compositing/zoom-animator-scale-test2.html = FAIL TIMEOUT
 
 // This test sometimes exceeds 60-second time limit (for SLOW tests) on
 // win/linux debug. Since setting both SLOW and TIMEOUT is not allowed,
index 735ec337c3dd3e4f79278e6311f69ba63f7a8c5f..916508a2120c17c5e979c4fcdac47dff6bb17a71 100644 (file)
@@ -1,3 +1,37 @@
+2011-11-14  Alexandre Elias  <aelias@google.com>
+
+        [chromium] Fix scaleDelta zoom-out visibility rect bug
+        https://bugs.webkit.org/show_bug.cgi?id=72208
+
+        Since the scroll is no longer applied at the top layer of the layer
+        tree, the scaleDelta transformation needs to be moved down to the
+        same level.
+
+        Also fix zoomAnimator to be applied the same way.  I removed zoom
+        animator layout tests, as they aren't testing the actual impl-side
+        codepath, and are hard to continue supporting -- we should cover zoom
+        features with unit tests in the future.
+
+        Reviewed by James Robinson.
+
+        No new tests (planning to add later: https://bugs.webkit.org/show_bug.cgi?id=71529)
+
+        * platform/graphics/chromium/LayerChromium.h:
+        (WebCore::LayerChromium::scaleDelta):
+        * platform/graphics/chromium/LayerRendererChromium.cpp:
+        (WebCore::LayerRendererChromium::drawLayersInternal):
+        * platform/graphics/chromium/LayerRendererChromium.h:
+        * platform/graphics/chromium/cc/CCLayerImpl.cpp:
+        (WebCore::CCLayerImpl::CCLayerImpl):
+        (WebCore::CCLayerImpl::setScaleDelta):
+        * platform/graphics/chromium/cc/CCLayerImpl.h:
+        (WebCore::CCLayerImpl::scaleDelta):
+        * platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
+        (WebCore::calculateDrawTransformsAndVisibilityInternal):
+        * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+        (WebCore::CCLayerTreeHostImpl::setScaleDelta):
+        (WebCore::CCLayerTreeHostImpl::setZoomAnimatorTransform):
+
 2011-11-14  Chris Fleizach  <cfleizach@apple.com>
 
         WebProcess crashes when trying to display your "uploaded videos" page on Facebook
index 747dc9869cf10b62f30e9bf09af22798664d3424..aab9d38858607c8459f1cdb7349b09dd4b2325c7 100644 (file)
@@ -122,6 +122,8 @@ public:
     void setSublayerTransform(const TransformationMatrix& transform) { m_sublayerTransform = transform; setNeedsCommit(); }
     const TransformationMatrix& sublayerTransform() const { return m_sublayerTransform; }
 
+    TransformationMatrix zoomAnimatorTransform() const { return TransformationMatrix(); }
+
     void setTransform(const TransformationMatrix& transform) { m_transform = transform; setNeedsCommit(); }
     const TransformationMatrix& transform() const { return m_transform; }
 
@@ -136,6 +138,8 @@ public:
 
     IntSize scrollDelta() const { return IntSize(); }
 
+    float scaleDelta() const { return 1; }
+
     bool doubleSided() const { return m_doubleSided; }
     void setDoubleSided(bool doubleSided) { m_doubleSided = doubleSided; setNeedsCommit(); }
 
index 7fda8cae2afd25aae3f1575af6b5508fa9aefebb..134bb052c278f0d38a4f196afabe0e9d949908e7 100644 (file)
@@ -368,14 +368,10 @@ void LayerRendererChromium::drawLayersInternal()
     m_defaultRenderSurface = rootDrawLayer->renderSurface();
     m_defaultRenderSurface->clearLayerList();
 
-    TransformationMatrix magnifyMatrix(m_pageMagnifyMatrix);
-    // TODO(aelias): These two transformations are redundant; unify zoomAnimator
-    // and impl-thread side matrix.
-    magnifyMatrix.multiply(m_zoomAnimatorTransform);
-
+    TransformationMatrix identityMatrix;
     {
         TRACE_EVENT("LayerRendererChromium::drawLayersInternal::calcDrawEtc", this, 0);
-        CCLayerTreeHostCommon::calculateDrawTransformsAndVisibility(rootDrawLayer, rootDrawLayer, magnifyMatrix, magnifyMatrix, renderSurfaceLayerList, m_defaultRenderSurface->layerList(), &m_layerSorter, m_capabilities.maxTextureSize);
+        CCLayerTreeHostCommon::calculateDrawTransformsAndVisibility(rootDrawLayer, rootDrawLayer, identityMatrix, identityMatrix, renderSurfaceLayerList, m_defaultRenderSurface->layerList(), &m_layerSorter, m_capabilities.maxTextureSize);
     }
 
     // The GL viewport covers the entire visible area, including the scrollbars.
@@ -391,13 +387,8 @@ void LayerRendererChromium::drawLayersInternal()
 
     useRenderSurface(m_defaultRenderSurface);
 
-    if (m_zoomAnimatorTransform.isIdentity())
-        // Clear to blue to make it easier to spot unrendered regions.
-        m_context->clearColor(0, 0, 1, 1);
-    else
-        // Clear to grey, as zoom animation may leave unrendered regions.
-        // FIXME(wjmaclean): Render some interesting texture in unrendered regions.
-        m_context->clearColor(0.25, 0.25, 0.25, 1);
+    // Clear to blue to make it easier to spot unrendered regions.
+    m_context->clearColor(0, 0, 1, 1);
     m_context->colorMask(true, true, true, true);
     m_context->clear(GraphicsContext3D::COLOR_BUFFER_BIT);
 
index 028e664d3cb9e5f5b06e6bef9fc77b0fec512dac..f9a831c81f2cc6cc84bd75bb82f481242349a984 100644 (file)
@@ -98,8 +98,6 @@ public:
 
     void viewportChanged();
 
-    void setPageMagnifyTransform(const TransformationMatrix& pageMagnifyMatrix) { m_pageMagnifyMatrix = pageMagnifyMatrix; }
-
     void drawLayers();
 
     // waits for rendering to finish
@@ -108,8 +106,6 @@ public:
     // puts backbuffer onscreen
     void swapBuffers();
 
-    void setZoomAnimatorTransform(const TransformationMatrix& t) { m_zoomAnimatorTransform = t; }
-
     static void debugGLCall(GraphicsContext3D*, const char* command, const char* file, int line);
 
     const TransformationMatrix& projectionMatrix() const { return m_projectionMatrix; }
@@ -197,11 +193,9 @@ private:
 
     TransformationMatrix m_projectionMatrix;
     TransformationMatrix m_windowMatrix;
-    TransformationMatrix m_pageMagnifyMatrix;
 
     CCRenderSurface* m_currentRenderSurface;
     unsigned m_offscreenFramebufferId;
-    TransformationMatrix m_zoomAnimatorTransform;
 
     // Store values that are shared between instances of each layer type
     // associated with this instance of the compositor. Since there can be
index bd2aa0afc43d78e01a63c9c48d2aeca2a1227911..9048fdc82d105b3c6260deab1d910d1081eaa466 100644 (file)
@@ -52,6 +52,7 @@ CCLayerImpl::CCLayerImpl(int id)
     , m_usesLayerClipping(false)
     , m_isNonCompositedContent(false)
     , m_drawsContent(false)
+    , m_scaleDelta(1)
     , m_targetRenderSurface(0)
     , m_drawDepth(0)
     , m_drawOpacity(0)
@@ -338,6 +339,15 @@ void CCLayerImpl::setPreserves3D(bool preserves3D)
     }
 }
 
+void CCLayerImpl::setZoomAnimatorTransform(const TransformationMatrix& zoomAnimatorTransform)
+{
+    if (m_zoomAnimatorTransform != zoomAnimatorTransform) {
+        m_zoomAnimatorTransform = zoomAnimatorTransform;
+        noteLayerPropertyChangedForSubtree();
+    }
+}
+
+
 void CCLayerImpl::setSublayerTransform(const TransformationMatrix& sublayerTransform)
 {
     if (m_sublayerTransform != sublayerTransform) {
@@ -395,6 +405,14 @@ void CCLayerImpl::setScrollDelta(const IntSize& scrollDelta)
     }
 }
 
+void CCLayerImpl::setScaleDelta(float scaleDelta)
+{
+    if (m_scaleDelta != scaleDelta) {
+        m_scaleDelta = scaleDelta;
+        noteLayerPropertyChangedForSubtree();
+    }
+}
+
 void CCLayerImpl::setDoubleSided(bool doubleSided)
 {
     if (m_doubleSided != doubleSided) {
index b72cae10d9171ce67dbdb74cb14b5e515350ac65..486f3a1db96ad4bf66145902b62b7720e3add1d8 100644 (file)
@@ -119,6 +119,9 @@ public:
     void setTransform(const TransformationMatrix&);
     const TransformationMatrix& transform() const { return m_transform; }
 
+    void setZoomAnimatorTransform(const TransformationMatrix&);
+    const TransformationMatrix& zoomAnimatorTransform() const { return m_zoomAnimatorTransform; }
+
     void setName(const String& name) { m_name = name; }
     const String& name() const { return m_name; }
 
@@ -157,6 +160,9 @@ public:
     const IntSize& scrollDelta() const { return m_scrollDelta; }
     void setScrollDelta(const IntSize&);
 
+    float scaleDelta() const { return m_scaleDelta; }
+    void setScaleDelta(float);
+
     void scrollBy(const IntSize& scroll);
 
     bool scrollable() const { return m_scrollable; }
@@ -233,6 +239,7 @@ private:
     float m_opacity;
     FloatPoint m_position;
     bool m_preserves3D;
+    TransformationMatrix m_zoomAnimatorTransform;
     TransformationMatrix m_sublayerTransform;
     TransformationMatrix m_transform;
     bool m_usesLayerClipping;
@@ -242,6 +249,7 @@ private:
 
     IntSize m_scrollDelta;
     IntSize m_maxScrollPosition;
+    float m_scaleDelta;
 
     // Properties owned exclusively by this CCLayerImpl.
     // Debugging.
index 4f2c1fb6264ee7c3a9e617537a028982f8ab33fe..ba430ec517b027a766e63daaee068f8291f448f1 100644 (file)
@@ -327,9 +327,10 @@ void CCLayerTreeHost::updateLayers(LayerChromium* rootLayer)
     RenderSurfaceChromium* rootRenderSurface = rootLayer->renderSurface();
     rootRenderSurface->clearLayerList();
 
+    TransformationMatrix identityMatrix;
     {
         TRACE_EVENT("CCLayerTreeHost::updateLayers::calcDrawEtc", this, 0);
-        CCLayerTreeHostCommon::calculateDrawTransformsAndVisibility(rootLayer, rootLayer, m_zoomAnimatorTransform, m_zoomAnimatorTransform, m_updateList, rootRenderSurface->layerList(), layerRendererCapabilities().maxTextureSize);
+        CCLayerTreeHostCommon::calculateDrawTransformsAndVisibility(rootLayer, rootLayer, identityMatrix, identityMatrix, m_updateList, rootRenderSurface->layerList(), layerRendererCapabilities().maxTextureSize);
     }
 
     paintLayerContents(m_updateList);
index 95885b423a0a8416005803d3f800478ff9640bcf..3b23c992a801c5609528b807ee82f9cf1d2d5fb2 100644 (file)
@@ -196,11 +196,15 @@ static void calculateDrawTransformsAndVisibilityInternal(LayerType* layer, Layer
     float centerOffsetY = (0.5 - anchorPoint.y()) * bounds.height();
 
     TransformationMatrix layerLocalTransform;
-    // LT = Tr[origin] * Tr[origin2anchor]
+    // LT = Tr[origin] * M[zoomAnimator]
+    layerLocalTransform.multiply(layer->zoomAnimatorTransform());
+    // LT = Tr[origin] * M[zoomAnimator] * S[scaleDelta]
+    layerLocalTransform.scale(layer->scaleDelta());
+    // LT = Tr[origin] * M[zoomAnimator] * S[scaleDelta] * Tr[origin2anchor]
     layerLocalTransform.translate3d(position.x(), position.y(), layer->anchorPointZ());
-    // LT = Tr[origin] * Tr[origin2anchor] * M[layer]
+    // LT = Tr[origin] * M[zoomAnimator] * S[scaleDelta] * Tr[origin2anchor] * M[layer]
     layerLocalTransform.multiply(layer->transform());
-    // LT = Tr[origin] * Tr[origin2anchor] * M[layer] * Tr[anchor2center]
+    // LT = Tr[origin] * M[zoomAnimator] * S[scaleDelta] * Tr[origin2anchor] * M[layer] * Tr[anchor2center]
     layerLocalTransform.translate3d(centerOffsetX, centerOffsetY, -layer->anchorPointZ());
 
     TransformationMatrix combinedTransform = parentMatrix;
index 8acb54bbc456cea0c0c416beec24e02fb97064e7..03e2c701c2080472d63dad25bdc3e114b62b7ff0 100644 (file)
@@ -232,9 +232,8 @@ void CCLayerTreeHostImpl::setScaleDelta(float delta)
 
     updateMaxScrollPosition();
 
-    TransformationMatrix deltaMatrix;
-    deltaMatrix.scale(m_scaleDelta);
-    m_layerRenderer->setPageMagnifyTransform(deltaMatrix);
+    if (m_scrollLayerImpl && m_scrollLayerImpl->scrollable())
+        m_scrollLayerImpl->setScaleDelta(m_scaleDelta);
 }
 
 void CCLayerTreeHostImpl::setPageScaleFactorLimits(float minPageScale, float maxPageScale)
@@ -268,7 +267,10 @@ void CCLayerTreeHostImpl::updateMaxScrollPosition()
 
 void CCLayerTreeHostImpl::setZoomAnimatorTransform(const TransformationMatrix& zoom)
 {
-    m_layerRenderer->setZoomAnimatorTransform(zoom);
+    if (!m_scrollLayerImpl)
+        return;
+
+    m_scrollLayerImpl->setZoomAnimatorTransform(zoom);
 }
 
 void CCLayerTreeHostImpl::scrollRootLayer(const IntSize& scrollDelta)
index 21ecad36fa4040b63ccfc679bf8a81d837e4a90b..d7333876bb446f8be5483a574b5565764151b7ba 100644 (file)
@@ -106,10 +106,12 @@ TEST(CCLayerImplTest, verifyLayerChangesAreTrackedProperly)
     EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setPosition(arbitraryFloatPoint));
     EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setPreserves3D(true));
     EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setTransform(arbitraryTransform));
+    EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setZoomAnimatorTransform(arbitraryTransform));
     EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setDoubleSided(false)); // constructor initializes it to "true".
     EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->scrollBy(arbitraryIntSize));
     EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setScrollDelta(arbitraryIntSize));
     EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setScrollPosition(arbitraryIntPoint));
+    EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setScaleDelta(arbitraryNumber));
 
     // Changing these properties only affects the layer itself.
     EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(root->setContentBounds(arbitraryIntSize));
@@ -142,10 +144,12 @@ TEST(CCLayerImplTest, verifyLayerChangesAreTrackedProperly)
     EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setReplicaLayer(dummyReplica));
     EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setPosition(arbitraryFloatPoint));
     EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setPreserves3D(true));
+    EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setZoomAnimatorTransform(arbitraryTransform));
     EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setTransform(arbitraryTransform));
     EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setDoubleSided(false)); // constructor initializes it to "true".
     EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setScrollDelta(arbitraryIntSize));
     EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setScrollPosition(arbitraryIntPoint));
+    EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setScaleDelta(arbitraryNumber));
     EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setContentBounds(arbitraryIntSize));
     EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setOpaque(true));
     EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setOpacity(arbitraryNumber));