[chromium] setNeedsCommit on non-composited host layers should trigger commit
authorenne@google.com <enne@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Dec 2011 01:17:49 +0000 (01:17 +0000)
committerenne@google.com <enne@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Dec 2011 01:17:49 +0000 (01:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=73711

Reviewed by James Robinson.

Source/WebCore:

Pipe non-composited content host syncs to setNeedsCommit.

Since now the NonCompositedContentHost generates setNeedsCommit, don't
call it unnecessarily, e.g. calling setBackgroundColor to the same
color each frame should not retrigger more commits.

* platform/graphics/chromium/GraphicsLayerChromium.cpp:
(WebCore::GraphicsLayerChromium::setAnchorPoint):
(WebCore::GraphicsLayerChromium::setTransform):
(WebCore::GraphicsLayerChromium::setChildrenTransform):
(WebCore::GraphicsLayerChromium::setMasksToBounds):
(WebCore::GraphicsLayerChromium::setBackgroundColor):
(WebCore::GraphicsLayerChromium::clearBackgroundColor):
(WebCore::GraphicsLayerChromium::setContentsOpaque):
(WebCore::GraphicsLayerChromium::setBackfaceVisibility):
(WebCore::GraphicsLayerChromium::setOpacity):
* platform/graphics/chromium/LayerChromium.cpp:
(WebCore::LayerChromium::setNeedsCommit):
(WebCore::LayerChromium::setAnchorPoint):
(WebCore::LayerChromium::setAnchorPointZ):
(WebCore::LayerChromium::setBackgroundColor):
(WebCore::LayerChromium::setMasksToBounds):
(WebCore::LayerChromium::setMaskLayer):
(WebCore::LayerChromium::setOpacity):
(WebCore::LayerChromium::setOpaque):
(WebCore::LayerChromium::setPosition):
(WebCore::LayerChromium::setSublayerTransform):
(WebCore::LayerChromium::setTransform):
(WebCore::LayerChromium::setScrollPosition):
(WebCore::LayerChromium::setScrollable):
(WebCore::LayerChromium::setDoubleSided):
* platform/graphics/chromium/LayerChromium.h:
(WebCore::LayerChromium::setReplicaLayer):
* platform/graphics/chromium/NonCompositedContentHost.cpp:
(WebCore::NonCompositedContentHost::notifySyncRequired):
* platform/graphics/chromium/NonCompositedContentHost.h:

Source/WebKit/chromium:

Add some tests to make sure that modifying the noncomposited content
host triggers commits.

Properties that trigger setNeedsCommit should only do so when the
property changes. Additionally, make more property changes properly
trigger commits.

* tests/LayerChromiumTest.cpp:

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
Source/WebCore/platform/graphics/chromium/LayerChromium.h
Source/WebCore/platform/graphics/chromium/NonCompositedContentHost.cpp
Source/WebCore/platform/graphics/chromium/NonCompositedContentHost.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/LayerChromiumTest.cpp

index 6e36ebd..241887a 100644 (file)
@@ -1,3 +1,47 @@
+2011-12-06  Adrienne Walker  <enne@google.com>
+
+        [chromium] setNeedsCommit on non-composited host layers should trigger commit
+        https://bugs.webkit.org/show_bug.cgi?id=73711
+
+        Reviewed by James Robinson.
+
+        Pipe non-composited content host syncs to setNeedsCommit.
+
+        Since now the NonCompositedContentHost generates setNeedsCommit, don't
+        call it unnecessarily, e.g. calling setBackgroundColor to the same
+        color each frame should not retrigger more commits.
+
+        * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+        (WebCore::GraphicsLayerChromium::setAnchorPoint):
+        (WebCore::GraphicsLayerChromium::setTransform):
+        (WebCore::GraphicsLayerChromium::setChildrenTransform):
+        (WebCore::GraphicsLayerChromium::setMasksToBounds):
+        (WebCore::GraphicsLayerChromium::setBackgroundColor):
+        (WebCore::GraphicsLayerChromium::clearBackgroundColor):
+        (WebCore::GraphicsLayerChromium::setContentsOpaque):
+        (WebCore::GraphicsLayerChromium::setBackfaceVisibility):
+        (WebCore::GraphicsLayerChromium::setOpacity):
+        * platform/graphics/chromium/LayerChromium.cpp:
+        (WebCore::LayerChromium::setNeedsCommit):
+        (WebCore::LayerChromium::setAnchorPoint):
+        (WebCore::LayerChromium::setAnchorPointZ):
+        (WebCore::LayerChromium::setBackgroundColor):
+        (WebCore::LayerChromium::setMasksToBounds):
+        (WebCore::LayerChromium::setMaskLayer):
+        (WebCore::LayerChromium::setOpacity):
+        (WebCore::LayerChromium::setOpaque):
+        (WebCore::LayerChromium::setPosition):
+        (WebCore::LayerChromium::setSublayerTransform):
+        (WebCore::LayerChromium::setTransform):
+        (WebCore::LayerChromium::setScrollPosition):
+        (WebCore::LayerChromium::setScrollable):
+        (WebCore::LayerChromium::setDoubleSided):
+        * platform/graphics/chromium/LayerChromium.h:
+        (WebCore::LayerChromium::setReplicaLayer):
+        * platform/graphics/chromium/NonCompositedContentHost.cpp:
+        (WebCore::NonCompositedContentHost::notifySyncRequired):
+        * platform/graphics/chromium/NonCompositedContentHost.h:
+
 2011-12-06  Kenichi Ishibashi  <bashi@chromium.org>
 
         [Chromium] unknown characters symbol on \n in complex script text (RTL and LTR)
index c66be7a..13a39cd 100644 (file)
@@ -173,9 +173,6 @@ void GraphicsLayerChromium::setPosition(const FloatPoint& point)
 
 void GraphicsLayerChromium::setAnchorPoint(const FloatPoint3D& point)
 {
-    if (point == m_anchorPoint)
-        return;
-
     GraphicsLayer::setAnchorPoint(point);
     updateAnchorPoint();
 }
@@ -194,18 +191,12 @@ void GraphicsLayerChromium::setTransform(const TransformationMatrix& transform)
     // Call this method first to assign contents scale to LayerChromium so the painter can apply the scale transform.
     updateContentsScale();
 
-    if (transform == m_transform)
-        return;
-
     GraphicsLayer::setTransform(transform);
     updateTransform();
 }
 
 void GraphicsLayerChromium::setChildrenTransform(const TransformationMatrix& transform)
 {
-    if (transform == m_childrenTransform)
-        return;
-
     GraphicsLayer::setChildrenTransform(transform);
     updateChildrenTransform();
 }
@@ -221,9 +212,6 @@ void GraphicsLayerChromium::setPreserves3D(bool preserves3D)
 
 void GraphicsLayerChromium::setMasksToBounds(bool masksToBounds)
 {
-    if (masksToBounds == m_masksToBounds)
-        return;
-
     GraphicsLayer::setMasksToBounds(masksToBounds);
     updateMasksToBounds();
 }
@@ -239,9 +227,6 @@ void GraphicsLayerChromium::setDrawsContent(bool drawsContent)
 
 void GraphicsLayerChromium::setBackgroundColor(const Color& color)
 {
-    if (m_backgroundColorSet && m_backgroundColor == color)
-        return;
-
     GraphicsLayer::setBackgroundColor(color);
 
     m_contentsLayerHasBackgroundColor = true;
@@ -250,18 +235,12 @@ void GraphicsLayerChromium::setBackgroundColor(const Color& color)
 
 void GraphicsLayerChromium::clearBackgroundColor()
 {
-    if (!m_backgroundColorSet)
-        return;
-
     GraphicsLayer::clearBackgroundColor();
     m_contentsLayer->setBackgroundColor(static_cast<RGBA32>(0));
 }
 
 void GraphicsLayerChromium::setContentsOpaque(bool opaque)
 {
-    if (m_contentsOpaque == opaque)
-        return;
-
     GraphicsLayer::setContentsOpaque(opaque);
     updateContentsOpaque();
 }
@@ -281,9 +260,6 @@ void GraphicsLayerChromium::setMaskLayer(GraphicsLayer* maskLayer)
 
 void GraphicsLayerChromium::setBackfaceVisibility(bool visible)
 {
-    if (m_backfaceVisibility == visible)
-        return;
-
     GraphicsLayer::setBackfaceVisibility(visible);
     updateBackfaceVisibility();
 }
@@ -291,10 +267,6 @@ void GraphicsLayerChromium::setBackfaceVisibility(bool visible)
 void GraphicsLayerChromium::setOpacity(float opacity)
 {
     float clampedOpacity = max(min(opacity, 1.0f), 0.0f);
-
-    if (m_opacity == clampedOpacity)
-        return;
-
     GraphicsLayer::setOpacity(clampedOpacity);
     primaryLayer()->setOpacity(opacity);
 }
index e257322..855f9a6 100644 (file)
@@ -120,10 +120,6 @@ void LayerChromium::setLayerTreeHost(CCLayerTreeHost* host)
 
 void LayerChromium::setNeedsCommit()
 {
-    // Call notifySyncRequired(), which for non-root layers plumbs through to
-    // call setRootLayerNeedsDisplay() on the WebView, which will cause LayerRendererChromium
-    // to render a frame.
-    // This function has no effect on root layers.
     if (m_delegate)
         m_delegate->notifySyncRequired();
 }
@@ -249,6 +245,110 @@ void LayerChromium::setChildren(const Vector<RefPtr<LayerChromium> >& children)
         addChild(children[i]);
 }
 
+void LayerChromium::setAnchorPoint(const FloatPoint& anchorPoint)
+{
+    if (m_anchorPoint == anchorPoint)
+        return;
+    m_anchorPoint = anchorPoint;
+    setNeedsCommit();
+}
+
+void LayerChromium::setAnchorPointZ(float anchorPointZ)
+{
+    if (m_anchorPointZ == anchorPointZ)
+        return;
+    m_anchorPointZ = anchorPointZ;
+    setNeedsCommit();
+}
+
+void LayerChromium::setBackgroundColor(const Color& backgroundColor)
+{
+    if (m_backgroundColor == backgroundColor)
+        return;
+    m_backgroundColor = backgroundColor;
+    setNeedsCommit();
+}
+
+void LayerChromium::setMasksToBounds(bool masksToBounds)
+{
+    if (m_masksToBounds == masksToBounds)
+        return;
+    m_masksToBounds = masksToBounds;
+    setNeedsCommit();
+}
+
+void LayerChromium::setMaskLayer(LayerChromium* maskLayer)
+{
+    if (m_maskLayer == maskLayer)
+        return;
+    m_maskLayer = maskLayer;
+    setNeedsCommit();
+}
+
+void LayerChromium::setOpacity(float opacity)
+{
+    if (m_opacity == opacity)
+        return;
+    m_opacity = opacity;
+    setNeedsCommit();
+}
+
+void LayerChromium::setOpaque(bool opaque)
+{
+    if (m_opaque == opaque)
+        return;
+    m_opaque = opaque;
+    setNeedsCommit();
+}
+
+void LayerChromium::setPosition(const FloatPoint& position)
+{
+    if (m_position == position)
+        return;
+    m_position = position;
+    setNeedsCommit();
+}
+
+void LayerChromium::setSublayerTransform(const TransformationMatrix& sublayerTransform)
+{
+    if (m_sublayerTransform == sublayerTransform)
+        return;
+    m_sublayerTransform = sublayerTransform;
+    setNeedsCommit();
+}
+
+void LayerChromium::setTransform(const TransformationMatrix& transform)
+{
+    if (m_transform == transform)
+        return;
+    m_transform = transform;
+    setNeedsCommit();
+}
+
+void LayerChromium::setScrollPosition(const IntPoint& scrollPosition)
+{
+    if (m_scrollPosition == scrollPosition)
+        return;
+    m_scrollPosition = scrollPosition;
+    setNeedsCommit();
+}
+
+void LayerChromium::setScrollable(bool scrollable)
+{
+    if (m_scrollable == scrollable)
+        return;
+    m_scrollable = scrollable;
+    setNeedsCommit();
+}
+
+void LayerChromium::setDoubleSided(bool doubleSided)
+{
+    if (m_doubleSided == doubleSided)
+        return;
+    m_doubleSided = doubleSided;
+    setNeedsCommit();
+}
+
 LayerChromium* LayerChromium::parent() const
 {
     return m_parent;
index 175fc2f..5e05c15 100644 (file)
@@ -83,64 +83,64 @@ public:
     void setChildren(const Vector<RefPtr<LayerChromium> >&);
     const Vector<RefPtr<LayerChromium> >& children() const { return m_children; }
 
-    void setAnchorPoint(const FloatPoint& anchorPoint) { m_anchorPoint = anchorPoint; setNeedsCommit(); }
+    void setAnchorPoint(const FloatPoint&);
     FloatPoint anchorPoint() const { return m_anchorPoint; }
 
-    void setAnchorPointZ(float anchorPointZ) { m_anchorPointZ = anchorPointZ; setNeedsCommit(); }
+    void setAnchorPointZ(float);
     float anchorPointZ() const { return m_anchorPointZ; }
 
-    void setBackgroundColor(const Color& color) { m_backgroundColor = color; setNeedsCommit(); }
+    void setBackgroundColor(const Color&);
     Color backgroundColor() const { return m_backgroundColor; }
 
     void setBounds(const IntSize&);
     const IntSize& bounds() const { return m_bounds; }
     virtual IntSize contentBounds() const { return bounds(); }
 
-    void setMasksToBounds(bool masksToBounds) { m_masksToBounds = masksToBounds; setNeedsCommit(); }
+    void setMasksToBounds(bool);
     bool masksToBounds() const { return m_masksToBounds; }
 
     void setName(const String&);
     const String& name() const { return m_name; }
 
-    void setMaskLayer(LayerChromium* maskLayer) { m_maskLayer = maskLayer; setNeedsCommit(); }
+    void setMaskLayer(LayerChromium*);
     LayerChromium* maskLayer() const { return m_maskLayer.get(); }
 
     virtual void setNeedsDisplayRect(const FloatRect& dirtyRect);
     void setNeedsDisplay() { setNeedsDisplayRect(FloatRect(FloatPoint(), contentBounds())); }
     virtual bool needsDisplay() const { return m_needsDisplay; }
 
-    void setOpacity(float opacity) { m_opacity = opacity; setNeedsCommit(); }
+    void setOpacity(float);
     float opacity() const { return m_opacity; }
 
-    void setOpaque(bool opaque) { m_opaque = opaque; setNeedsCommit(); }
+    void setOpaque(bool);
     bool opaque() const { return m_opaque; }
 
-    void setPosition(const FloatPoint& position) { m_position = position;  setNeedsCommit(); }
+    void setPosition(const FloatPoint&);
     FloatPoint position() const { return m_position; }
 
-    void setSublayerTransform(const TransformationMatrix& transform) { m_sublayerTransform = transform; setNeedsCommit(); }
+    void setSublayerTransform(const TransformationMatrix&);
     const TransformationMatrix& sublayerTransform() const { return m_sublayerTransform; }
 
     TransformationMatrix zoomAnimatorTransform() const { return TransformationMatrix(); }
 
-    void setTransform(const TransformationMatrix& transform) { m_transform = transform; setNeedsCommit(); }
+    void setTransform(const TransformationMatrix&);
     const TransformationMatrix& transform() const { return m_transform; }
 
     const IntRect& visibleLayerRect() const { return m_visibleLayerRect; }
     void setVisibleLayerRect(const IntRect& visibleLayerRect) { m_visibleLayerRect = visibleLayerRect; }
 
+    void setScrollPosition(const IntPoint&);
     const IntPoint& scrollPosition() const { return m_scrollPosition; }
-    void setScrollPosition(const IntPoint& scrollPosition) { m_scrollPosition = scrollPosition; }
 
+    void setScrollable(bool);
     bool scrollable() const { return m_scrollable; }
-    void setScrollable(bool scrollable) { m_scrollable = true;  setNeedsCommit(); }
 
     IntSize scrollDelta() const { return IntSize(); }
 
     float pageScaleDelta() const { return 1; }
 
+    void setDoubleSided(bool);
     bool doubleSided() const { return m_doubleSided; }
-    void setDoubleSided(bool doubleSided) { m_doubleSided = doubleSided; setNeedsCommit(); }
 
     void setPreserves3D(bool preserve3D) { m_preserves3D = preserve3D; }
     bool preserves3D() const { return m_preserves3D; }
@@ -155,7 +155,7 @@ public:
 
     void setDelegate(CCLayerDelegate* delegate) { m_delegate = delegate; }
 
-    void setReplicaLayer(LayerChromium* layer) { m_replicaLayer = layer; }
+    void setReplicaLayer(LayerChromium* layer) { m_replicaLayer = layer; setNeedsCommit(); }
     LayerChromium* replicaLayer() const { return m_replicaLayer.get(); }
 
     // These methods typically need to be overwritten by derived classes.
index 19a0652..093ea68 100644 (file)
@@ -31,6 +31,7 @@
 #include "GraphicsLayer.h"
 #include "LayerChromium.h"
 #include "LayerPainterChromium.h"
+#include "cc/CCLayerTreeHost.h"
 
 namespace WebCore {
 
@@ -120,6 +121,9 @@ void NonCompositedContentHost::notifyAnimationStarted(const GraphicsLayer*, doub
 
 void NonCompositedContentHost::notifySyncRequired(const GraphicsLayer*)
 {
+    CCLayerTreeHost* layerTreeHost = m_graphicsLayer->platformLayer()->layerTreeHost();
+    if (layerTreeHost)
+        layerTreeHost->setNeedsCommit();
 }
 
 void NonCompositedContentHost::paintContents(const GraphicsLayer*, GraphicsContext& context, GraphicsLayerPaintingPhase, const IntRect& clipRect)
index 80a70a9..23a9a1b 100644 (file)
@@ -59,9 +59,10 @@ public:
     void protectVisibleTileTextures();
     GraphicsLayer* topLevelRootLayer() const { return m_graphicsLayer.get(); }
 
-private:
+protected:
     explicit NonCompositedContentHost(PassOwnPtr<LayerPainterChromium> contentPaint);
 
+private:
     // GraphicsLayerClient
     virtual void notifyAnimationStarted(const GraphicsLayer*, double time);
     virtual void notifySyncRequired(const GraphicsLayer*);
index 5139cb2..718823d 100644 (file)
@@ -1,3 +1,19 @@
+2011-12-06  Adrienne Walker  <enne@google.com>
+
+        [chromium] setNeedsCommit on non-composited host layers should trigger commit
+        https://bugs.webkit.org/show_bug.cgi?id=73711
+
+        Reviewed by James Robinson.
+
+        Add some tests to make sure that modifying the noncomposited content
+        host triggers commits.
+
+        Properties that trigger setNeedsCommit should only do so when the
+        property changes. Additionally, make more property changes properly
+        trigger commits.
+
+        * tests/LayerChromiumTest.cpp:
+
 2011-12-06  David Reveman  <reveman@chromium.org>
 
         [Chromium] Implement tile-sized painting using SkPicture.
index f4a4a32..69365a6 100644 (file)
@@ -27,6 +27,8 @@
 #include "LayerChromium.h"
 
 #include "CCLayerTreeTestCommon.h"
+#include "LayerPainterChromium.h"
+#include "NonCompositedContentHost.h"
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
 
@@ -52,6 +54,30 @@ public:
     MOCK_METHOD0(notifySyncRequired, void());
 };
 
+class MockLayerPainterChromium : public LayerPainterChromium {
+public:
+    virtual void paint(GraphicsContext&, const IntRect&) { }
+};
+
+class MockNonCompositedContentHost : public NonCompositedContentHost {
+public:
+    static PassOwnPtr<MockNonCompositedContentHost> create()
+    {
+        return adoptPtr(new MockNonCompositedContentHost);
+    }
+
+    MOCK_METHOD1(notifySyncRequired, void(const GraphicsLayer*));
+
+private:
+    MockNonCompositedContentHost()
+        : NonCompositedContentHost(adoptPtr(new MockLayerPainterChromium()))
+    {
+        m_scrollLayer = GraphicsLayer::create(0);
+        setScrollLayer(m_scrollLayer.get());
+    }
+    OwnPtr<GraphicsLayer> m_scrollLayer;
+};
+
 class LayerChromiumWithInstrumentedDestructor : public LayerChromium {
 public:
     explicit LayerChromiumWithInstrumentedDestructor(CCLayerDelegate* delegate)
@@ -620,10 +646,8 @@ TEST_F(LayerChromiumTest, checkPropertyChangeCausesCorrectBehavior)
     EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 0, testLayer->setDelegate(&mockDelegate));
     EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 0, testLayer->setName("Test Layer"));
     EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 0, testLayer->setVisibleLayerRect(IntRect(0, 0, 40, 50)));
-    EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 0, testLayer->setScrollPosition(IntPoint(10, 10)));
     EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 0, testLayer->setUsesLayerClipping(true));
     EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 0, testLayer->setIsNonCompositedContent(true));
-    EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 0, testLayer->setReplicaLayer(dummyLayer.get()));
     EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 0, testLayer->setDrawOpacity(0.5f));
     EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 0, testLayer->setClipRect(IntRect(3, 3, 8, 8)));
     EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 0, testLayer->setTargetRenderSurface(0));
@@ -634,19 +658,21 @@ TEST_F(LayerChromiumTest, checkPropertyChangeCausesCorrectBehavior)
 
     // Next, test properties that should call setNeedsCommit (but not setNeedsDisplay)
     // These properties should indirectly call notifySyncRequired, but the needsDisplay flag should not change.
-    // Note that for many of these properties it is important to test setting the property to a value that
-    // is different than what the constructor initializes it to.
+    // All properties need to be set to new values in order for setNeedsCommit
+    // to be called.
     EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 1, testLayer->setAnchorPoint(FloatPoint(1.23f, 4.56f)));
     EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 1, testLayer->setAnchorPointZ(0.7f));
     EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 1, testLayer->setBackgroundColor(Color(0.4f, 0.4f, 0.4f)));
     EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 1, testLayer->setMasksToBounds(true));
     EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 1, testLayer->setMaskLayer(dummyLayer.get()));
     EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 1, testLayer->setOpacity(0.5f));
-    EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 1, testLayer->setOpaque(false));
+    EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 1, testLayer->setOpaque(true));
     EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 1, testLayer->setPosition(FloatPoint(4.0f, 9.0f)));
-    EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 1, testLayer->setSublayerTransform(TransformationMatrix()));
+    EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 1, testLayer->setReplicaLayer(dummyLayer.get()));
+    EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 1, testLayer->setSublayerTransform(TransformationMatrix(0, 0, 0, 0, 0, 0)));
     EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 1, testLayer->setScrollable(true));
-    EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 1, testLayer->setTransform(TransformationMatrix()));
+    EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 1, testLayer->setScrollPosition(IntPoint(10, 10)));
+    EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 1, testLayer->setTransform(TransformationMatrix(0, 0, 0, 0, 0, 0)));
     EXECUTE_AND_VERIFY_NOTIFY_SYNC_BEHAVIOR(mockDelegate, 1, testLayer->setDoubleSided(false));
 
     // The above tests should not have caused a change to the needsDisplay flag.
@@ -660,4 +686,18 @@ TEST_F(LayerChromiumTest, checkPropertyChangeCausesCorrectBehavior)
     // FIXME: need to add a test for setLayerTreeHost with a non-null stubbed CCLayerTreeHost.
 }
 
+TEST_F(LayerChromiumTest, checkNonCompositedContentPropertyChangeCausesCommit)
+{
+    OwnPtr<MockNonCompositedContentHost> nonCompositedContentHost(MockNonCompositedContentHost::create());
+
+    GraphicsLayer* rootLayer = nonCompositedContentHost->topLevelRootLayer();
+
+    EXPECT_CALL(*nonCompositedContentHost, notifySyncRequired(_)).Times(1);
+    rootLayer->platformLayer()->setScrollPosition(IntPoint(1, 1));
+    Mock::VerifyAndClearExpectations(nonCompositedContentHost.get());
+
+    EXPECT_CALL(*nonCompositedContentHost, notifySyncRequired(_)).Times(AtLeast(1));
+    nonCompositedContentHost->setViewport(IntSize(30, 30), IntSize(20, 20), IntPoint(10, 10), 1);
+}
+
 } // namespace