Title: [122360] trunk/Source
Revision
122360
Author
[email protected]
Date
2012-07-11 13:14:28 -0700 (Wed, 11 Jul 2012)

Log Message

[chromium] Minimum size used for occlusion tracking should be a setting on CCLayerTreeHost
https://bugs.webkit.org/show_bug.cgi?id=90993

Reviewed by Adrienne Walker.

Source/WebCore:

Move the default minimum size used for occlusion tracking from the
CCOcclusionTracker class into CCLayerTreeSettings. This value is then
used on both threads as the lower limit for any occlusion to be
remembered.

This allows us to use (0, 0) as the minimum size for tests, allowing all
occlusion to be tracked.

* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::paintLayerContents):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(WebCore::CCLayerTreeSettings::CCLayerTreeSettings):
(CCLayerTreeSettings):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::calculateRenderPasses):
* platform/graphics/chromium/cc/CCOcclusionTracker.h:

Source/WebKit/chromium:

* tests/CCLayerTreeHostImplTest.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (122359 => 122360)


--- trunk/Source/WebCore/ChangeLog	2012-07-11 20:02:10 UTC (rev 122359)
+++ trunk/Source/WebCore/ChangeLog	2012-07-11 20:14:28 UTC (rev 122360)
@@ -1,3 +1,27 @@
+2012-07-11  Dana Jansens  <[email protected]>
+
+        [chromium] Minimum size used for occlusion tracking should be a setting on CCLayerTreeHost
+        https://bugs.webkit.org/show_bug.cgi?id=90993
+
+        Reviewed by Adrienne Walker.
+
+        Move the default minimum size used for occlusion tracking from the
+        CCOcclusionTracker class into CCLayerTreeSettings. This value is then
+        used on both threads as the lower limit for any occlusion to be
+        remembered.
+
+        This allows us to use (0, 0) as the minimum size for tests, allowing all
+        occlusion to be tracked.
+
+        * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+        (WebCore::CCLayerTreeHost::paintLayerContents):
+        * platform/graphics/chromium/cc/CCLayerTreeHost.h:
+        (WebCore::CCLayerTreeSettings::CCLayerTreeSettings):
+        (CCLayerTreeSettings):
+        * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+        (WebCore::CCLayerTreeHostImpl::calculateRenderPasses):
+        * platform/graphics/chromium/cc/CCOcclusionTracker.h:
+
 2012-07-11  Anders Carlsson  <[email protected]>
 
         Add -Wtautological-compare and -Wsign-compare warning flags

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp (122359 => 122360)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp	2012-07-11 20:02:10 UTC (rev 122359)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp	2012-07-11 20:14:28 UTC (rev 122360)
@@ -574,7 +574,7 @@
     bool needMoreUpdates = false;
     bool recordMetricsForFrame = true; // FIXME: In the future, disable this when about:tracing is off.
     CCOcclusionTracker occlusionTracker(IntRect(IntPoint(), deviceViewportSize()), recordMetricsForFrame);
-    occlusionTracker.setMinimumTrackingSize(CCOcclusionTracker::preferredMinimumTrackingSize());
+    occlusionTracker.setMinimumTrackingSize(m_settings.minimumOcclusionTrackingSize);
 
     CCLayerIteratorType end = CCLayerIteratorType::end(&renderSurfaceLayerList);
     for (CCLayerIteratorType it = CCLayerIteratorType::begin(&renderSurfaceLayerList); it != end; ++it) {

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h (122359 => 122360)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h	2012-07-11 20:02:10 UTC (rev 122359)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h	2012-07-11 20:14:28 UTC (rev 122360)
@@ -96,6 +96,7 @@
             , maxPartialTextureUpdates(std::numeric_limits<size_t>::max())
             , defaultTileSize(IntSize(256, 256))
             , maxUntiledLayerSize(IntSize(512, 512))
+            , minimumOcclusionTrackingSize(IntSize(160, 160))
     { }
 
     bool acceleratePainting;
@@ -112,6 +113,7 @@
     size_t maxPartialTextureUpdates;
     IntSize defaultTileSize;
     IntSize maxUntiledLayerSize;
+    IntSize minimumOcclusionTrackingSize;
 };
 
 // Provides information on an Impl's rendering capabilities back to the CCLayerTreeHost

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp (122359 => 122360)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp	2012-07-11 20:02:10 UTC (rev 122359)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp	2012-07-11 20:14:28 UTC (rev 122360)
@@ -305,7 +305,7 @@
 
     bool recordMetricsForFrame = true; // FIXME: In the future, disable this when about:tracing is off.
     CCOcclusionTrackerImpl occlusionTracker(enclosingIntRect(m_rootScissorRect), recordMetricsForFrame);
-    occlusionTracker.setMinimumTrackingSize(CCOcclusionTrackerImpl::preferredMinimumTrackingSize());
+    occlusionTracker.setMinimumTrackingSize(m_settings.minimumOcclusionTrackingSize);
 
     if (settings().showOccludingRects)
         occlusionTracker.setOccludingScreenSpaceRectsContainer(&frame.occludingScreenSpaceRects);

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.h (122359 => 122360)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.h	2012-07-11 20:02:10 UTC (rev 122359)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.h	2012-07-11 20:14:28 UTC (rev 122360)
@@ -70,8 +70,6 @@
 
     void setMinimumTrackingSize(const IntSize& size) { m_minimumTrackingSize = size; }
 
-    static IntSize preferredMinimumTrackingSize() { return IntSize(160, 160); }
-
     // The following is used for visualization purposes.
     void setOccludingScreenSpaceRectsContainer(Vector<IntRect>* rects) { m_occludingScreenSpaceRects = rects; }
 

Modified: trunk/Source/WebKit/chromium/ChangeLog (122359 => 122360)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-07-11 20:02:10 UTC (rev 122359)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-07-11 20:14:28 UTC (rev 122360)
@@ -1,3 +1,12 @@
+2012-07-11  Dana Jansens  <[email protected]>
+
+        [chromium] Minimum size used for occlusion tracking should be a setting on CCLayerTreeHost
+        https://bugs.webkit.org/show_bug.cgi?id=90993
+
+        Reviewed by Adrienne Walker.
+
+        * tests/CCLayerTreeHostImplTest.cpp:
+
 2012-07-11  Adam Barth  <[email protected]>
 
         [Chromium] Enable LEGACY_VIEWPORT_ADAPTION

Modified: trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp (122359 => 122360)


--- trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp	2012-07-11 20:02:10 UTC (rev 122359)
+++ trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp	2012-07-11 20:14:28 UTC (rev 122360)
@@ -70,6 +70,8 @@
         , m_didRequestRedraw(false)
     {
         CCLayerTreeSettings settings;
+        settings.minimumOcclusionTrackingSize = IntSize();
+
         m_hostImpl = CCLayerTreeHostImpl::create(settings, this);
         m_hostImpl->initializeLayerRenderer(createContext(), UnthrottledUploader);
         m_hostImpl->setViewportSize(IntSize(10, 10));
@@ -86,6 +88,8 @@
         CCSettings::setPartialSwapEnabled(partialSwap);
 
         CCLayerTreeSettings settings;
+        settings.minimumOcclusionTrackingSize = IntSize();
+
         OwnPtr<CCLayerTreeHostImpl> myHostImpl = CCLayerTreeHostImpl::create(settings, this);
 
         myHostImpl->initializeLayerRenderer(graphicsContext, UnthrottledUploader);
@@ -684,7 +688,6 @@
 
 TEST_F(CCLayerTreeHostImplTest, willDrawNotCalledOnOccludedLayer)
 {
-    // Make the viewport large so that we can have large layers that get considered for occlusion (small layers do not).
     IntSize bigSize(1000, 1000);
     m_hostImpl->setViewportSize(bigSize);
 
@@ -1184,10 +1187,8 @@
     IntRect m_quadVisibleRect;
 };
 
-// https://bugs.webkit.org/show_bug.cgi?id=75783
 TEST_F(CCLayerTreeHostImplTest, blendingOffWhenDrawingOpaqueLayers)
 {
-
     {
         OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
         root->setAnchorPoint(FloatPoint(0, 0));
@@ -1200,6 +1201,7 @@
 
     root->addChild(BlendStateCheckLayer::create(2));
     BlendStateCheckLayer* layer1 = static_cast<BlendStateCheckLayer*>(root->children()[0].get());
+    layer1->setPosition(FloatPoint(2, 2));
 
     CCLayerTreeHostImpl::FrameData frame;
 
@@ -1252,6 +1254,7 @@
 
     layer1->addChild(BlendStateCheckLayer::create(3));
     BlendStateCheckLayer* layer2 = static_cast<BlendStateCheckLayer*>(layer1->children()[0].get());
+    layer2->setPosition(FloatPoint(4, 4));
 
     // 2 opaque layers, drawn without blending.
     layer1->setOpaque(true);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to