Changeset 113350 in webkit
- Timestamp:
- Apr 5, 2012, 12:07:29 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r113347 r113350 1 2012-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 1 18 2012-04-05 Sheriff Bot <webkit.review.bot@gmail.com> 2 19 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
r113334 r113350 143 143 bool CCLayerTreeHostImpl::canDraw() 144 144 { 145 if (!rootLayer() || rootLayer()->bounds().isEmpty())145 if (!rootLayer()) 146 146 return false; 147 147 if (viewportSize().isEmpty()) … … 378 378 frame.renderSurfaceLayerList.clear(); 379 379 380 if (!rootLayer()) 381 return false; 382 380 383 if (!calculateRenderPasses(frame.renderPasses, frame.renderSurfaceLayerList)) 381 384 return false; -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
r113248 r113350 89 89 virtual void commitComplete(); 90 90 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. 92 92 virtual bool prepareToDraw(FrameData&); 93 93 virtual void drawLayers(const FrameData&); … … 103 103 104 104 // Implementation 105 106 // Returns false if there is no valid root layer and thus no content that can be drawn.107 105 bool canDraw(); 108 106 GraphicsContext3D* context(); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp
r113241 r113350 579 579 m_layerTreeHostImpl->animate(monotonicTime, wallClockTime); 580 580 CCLayerTreeHostImpl::FrameData frame; 581 bool drawFrame = m_layerTreeHostImpl-> canDraw() && (m_layerTreeHostImpl->prepareToDraw(frame) || forcedDraw);581 bool drawFrame = m_layerTreeHostImpl->prepareToDraw(frame) || forcedDraw; 582 582 if (drawFrame) { 583 583 m_layerTreeHostImpl->drawLayers(frame); … … 587 587 // Check for a pending compositeAndReadback. 588 588 if (m_readbackRequestOnImplThread) { 589 if (drawFrame)590 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(); 592 592 m_readbackRequestOnImplThread->completion.signal(); 593 593 m_readbackRequestOnImplThread = 0; … … 599 599 // Process any finish request 600 600 if (m_finishAllRenderingCompletionEventOnImplThread) { 601 ASSERT(drawFrame); // This should be a forcedDraw 601 602 m_layerTreeHostImpl->finishAllRendering(); 602 603 m_finishAllRenderingCompletionEventOnImplThread->signal(); … … 610 611 } 611 612 613 ASSERT(drawFrame || (!drawFrame && !forcedDraw)); 612 614 return result; 613 615 } -
trunk/Source/WebKit/chromium/ChangeLog
r113347 r113350 1 2012-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 1 15 2012-04-05 Sheriff Bot <webkit.review.bot@gmail.com> 2 16 -
trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
r113241 r113350 249 249 250 250 OwnPtr<CCLayerImpl> root = CCLayerImpl::create(0); 251 root->setBounds(IntSize(1, 1));252 251 root->setScrollable(true); 253 252 root->setScrollPosition(IntPoint(0, 0)); -
trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
r113346 r113350 535 535 536 536 RefPtr<LayerChromium> rootLayer = LayerChromium::create(); 537 538 // Only non-empty root layers will cause drawing to happen.539 rootLayer->setBounds(IntSize(1, 1));540 541 537 m_layerTreeHost = MockLayerTreeHost::create(this, m_client.get(), rootLayer, m_settings); 542 538 ASSERT_TRUE(m_layerTreeHost); … … 824 820 825 821 TEST_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 be831 // pushing any frames as the contents will be undefined. Regardless, forced draws need832 // 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)876 822 { 877 823 runTestThreaded();
Note:
See TracChangeset
for help on using the changeset viewer.