Modified: trunk/Source/WebCore/ChangeLog (111425 => 111426)
--- trunk/Source/WebCore/ChangeLog 2012-03-20 19:49:24 UTC (rev 111425)
+++ trunk/Source/WebCore/ChangeLog 2012-03-20 19:51:20 UTC (rev 111426)
@@ -1,3 +1,15 @@
+2012-03-20 Dana Jansens <[email protected]>
+
+ [chromium] Use opaque contents for paint culling
+ https://bugs.webkit.org/show_bug.cgi?id=81676
+
+ Reviewed by Adrienne Walker.
+
+ UnitTest: CCLayerTreeHostTestContentLayerOcclusion
+
+ * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+ (WebCore::CCLayerTreeHost::paintLayerContents):
+
2012-03-20 Dan Bernstein <[email protected]>
Build fix after r111419.
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp (111425 => 111426)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp 2012-03-20 19:49:24 UTC (rev 111425)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp 2012-03-20 19:51:20 UTC (rev 111426)
@@ -548,7 +548,7 @@
typedef CCLayerIterator<LayerChromium, Vector<RefPtr<LayerChromium> >, RenderSurfaceChromium, CCLayerIteratorActions::FrontToBack> CCLayerIteratorType;
CCOcclusionTracker occlusionTracker(IntRect(IntPoint(), viewportSize()));
- occlusionTracker.setUsePaintTracking(false); // FIXME: Remove this to turn on paint tracking for paint culling
+ occlusionTracker.setUsePaintTracking(true); // FIXME: Remove this after m19 branch.
CCLayerIteratorType end = CCLayerIteratorType::end(&renderSurfaceLayerList);
for (CCLayerIteratorType it = CCLayerIteratorType::begin(&renderSurfaceLayerList); it != end; ++it) {
Modified: trunk/Source/WebKit/chromium/ChangeLog (111425 => 111426)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-03-20 19:49:24 UTC (rev 111425)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-03-20 19:51:20 UTC (rev 111426)
@@ -1,3 +1,20 @@
+2012-03-20 Dana Jansens <[email protected]>
+
+ [chromium] Use opaque contents for paint culling
+ https://bugs.webkit.org/show_bug.cgi?id=81676
+
+ Reviewed by Adrienne Walker.
+
+ * tests/CCLayerTreeHostTest.cpp:
+ (WTF::TestLayerChromium::opaqueContentsRegion):
+ (WTF::TestLayerChromium::setOpaqueContentsRect):
+ (TestLayerChromium):
+ (CCLayerTreeHostTestContentLayerOcclusion):
+ (WTF::CCLayerTreeHostTestContentLayerOcclusion::CCLayerTreeHostTestContentLayerOcclusion):
+ (WTF::CCLayerTreeHostTestContentLayerOcclusion::beginTest):
+ (WTF::CCLayerTreeHostTestContentLayerOcclusion::afterTest):
+ (WTF):
+
2012-03-20 W. James MacLean <[email protected]>
[chromium] Tune fling physics curve. [Not for review yet]
Modified: trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp (111425 => 111426)
--- trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp 2012-03-20 19:49:24 UTC (rev 111425)
+++ trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp 2012-03-20 19:51:20 UTC (rev 111426)
@@ -1664,6 +1664,9 @@
virtual bool drawsContent() const { return true; }
+ virtual Region opaqueContentsRegion() const { return intersection(m_opaqueContentsRect, visibleLayerRect()); }
+ void setOpaqueContentsRect(const IntRect& opaqueContentsRect) { m_opaqueContentsRect = opaqueContentsRect; }
+
const Region& occludedScreenSpace() const { return m_occludedScreenSpace; }
void clearOccludedScreenSpace() { m_occludedScreenSpace = Region(); }
@@ -1671,6 +1674,7 @@
TestLayerChromium() : LayerChromium() { }
Region m_occludedScreenSpace;
+ IntRect m_opaqueContentsRect;
};
static void setLayerPropertiesForTesting(TestLayerChromium* layer, LayerChromium* parent, const TransformationMatrix& transform, const FloatPoint& anchor, const FloatPoint& position, const IntSize& bounds, bool opaque)
@@ -1887,6 +1891,46 @@
SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestLayerOcclusion)
+class CCLayerTreeHostTestContentLayerOcclusion : public CCLayerTreeHostTest {
+public:
+ CCLayerTreeHostTestContentLayerOcclusion() { }
+
+ virtual void beginTest()
+ {
+ RefPtr<TestLayerChromium> rootLayer = TestLayerChromium::create();
+ RefPtr<TestLayerChromium> child = TestLayerChromium::create();
+
+ TransformationMatrix identityMatrix;
+ setLayerPropertiesForTesting(rootLayer.get(), 0, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), true);
+ setLayerPropertiesForTesting(child.get(), rootLayer.get(), identityMatrix, FloatPoint(0, 0), FloatPoint(30, 30), IntSize(50, 50), false);
+
+ child->setOpaqueContentsRect(IntRect(10, 10, 20, 20));
+
+ m_layerTreeHost->setRootLayer(rootLayer);
+ m_layerTreeHost->setViewportSize(rootLayer->bounds());
+ m_layerTreeHost->updateLayers();
+ m_layerTreeHost->commitComplete();
+
+ EXPECT_EQ_RECT(IntRect(), child->occludedScreenSpace().bounds());
+ EXPECT_EQ(0u, child->occludedScreenSpace().rects().size());
+
+ EXPECT_EQ_RECT(IntRect(40, 40, 20, 20), rootLayer->occludedScreenSpace().bounds());
+ EXPECT_EQ(1u, rootLayer->occludedScreenSpace().rects().size());
+
+ // Kill the layerTreeHost immediately.
+ m_layerTreeHost->setRootLayer(0);
+ m_layerTreeHost.clear();
+
+ endTest();
+ }
+
+ virtual void afterTest()
+ {
+ }
+};
+
+SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestContentLayerOcclusion)
+
class CCLayerTreeHostTestLayerOcclusionWithFilters : public CCLayerTreeHostTest {
public:
CCLayerTreeHostTestLayerOcclusionWithFilters() { }