Changeset 122511 in webkit


Ignore:
Timestamp:
Jul 12, 2012 2:42:31 PM (12 years ago)
Author:
danakj@chromium.org
Message:

[chromium] The root layer should not try create a second RenderSurface for itself
https://bugs.webkit.org/show_bug.cgi?id=91124

Reviewed by Adrienne Walker.

Source/WebCore:

Tests: CCLayerTreeHostImplTest.rootLayerDoesntCreateExtraSurface

  • platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:

(WebCore::subtreeShouldRenderToSeparateSurface):

Source/WebKit/chromium:

  • tests/CCLayerTreeHostImplTest.cpp:
Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r122509 r122511  
     12012-07-12  Dana Jansens  <danakj@chromium.org>
     2
     3        [chromium] The root layer should not try create a second RenderSurface for itself
     4        https://bugs.webkit.org/show_bug.cgi?id=91124
     5
     6        Reviewed by Adrienne Walker.
     7
     8        Tests: CCLayerTreeHostImplTest.rootLayerDoesntCreateExtraSurface
     9
     10        * platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
     11        (WebCore::subtreeShouldRenderToSeparateSurface):
     12
    1132012-07-12  Adam Barth  <abarth@webkit.org>
    214
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp

    r122373 r122511  
    262262static bool subtreeShouldRenderToSeparateSurface(LayerType* layer, bool axisAlignedWithRespectToParent)
    263263{
     264    // The root layer has a special render surface that is set up externally, so
     265    // it shouldn't be treated as a surface in this code.
     266    if (!layer->parent())
     267        return false;
     268
    264269    // Cache this value, because otherwise it walks the entire subtree several times.
    265270    bool descendantDrawsContent = layer->descendantDrawsContent();
  • trunk/Source/WebKit/chromium/ChangeLog

    r122506 r122511  
     12012-07-12  Dana Jansens  <danakj@chromium.org>
     2
     3        [chromium] The root layer should not try create a second RenderSurface for itself
     4        https://bugs.webkit.org/show_bug.cgi?id=91124
     5
     6        Reviewed by Adrienne Walker.
     7
     8        * tests/CCLayerTreeHostImplTest.cpp:
     9
    1102012-07-12  Eric Penner  <epenner@google.com>
    211
  • trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp

    r122506 r122511  
    16271627    EXPECT_EQ(expectedSwapRect.width(), actualSwapRect.width());
    16281628    EXPECT_EQ(expectedSwapRect.height(), actualSwapRect.height());
     1629}
     1630
     1631TEST_F(CCLayerTreeHostImplTest, rootLayerDoesntCreateExtraSurface)
     1632{
     1633    CCLayerImpl* root = new FakeDrawableCCLayerImpl(1);
     1634    CCLayerImpl* child = new FakeDrawableCCLayerImpl(2);
     1635    child->setAnchorPoint(FloatPoint(0, 0));
     1636    child->setBounds(IntSize(10, 10));
     1637    child->setDrawsContent(true);
     1638    root->setAnchorPoint(FloatPoint(0, 0));
     1639    root->setBounds(IntSize(10, 10));
     1640    root->setDrawsContent(true);
     1641    root->setOpacity(0.7f);
     1642    root->addChild(adoptPtr(child));
     1643
     1644    m_hostImpl->setRootLayer(adoptPtr(root));
     1645
     1646    CCLayerTreeHostImpl::FrameData frame;
     1647
     1648    EXPECT_TRUE(m_hostImpl->prepareToDraw(frame));
     1649    EXPECT_EQ(1u, frame.renderSurfaceLayerList->size());
     1650    EXPECT_EQ(1u, frame.renderPasses.size());
    16291651}
    16301652
Note: See TracChangeset for help on using the changeset viewer.