[chromium] Store origin/screen space transforms for surface and replica in the surface
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Mar 2012 05:02:57 +0000 (05:02 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Mar 2012 05:02:57 +0000 (05:02 +0000)
commitb24d9681ec2cce25dcef62dd9f5928ec27d7f5b5
tree49a02802e6df4028f2828573cf2e5638ed9d52c5
parent998c818cdc7ba5b2e5285f849388bccf15f8e7ae
[chromium] Store origin/screen space transforms for surface and replica in the surface
https://bugs.webkit.org/show_bug.cgi?id=81296

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

Source/WebCore:

Compute and save a number of transforms for render surfaces. The origin
tranform for the replica into its target surface. The origin transform
for the replica into the screen. And the origin transform for the surface
into the screen.

These transforms will allow us to detect occlusion of render surfaces,
allowing us to cull (or partially-cull) the render surface quad during
drawing.

This also fixes a subtle bug in the transforms used by the damage
tracking code.

Unit test: CCLayerTreeHostCommonTest.verifyTransformsForSingleRenderSurface
           CCLayerTreeHostCommonTest.verifyTransformsForReplica
           CCLayerTreeHostCommonTest.verifyTransformsForRenderSurfaceHierarchy

* platform/graphics/chromium/RenderSurfaceChromium.h:
(WebCore::RenderSurfaceChromium::screenSpaceTransform):
(WebCore::RenderSurfaceChromium::setScreenSpaceTransform):
(RenderSurfaceChromium):
(WebCore::RenderSurfaceChromium::replicaOriginTransform):
(WebCore::RenderSurfaceChromium::setReplicaOriginTransform):
(WebCore::RenderSurfaceChromium::replicaScreenSpaceTransform):
(WebCore::RenderSurfaceChromium::setReplicaScreenSpaceTransform):
* platform/graphics/chromium/cc/CCDamageTracker.cpp:
(WebCore::CCDamageTracker::extendDamageForRenderSurface):
* platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
(WebCore::calculateDrawTransformsAndVisibilityInternal):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::damageInSurfaceSpace):
* platform/graphics/chromium/cc/CCRenderSurface.h:
(WebCore::CCRenderSurface::setDrawTransform):
(WebCore::CCRenderSurface::drawTransform):
(WebCore::CCRenderSurface::setScreenSpaceTransform):
(WebCore::CCRenderSurface::screenSpaceTransform):
(CCRenderSurface):
(WebCore::CCRenderSurface::setReplicaDrawTransform):
(WebCore::CCRenderSurface::replicaDrawTransform):
(WebCore::CCRenderSurface::setReplicaOriginTransform):
(WebCore::CCRenderSurface::replicaOriginTransform):
(WebCore::CCRenderSurface::setReplicaScreenSpaceTransform):
(WebCore::CCRenderSurface::replicaScreenSpaceTransform):

Source/WebKit/chromium:

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111499 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.h
Source/WebCore/platform/graphics/chromium/cc/CCDamageTracker.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp