Title: [118090] trunk/Source
Revision
118090
Author
dan...@chromium.org
Date
2012-05-22 18:02:16 -0700 (Tue, 22 May 2012)

Log Message

[chromium] Don't force the visibleLayerRect to be empty for animating layers whose front face is not visible
https://bugs.webkit.org/show_bug.cgi?id=86886

Reviewed by Adrienne Walker.

Source/WebCore:

Previously we would force the visibleLayerRect to be empty for these
animating layers, and then special case the pre-painting code to
paint them if they were within some size limit, to avoid having the
layer steal too much memory.

Instead, just use the visibleLayerRect given to the layer. Since the
transform flips the layer such that its back face is visible, it will
also compute a visibleLayerRect in the front face of the layer, and
its size will be bounded by the viewport. This will cause the
layer to be painted with visible priority instead of prepainted, but
ensures the visible parts of the layer is painted and ready to go when
the animation flips the layer around.

* platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
(WebCore::calculateVisibleLayerRect):

Source/WebKit/chromium:

* tests/CCLayerTreeHostCommonTest.cpp:
(WebKitTests::TEST):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (118089 => 118090)


--- trunk/Source/WebCore/ChangeLog	2012-05-23 00:41:03 UTC (rev 118089)
+++ trunk/Source/WebCore/ChangeLog	2012-05-23 01:02:16 UTC (rev 118090)
@@ -1,3 +1,26 @@
+2012-05-22  Dana Jansens  <dan...@chromium.org>
+
+        [chromium] Don't force the visibleLayerRect to be empty for animating layers whose front face is not visible
+        https://bugs.webkit.org/show_bug.cgi?id=86886
+
+        Reviewed by Adrienne Walker.
+
+        Previously we would force the visibleLayerRect to be empty for these
+        animating layers, and then special case the pre-painting code to
+        paint them if they were within some size limit, to avoid having the
+        layer steal too much memory.
+
+        Instead, just use the visibleLayerRect given to the layer. Since the
+        transform flips the layer such that its back face is visible, it will
+        also compute a visibleLayerRect in the front face of the layer, and
+        its size will be bounded by the viewport. This will cause the
+        layer to be painted with visible priority instead of prepainted, but
+        ensures the visible parts of the layer is painted and ready to go when
+        the animation flips the layer around.
+
+        * platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
+        (WebCore::calculateVisibleLayerRect):
+
 2012-05-22  Jer Noble  <jer.no...@apple.com>
 
         REGRESSION (r98359): Video does not render on http://panic.com/dietcoda/

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp (118089 => 118090)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp	2012-05-23 00:41:03 UTC (rev 118089)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp	2012-05-23 01:02:16 UTC (rev 118090)
@@ -78,11 +78,6 @@
 {
     ASSERT(layer->targetRenderSurface());
 
-    // Animated layers can exist in the render surface tree that are not visible currently
-    // and have their back face showing. In this case, their visible rect should be empty.
-    if (!layer->doubleSided() && layer->screenSpaceTransform().isBackFaceVisible())
-        return IntRect();
-
     IntRect targetSurfaceRect = layer->targetRenderSurface()->contentRect();
 
     if (layer->usesLayerClipping())

Modified: trunk/Source/WebKit/chromium/ChangeLog (118089 => 118090)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-05-23 00:41:03 UTC (rev 118089)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-05-23 01:02:16 UTC (rev 118090)
@@ -1,3 +1,13 @@
+2012-05-22  Dana Jansens  <dan...@chromium.org>
+
+        [chromium] Don't force the visibleLayerRect to be empty for animating layers whose front face is not visible
+        https://bugs.webkit.org/show_bug.cgi?id=86886
+
+        Reviewed by Adrienne Walker.
+
+        * tests/CCLayerTreeHostCommonTest.cpp:
+        (WebKitTests::TEST):
+
 2012-05-22  Mark Pilgrim  <pilg...@chromium.org>
 
         [Chromium] Move cookieJar to Platform.h

Modified: trunk/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp (118089 => 118090)


--- trunk/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp	2012-05-23 00:41:03 UTC (rev 118089)
+++ trunk/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp	2012-05-23 01:02:16 UTC (rev 118090)
@@ -1318,11 +1318,11 @@
 
     EXPECT_FALSE(child2->visibleLayerRect().isEmpty());
 
-    // But if the back face is visible, then the visibleLayerRect should be empty.
-    EXPECT_TRUE(animatingChild->visibleLayerRect().isEmpty());
-    EXPECT_TRUE(animatingSurface->visibleLayerRect().isEmpty());
-    // And any layers in the subtree should not be considered visible either.
-    EXPECT_TRUE(childOfAnimatingSurface->visibleLayerRect().isEmpty());
+    // The animating layers should have a visibleLayerRect that represents the area of the front face that is within the viewport.
+    EXPECT_EQ(animatingChild->visibleLayerRect(), IntRect(IntPoint(), animatingChild->contentBounds()));
+    EXPECT_EQ(animatingSurface->visibleLayerRect(), IntRect(IntPoint(), animatingSurface->contentBounds()));
+    // And layers in the subtree of the animating layer should have valid visibleLayerRects also.
+    EXPECT_EQ(childOfAnimatingSurface->visibleLayerRect(), IntRect(IntPoint(), childOfAnimatingSurface->contentBounds()));
 }
 
 TEST(CCLayerTreeHostCommonTest, verifyBackFaceCullingWithPreserves3dForFlatteningSurface)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to