Changeset 122360 in webkit


Ignore:
Timestamp:
Jul 11, 2012 1:14:28 PM (12 years ago)
Author:
danakj@chromium.org
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:
Location:
trunk/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r122356 r122360  
     12012-07-11  Dana Jansens  <danakj@chromium.org>
     2
     3        [chromium] Minimum size used for occlusion tracking should be a setting on CCLayerTreeHost
     4        https://bugs.webkit.org/show_bug.cgi?id=90993
     5
     6        Reviewed by Adrienne Walker.
     7
     8        Move the default minimum size used for occlusion tracking from the
     9        CCOcclusionTracker class into CCLayerTreeSettings. This value is then
     10        used on both threads as the lower limit for any occlusion to be
     11        remembered.
     12
     13        This allows us to use (0, 0) as the minimum size for tests, allowing all
     14        occlusion to be tracked.
     15
     16        * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
     17        (WebCore::CCLayerTreeHost::paintLayerContents):
     18        * platform/graphics/chromium/cc/CCLayerTreeHost.h:
     19        (WebCore::CCLayerTreeSettings::CCLayerTreeSettings):
     20        (CCLayerTreeSettings):
     21        * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
     22        (WebCore::CCLayerTreeHostImpl::calculateRenderPasses):
     23        * platform/graphics/chromium/cc/CCOcclusionTracker.h:
     24
    1252012-07-11  Anders Carlsson  <andersca@apple.com>
    226
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp

    r122185 r122360  
    575575    bool recordMetricsForFrame = true; // FIXME: In the future, disable this when about:tracing is off.
    576576    CCOcclusionTracker occlusionTracker(IntRect(IntPoint(), deviceViewportSize()), recordMetricsForFrame);
    577     occlusionTracker.setMinimumTrackingSize(CCOcclusionTracker::preferredMinimumTrackingSize());
     577    occlusionTracker.setMinimumTrackingSize(m_settings.minimumOcclusionTrackingSize);
    578578
    579579    CCLayerIteratorType end = CCLayerIteratorType::end(&renderSurfaceLayerList);
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h

    r122185 r122360  
    9797            , defaultTileSize(IntSize(256, 256))
    9898            , maxUntiledLayerSize(IntSize(512, 512))
     99            , minimumOcclusionTrackingSize(IntSize(160, 160))
    99100    { }
    100101
     
    113114    IntSize defaultTileSize;
    114115    IntSize maxUntiledLayerSize;
     116    IntSize minimumOcclusionTrackingSize;
    115117};
    116118
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp

    r122252 r122360  
    306306    bool recordMetricsForFrame = true; // FIXME: In the future, disable this when about:tracing is off.
    307307    CCOcclusionTrackerImpl occlusionTracker(enclosingIntRect(m_rootScissorRect), recordMetricsForFrame);
    308     occlusionTracker.setMinimumTrackingSize(CCOcclusionTrackerImpl::preferredMinimumTrackingSize());
     308    occlusionTracker.setMinimumTrackingSize(m_settings.minimumOcclusionTrackingSize);
    309309
    310310    if (settings().showOccludingRects)
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.h

    r121361 r122360  
    7171    void setMinimumTrackingSize(const IntSize& size) { m_minimumTrackingSize = size; }
    7272
    73     static IntSize preferredMinimumTrackingSize() { return IntSize(160, 160); }
    74 
    7573    // The following is used for visualization purposes.
    7674    void setOccludingScreenSpaceRectsContainer(Vector<IntRect>* rects) { m_occludingScreenSpaceRects = rects; }
  • trunk/Source/WebKit/chromium/ChangeLog

    r122359 r122360  
     12012-07-11  Dana Jansens  <danakj@chromium.org>
     2
     3        [chromium] Minimum size used for occlusion tracking should be a setting on CCLayerTreeHost
     4        https://bugs.webkit.org/show_bug.cgi?id=90993
     5
     6        Reviewed by Adrienne Walker.
     7
     8        * tests/CCLayerTreeHostImplTest.cpp:
     9
    1102012-07-11  Adam Barth  <abarth@webkit.org>
    211
  • trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp

    r122272 r122360  
    7171    {
    7272        CCLayerTreeSettings settings;
     73        settings.minimumOcclusionTrackingSize = IntSize();
     74
    7375        m_hostImpl = CCLayerTreeHostImpl::create(settings, this);
    7476        m_hostImpl->initializeLayerRenderer(createContext(), UnthrottledUploader);
     
    8789
    8890        CCLayerTreeSettings settings;
     91        settings.minimumOcclusionTrackingSize = IntSize();
     92
    8993        OwnPtr<CCLayerTreeHostImpl> myHostImpl = CCLayerTreeHostImpl::create(settings, this);
    9094
     
    685689TEST_F(CCLayerTreeHostImplTest, willDrawNotCalledOnOccludedLayer)
    686690{
    687     // Make the viewport large so that we can have large layers that get considered for occlusion (small layers do not).
    688691    IntSize bigSize(1000, 1000);
    689692    m_hostImpl->setViewportSize(bigSize);
     
    11851188};
    11861189
    1187 // https://bugs.webkit.org/show_bug.cgi?id=75783
    11881190TEST_F(CCLayerTreeHostImplTest, blendingOffWhenDrawingOpaqueLayers)
    11891191{
    1190 
    11911192    {
    11921193        OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
     
    12011202    root->addChild(BlendStateCheckLayer::create(2));
    12021203    BlendStateCheckLayer* layer1 = static_cast<BlendStateCheckLayer*>(root->children()[0].get());
     1204    layer1->setPosition(FloatPoint(2, 2));
    12031205
    12041206    CCLayerTreeHostImpl::FrameData frame;
     
    12531255    layer1->addChild(BlendStateCheckLayer::create(3));
    12541256    BlendStateCheckLayer* layer2 = static_cast<BlendStateCheckLayer*>(layer1->children()[0].get());
     1257    layer2->setPosition(FloatPoint(4, 4));
    12551258
    12561259    // 2 opaque layers, drawn without blending.
Note: See TracChangeset for help on using the changeset viewer.