[chromium] Flip transition painting delayed with threaded animations
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Apr 2012 18:58:08 +0000 (18:58 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Apr 2012 18:58:08 +0000 (18:58 +0000)
commit84d5c4cdacff761a44a1d8f6898906e42c69fc9e
treefde2dcc3c5350cea5952b6c98f51ce8bdde536cd
parent885378d7521d6ebcdb25c2803832f58a7ac7fa0a
[chromium] Flip transition painting delayed with threaded animations
https://bugs.webkit.org/show_bug.cgi?id=82571

Patch by Dana Jansens <danakj@chromium.org> on 2012-04-09
Reviewed by Adrienne Walker.

Source/WebCore:

This allows for prepainting to see and paint layers that are not facing
the camera but have animating transforms. This is needed to prepaint
animations that "flip" layers around to make the front visible.

The changes are to add a backFaceIsVisible() helper function in
CCLTHCommon. This is used like before to cull non-double sided
layers, but culling is prevented on main thread when the screen
space transform is unknown due to animation. We add new
helper methods transformToScreenIsKnown() to identify this.

However the layer is not actually visible, so we set the
visibleLayerRect to be empty in this case.

The calculateVisibleLayerRect needs to use the backFaceIsVisible()
helper, so we move it into the .cpp file where it belongs, and make
it static to the file since it is not used outide of CCLTHCommon.cpp
at all.

Unit test: CCLayerTreeHostCommonTest.verifyBackFaceCulling

* platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
(WebCore):
(WebCore::backFaceIsVisible):
(WebCore::calculateVisibleLayerRect):
(WebCore::layerOpacityIsOpaque):
(WebCore::transformToParentIsKnown):
(WebCore::transformToScreenIsKnown):
(WebCore::layerShouldBeSkipped):
(WebCore::calculateDrawTransformsAndVisibilityInternal):
(WebCore::walkLayersAndCalculateVisibleLayerRects):
* platform/graphics/chromium/cc/CCLayerTreeHostCommon.h:
(WebCore):

Source/WebKit/chromium:

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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113602 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp