[chromium] Use opaque paints in CCOcclusionTracker
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Mar 2012 20:22:55 +0000 (20:22 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Mar 2012 20:22:55 +0000 (20:22 +0000)
commitfeef52e7ab82fde7eb36abae0bfbf3059aa07212
tree16d818cbd5fe2b980580e818551d7ad61ae22250
parent01fdab2382ef1bd0e20bba7f738a694d9709f472
[chromium] Use opaque paints in CCOcclusionTracker
https://bugs.webkit.org/show_bug.cgi?id=80173

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

Source/WebCore:

Use tracked opaque paints in the tiles when tracking occlusion in
CCOcclusionTracker. Moves the Tile::m_opaqueRect up to the super-
class in CCLayerTilingData rather than having it declared in both
TiledLayerChromium and CCTiledLayerImpl. This lets the CCLayerTilingData
class compute the opaque region for its tiles, sharing code between the
two tiled layer implementations.

Use of this feature is guarded behind a runtime flag and turned off for
paint culling. We will enable it in the future once we're comfortable
with the paint culling.

Unit test: CCOcclusionTrackerTest.opaqueContentsRegionEmpty
           CCOcclusionTrackerTest.opaqueContentsRegionNonEmpty
           TiledLayerChromiumTest.opaqueContentsRegion

All existing CCOcclusionTrackerTest.* duplicated with opaque painted
rects.

* platform/graphics/chromium/LayerChromium.h:
(WebCore::LayerChromium::opaqueContentsRegion):
(LayerChromium):
* platform/graphics/chromium/TiledLayerChromium.cpp:
(UpdatableTile):
(WebCore::TiledLayerChromium::pushPropertiesTo):
(WebCore::TiledLayerChromium::prepareToUpdateTiles):
(WebCore::TiledLayerChromium::addSelfToOccludedScreenSpace):
(WebCore::TiledLayerChromium::opaqueContentsRegion):
(WebCore):
* platform/graphics/chromium/TiledLayerChromium.h:
* platform/graphics/chromium/cc/CCLayerImpl.h:
(WebCore::CCLayerImpl::opaqueContentsRegion):
(CCLayerImpl):
* platform/graphics/chromium/cc/CCLayerTilingData.cpp:
(WebCore::CCLayerTilingData::opaqueRegionInLayerRect):
(WebCore):
* platform/graphics/chromium/cc/CCLayerTilingData.h:
(WebCore):
(Tile):
(WebCore::CCLayerTilingData::Tile::opaqueRect):
(WebCore::CCLayerTilingData::Tile::setOpaqueRect):
(CCLayerTilingData):
* platform/graphics/chromium/cc/CCOcclusionTracker.cpp:
(WebCore::::CCOcclusionTrackerBase):
(WebCore::computeOcclusionBehindLayer):
(WebCore::::markOccludedBehindLayer):
* platform/graphics/chromium/cc/CCOcclusionTracker.h:
(CCOcclusionTrackerBase):
(WebCore::CCOcclusionTrackerBase::setUsePaintTracking):
* platform/graphics/chromium/cc/CCTiledLayerImpl.cpp:
(DrawableTile):
(WebCore::CCTiledLayerImpl::opaqueContentsRegion):
(WebCore):
* platform/graphics/chromium/cc/CCTiledLayerImpl.h:
(CCTiledLayerImpl):

Source/WebKit/chromium:

* tests/CCOcclusionTrackerTest.cpp:
(WebCore::LayerChromiumWithForcedDrawsContent::opaqueContentsRegion):
(LayerChromiumWithForcedDrawsContent):
(WebCore::LayerChromiumWithForcedDrawsContent::setOpaquePaintRect):
(WebCore::setLayerPropertiesForTesting):
(WebCore):
(WebCore::layerAddedToOccludedRegion):
(WebCore::layerAddedToOccludedRegionWithRotation):
(WebCore::layerAddedToOccludedRegionWithTranslation):
(WebCore::layerAddedToOccludedRegionWithRotatedSurface):
(WebCore::layerAddedToOccludedRegionWithSurfaceAlreadyOnStack):
(WebCore::layerAddedToOccludedRegionWithRotatedOffAxisSurface):
(WebCore::layerAddedToOccludedRegionWithMultipleOpaqueLayers):
(WebCore::surfaceOcclusionWithOverlappingSiblingSurfaces):
(WebCore::surfaceOcclusionInScreenSpace):
(WebCore::surfaceOcclusionInScreenSpaceDifferentTransforms):
(WebCore::occlusionInteractionWithFilters):
(WebCore::layerScissorRectOverTile):
(WebCore::screenScissorRectOverTile):
(WebCore::layerScissorRectOverCulledTile):
(WebCore::screenScissorRectOverCulledTile):
(WebCore::layerScissorRectOverPartialTiles):
(WebCore::screenScissorRectOverPartialTiles):
(WebCore::layerScissorRectOverNoTiles):
(WebCore::screenScissorRectOverNoTiles):
(WebCore::layerScissorRectForLayerOffOrigin):
(WebCore::damageRectOverTile):
(WebCore::damageRectOverCulledTile):
(WebCore::damageRectOverPartialTiles):
(WebCore::damageRectOverNoTiles):
(WebCore::TEST):
* tests/TiledLayerChromiumTest.cpp:
(WTF::TEST):
(WTF):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@110317 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/LayerChromium.h
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h
Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h
Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.h
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp
Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.h
Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp
Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp
Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp