Title: [118219] trunk/Source
Revision
118219
Author
[email protected]
Date
2012-05-23 11:57:36 -0700 (Wed, 23 May 2012)

Log Message

[chromium] Layers on main thread should get a RenderSurface for animating transform only if masksToBounds is true also
https://bugs.webkit.org/show_bug.cgi?id=87184

Reviewed by James Robinson.

Source/WebCore:

Layers on main thread get a RenderSurface if their impl counterpart may
have a RenderSurface due to its animating transform. We currently create
a RenderSurface for all layers with an animating transform and
a descendant that drawsContents. But a RenderSurface on impl also
implies that the layer masksToBounds. So only make a RenderSurface on
main thread when the layer also masksToBounds.

Modified unit test CCLayerTreeHostCommonTest.verifyAnimationsForRenderSurfaceHierarchy.

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

Source/WebKit/chromium:

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (118218 => 118219)


--- trunk/Source/WebCore/ChangeLog	2012-05-23 18:53:26 UTC (rev 118218)
+++ trunk/Source/WebCore/ChangeLog	2012-05-23 18:57:36 UTC (rev 118219)
@@ -1,3 +1,22 @@
+2012-05-23  Dana Jansens  <[email protected]>
+
+        [chromium] Layers on main thread should get a RenderSurface for animating transform only if masksToBounds is true also
+        https://bugs.webkit.org/show_bug.cgi?id=87184
+
+        Reviewed by James Robinson.
+
+        Layers on main thread get a RenderSurface if their impl counterpart may
+        have a RenderSurface due to its animating transform. We currently create
+        a RenderSurface for all layers with an animating transform and
+        a descendant that drawsContents. But a RenderSurface on impl also
+        implies that the layer masksToBounds. So only make a RenderSurface on
+        main thread when the layer also masksToBounds.
+
+        Modified unit test CCLayerTreeHostCommonTest.verifyAnimationsForRenderSurfaceHierarchy.
+
+        * platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
+        (WebCore::subtreeShouldRenderToSeparateSurface):
+
 2012-05-23  Chris Fleizach  <[email protected]>
 
         Regression(r112694): Crash in WebCore::AXObjectCache::postNotification 

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


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp	2012-05-23 18:53:26 UTC (rev 118218)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp	2012-05-23 18:57:36 UTC (rev 118219)
@@ -259,17 +259,16 @@
     if (layerIsInExisting3DRenderingContext(layer) && !layer->preserves3D() && descendantDrawsContent)
         return true;
 
-    // On the main thread side, animating transforms are unknown, and may cause a RenderSurface on the impl side.
-    // Since they are cheap, we create a rendersurface for all animating transforms to cover these cases, and so
-    // that we can consider descendants as not animating relative to their target to aid culling.
-    if (!transformToParentIsKnown(layer) && descendantDrawsContent)
-        return true;
-
     // If the layer clips its descendants but it is not axis-aligned with respect to its parent.
-    if (layer->masksToBounds() && !axisAlignedWithRespectToParent && descendantDrawsContent)
+    // On the main thread, when the transform is being animated, it is treated as unknown and we
+    // always error on the side of making a render surface, to let us consider descendents as
+    // not animating relative to their target to aid culling.
+    if (layer->masksToBounds() && (!axisAlignedWithRespectToParent || !transformToParentIsKnown(layer)) && descendantDrawsContent)
         return true;
 
     // If the layer has opacity != 1 and does not have a preserves-3d transform style.
+    // On the main thread, when opacity is being animated, it is treated as neither 1
+    // nor 0.
     if (!layerOpacityIsOpaque(layer) && !layer->preserves3D() && descendantDrawsContent)
         return true;
 

Modified: trunk/Source/WebKit/chromium/ChangeLog (118218 => 118219)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-05-23 18:53:26 UTC (rev 118218)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-05-23 18:57:36 UTC (rev 118219)
@@ -1,3 +1,13 @@
+2012-05-23  Dana Jansens  <[email protected]>
+
+        [chromium] Layers on main thread should get a RenderSurface for animating transform only if masksToBounds is true also
+        https://bugs.webkit.org/show_bug.cgi?id=87184
+
+        Reviewed by James Robinson.
+
+        * tests/CCLayerTreeHostCommonTest.cpp:
+        (WebKitTests::TEST):
+
 2012-05-23  Mark Pilgrim  <[email protected]>
 
         [Chromium] Move queryLocalizedString to Platform.h

Modified: trunk/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp (118218 => 118219)


--- trunk/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp	2012-05-23 18:53:26 UTC (rev 118218)
+++ trunk/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp	2012-05-23 18:57:36 UTC (rev 118219)
@@ -946,8 +946,9 @@
     TransformationMatrix sublayerTransform;
     sublayerTransform.scale3d(10.0, 1.0, 1.0);
 
-    // In combination with descendantDrawsContent, an animated transform forces the layer to have a new renderSurface.
+    // In combination with descendantDrawsContent and masksToBounds, an animated transform forces the layer to have a new renderSurface.
     addAnimatedTransformToController(*renderSurface2->layerAnimationController(), 10, 30, 0);
+    renderSurface2->setMasksToBounds(true);
 
     // Also put transform animations on grandChildOfRoot, and grandChildOfRS2
     addAnimatedTransformToController(*grandChildOfRoot->layerAnimationController(), 10, 30, 0);
@@ -1544,8 +1545,9 @@
     backfaceMatrix.rotate3d(0, 1, 0, 180);
     backfaceMatrix.translate(-50, -50);
 
-    // Having a descendant, and animating transforms, will make the animatingSurface own a render surface.
+    // Having a descendant that draws, masksToBounds, and animating transforms, will make the animatingSurface own a render surface.
     addAnimatedTransformToController(*animatingSurface->layerAnimationController(), 10, 30, 0);
+    animatingSurface->setMasksToBounds(true);
     // This is just an animating layer, not a surface.
     addAnimatedTransformToController(*animatingChild->layerAnimationController(), 10, 30, 0);
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to