Changeset 113350 in webkit


Ignore:
Timestamp:
Apr 5, 2012, 12:07:29 PM (13 years ago)
Author:
zmo@google.com
Message:

Unreviewed, rolling out r113241.
http://trac.webkit.org/changeset/113241
https://bugs.webkit.org/show_bug.cgi?id=83293

Requested by sievers@chromium.org (Requested by zhenyao on
#webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-04-05

Source/WebCore:

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

(WebCore::CCLayerTreeHostImpl::canDraw):
(WebCore::CCLayerTreeHostImpl::prepareToDraw):

  • platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:

(CCLayerTreeHostImpl):

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

(WebCore::CCThreadProxy::scheduledActionDrawAndSwapInternal):

Source/WebKit/chromium:

  • tests/CCLayerTreeHostImplTest.cpp:

(WebKitTests::TEST_F):

  • tests/CCLayerTreeHostTest.cpp:

(WTF::CCLayerTreeHostTest::doBeginTest):

Location:
trunk/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r113347 r113350  
     12012-04-05  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r113241.
     4        http://trac.webkit.org/changeset/113241
     5        https://bugs.webkit.org/show_bug.cgi?id=83293
     6
     7        Requested by sievers@chromium.org (Requested by zhenyao on
     8        #webkit).
     9
     10        * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
     11        (WebCore::CCLayerTreeHostImpl::canDraw):
     12        (WebCore::CCLayerTreeHostImpl::prepareToDraw):
     13        * platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
     14        (CCLayerTreeHostImpl):
     15        * platform/graphics/chromium/cc/CCThreadProxy.cpp:
     16        (WebCore::CCThreadProxy::scheduledActionDrawAndSwapInternal):
     17
    1182012-04-05  Sheriff Bot  <webkit.review.bot@gmail.com>
    219
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp

    r113334 r113350  
    143143bool CCLayerTreeHostImpl::canDraw()
    144144{
    145     if (!rootLayer() || rootLayer()->bounds().isEmpty())
     145    if (!rootLayer())
    146146        return false;
    147147    if (viewportSize().isEmpty())
     
    378378    frame.renderSurfaceLayerList.clear();
    379379
     380    if (!rootLayer())
     381        return false;
     382
    380383    if (!calculateRenderPasses(frame.renderPasses, frame.renderSurfaceLayerList))
    381384        return false;
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h

    r113248 r113350  
    8989    virtual void commitComplete();
    9090    virtual void animate(double monotonicTime, double wallClockTime);
    91     // Returns false if we should try to avoid displaying the frame, because it has visible checkerboard during an animation.
     91    // Returns false if problems occured preparing the frame, and we should try to avoid displaying the frame.
    9292    virtual bool prepareToDraw(FrameData&);
    9393    virtual void drawLayers(const FrameData&);
     
    103103
    104104    // Implementation
    105 
    106     // Returns false if there is no valid root layer and thus no content that can be drawn.
    107105    bool canDraw();
    108106    GraphicsContext3D* context();
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp

    r113241 r113350  
    579579    m_layerTreeHostImpl->animate(monotonicTime, wallClockTime);
    580580    CCLayerTreeHostImpl::FrameData frame;
    581     bool drawFrame = m_layerTreeHostImpl->canDraw() && (m_layerTreeHostImpl->prepareToDraw(frame) || forcedDraw);
     581    bool drawFrame = m_layerTreeHostImpl->prepareToDraw(frame) || forcedDraw;
    582582    if (drawFrame) {
    583583        m_layerTreeHostImpl->drawLayers(frame);
     
    587587    // Check for a pending compositeAndReadback.
    588588    if (m_readbackRequestOnImplThread) {
    589         if (drawFrame)
    590             m_layerTreeHostImpl->readback(m_readbackRequestOnImplThread->pixels, m_readbackRequestOnImplThread->rect);
    591         m_readbackRequestOnImplThread->success = !m_layerTreeHostImpl->isContextLost() && drawFrame;
     589        ASSERT(drawFrame); // This should be a forcedDraw
     590        m_layerTreeHostImpl->readback(m_readbackRequestOnImplThread->pixels, m_readbackRequestOnImplThread->rect);
     591        m_readbackRequestOnImplThread->success = !m_layerTreeHostImpl->isContextLost();
    592592        m_readbackRequestOnImplThread->completion.signal();
    593593        m_readbackRequestOnImplThread = 0;
     
    599599    // Process any finish request
    600600    if (m_finishAllRenderingCompletionEventOnImplThread) {
     601        ASSERT(drawFrame); // This should be a forcedDraw
    601602        m_layerTreeHostImpl->finishAllRendering();
    602603        m_finishAllRenderingCompletionEventOnImplThread->signal();
     
    610611    }
    611612
     613    ASSERT(drawFrame || (!drawFrame && !forcedDraw));
    612614    return result;
    613615}
  • trunk/Source/WebKit/chromium/ChangeLog

    r113347 r113350  
     12012-04-05  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r113241.
     4        http://trac.webkit.org/changeset/113241
     5        https://bugs.webkit.org/show_bug.cgi?id=83293
     6
     7        Requested by sievers@chromium.org (Requested by zhenyao on
     8        #webkit).
     9
     10        * tests/CCLayerTreeHostImplTest.cpp:
     11        (WebKitTests::TEST_F):
     12        * tests/CCLayerTreeHostTest.cpp:
     13        (WTF::CCLayerTreeHostTest::doBeginTest):
     14
    1152012-04-05  Sheriff Bot  <webkit.review.bot@gmail.com>
    216
  • trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp

    r113241 r113350  
    249249
    250250    OwnPtr<CCLayerImpl> root = CCLayerImpl::create(0);
    251     root->setBounds(IntSize(1, 1));
    252251    root->setScrollable(true);
    253252    root->setScrollPosition(IntPoint(0, 0));
  • trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp

    r113346 r113350  
    535535
    536536    RefPtr<LayerChromium> rootLayer = LayerChromium::create();
    537 
    538     // Only non-empty root layers will cause drawing to happen.
    539     rootLayer->setBounds(IntSize(1, 1));
    540 
    541537    m_layerTreeHost = MockLayerTreeHost::create(this, m_client.get(), rootLayer, m_settings);
    542538    ASSERT_TRUE(m_layerTreeHost);
     
    824820
    825821TEST_F(CCLayerTreeHostTestSetNeedsRedraw, runMultiThread)
    826 {
    827     runTestThreaded();
    828 }
    829 
    830 // If the root layer has no content bounds, we should see a commit, but should not be
    831 // pushing any frames as the contents will be undefined. Regardless, forced draws need
    832 // to always signal completion.
    833 class CCLayerTreeHostTestEmptyContentsShouldNotDraw : public CCLayerTreeHostTestThreadOnly {
    834 public:
    835     CCLayerTreeHostTestEmptyContentsShouldNotDraw()
    836         : m_numCommits(0)
    837     {
    838     }
    839 
    840     virtual void beginTest()
    841     {
    842     }
    843 
    844     virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl)
    845     {
    846         // Only the initial draw should bring us here.
    847         EXPECT_FALSE(impl->rootLayer()->bounds().isEmpty());
    848     }
    849 
    850     virtual void didCommitAndDrawFrame()
    851     {
    852         m_numCommits++;
    853         if (m_numCommits == 1) {
    854             // Put an empty root layer.
    855             RefPtr<LayerChromium> rootLayer = LayerChromium::create();
    856             m_layerTreeHost->setRootLayer(rootLayer);
    857 
    858             OwnArrayPtr<char> pixels(adoptArrayPtr(new char[4]));
    859             m_layerTreeHost->compositeAndReadback(static_cast<void*>(pixels.get()), IntRect(0, 0, 1, 1));
    860         } else if (m_numCommits == 2) {
    861             m_layerTreeHost->setNeedsCommit();
    862             m_layerTreeHost->finishAllRendering();
    863             endTest();
    864         }
    865     }
    866 
    867     virtual void afterTest()
    868     {
    869     }
    870 
    871 private:
    872     int m_numCommits;
    873 };
    874 
    875 TEST_F(CCLayerTreeHostTestEmptyContentsShouldNotDraw, runMultiThread)
    876822{
    877823    runTestThreaded();
Note: See TracChangeset for help on using the changeset viewer.