Title: [113350] trunk/Source
Revision
113350
Author
z...@google.com
Date
2012-04-05 12:07:29 -0700 (Thu, 05 Apr 2012)

Log Message

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

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

Patch by Sheriff Bot <webkit.review....@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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (113349 => 113350)


--- trunk/Source/WebCore/ChangeLog	2012-04-05 19:05:55 UTC (rev 113349)
+++ trunk/Source/WebCore/ChangeLog	2012-04-05 19:07:29 UTC (rev 113350)
@@ -1,5 +1,22 @@
 2012-04-05  Sheriff Bot  <webkit.review....@gmail.com>
 
+        Unreviewed, rolling out r113241.
+        http://trac.webkit.org/changeset/113241
+        https://bugs.webkit.org/show_bug.cgi?id=83293
+
+        Requested by siev...@chromium.org (Requested by zhenyao on
+        #webkit).
+
+        * 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):
+
+2012-04-05  Sheriff Bot  <webkit.review....@gmail.com>
+
         Unreviewed, rolling out r113341.
         http://trac.webkit.org/changeset/113341
         https://bugs.webkit.org/show_bug.cgi?id=83299

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


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp	2012-04-05 19:05:55 UTC (rev 113349)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp	2012-04-05 19:07:29 UTC (rev 113350)
@@ -142,7 +142,7 @@
 
 bool CCLayerTreeHostImpl::canDraw()
 {
-    if (!rootLayer() || rootLayer()->bounds().isEmpty())
+    if (!rootLayer())
         return false;
     if (viewportSize().isEmpty())
         return false;
@@ -377,6 +377,9 @@
     frame.renderPasses.clear();
     frame.renderSurfaceLayerList.clear();
 
+    if (!rootLayer())
+        return false;
+
     if (!calculateRenderPasses(frame.renderPasses, frame.renderSurfaceLayerList))
         return false;
 

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h (113349 => 113350)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h	2012-04-05 19:05:55 UTC (rev 113349)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h	2012-04-05 19:07:29 UTC (rev 113350)
@@ -88,7 +88,7 @@
     virtual void beginCommit();
     virtual void commitComplete();
     virtual void animate(double monotonicTime, double wallClockTime);
-    // Returns false if we should try to avoid displaying the frame, because it has visible checkerboard during an animation.
+    // Returns false if problems occured preparing the frame, and we should try to avoid displaying the frame.
     virtual bool prepareToDraw(FrameData&);
     virtual void drawLayers(const FrameData&);
 
@@ -102,8 +102,6 @@
     virtual void setFullRootLayerDamage();
 
     // Implementation
-
-    // Returns false if there is no valid root layer and thus no content that can be drawn.
     bool canDraw();
     GraphicsContext3D* context();
 

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp (113349 => 113350)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp	2012-04-05 19:05:55 UTC (rev 113349)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp	2012-04-05 19:07:29 UTC (rev 113350)
@@ -578,7 +578,7 @@
     m_inputHandlerOnImplThread->animate(monotonicTime);
     m_layerTreeHostImpl->animate(monotonicTime, wallClockTime);
     CCLayerTreeHostImpl::FrameData frame;
-    bool drawFrame = m_layerTreeHostImpl->canDraw() && (m_layerTreeHostImpl->prepareToDraw(frame) || forcedDraw);
+    bool drawFrame = m_layerTreeHostImpl->prepareToDraw(frame) || forcedDraw;
     if (drawFrame) {
         m_layerTreeHostImpl->drawLayers(frame);
         result.didDraw = true;
@@ -586,9 +586,9 @@
 
     // Check for a pending compositeAndReadback.
     if (m_readbackRequestOnImplThread) {
-        if (drawFrame)
-            m_layerTreeHostImpl->readback(m_readbackRequestOnImplThread->pixels, m_readbackRequestOnImplThread->rect);
-        m_readbackRequestOnImplThread->success = !m_layerTreeHostImpl->isContextLost() && drawFrame;
+        ASSERT(drawFrame); // This should be a forcedDraw
+        m_layerTreeHostImpl->readback(m_readbackRequestOnImplThread->pixels, m_readbackRequestOnImplThread->rect);
+        m_readbackRequestOnImplThread->success = !m_layerTreeHostImpl->isContextLost();
         m_readbackRequestOnImplThread->completion.signal();
         m_readbackRequestOnImplThread = 0;
     }
@@ -598,6 +598,7 @@
 
     // Process any finish request
     if (m_finishAllRenderingCompletionEventOnImplThread) {
+        ASSERT(drawFrame); // This should be a forcedDraw
         m_layerTreeHostImpl->finishAllRendering();
         m_finishAllRenderingCompletionEventOnImplThread->signal();
         m_finishAllRenderingCompletionEventOnImplThread = 0;
@@ -609,6 +610,7 @@
         m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadProxy::didCommitAndDrawFrame));
     }
 
+    ASSERT(drawFrame || (!drawFrame && !forcedDraw));
     return result;
 }
 

Modified: trunk/Source/WebKit/chromium/ChangeLog (113349 => 113350)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-04-05 19:05:55 UTC (rev 113349)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-04-05 19:07:29 UTC (rev 113350)
@@ -1,5 +1,19 @@
 2012-04-05  Sheriff Bot  <webkit.review....@gmail.com>
 
+        Unreviewed, rolling out r113241.
+        http://trac.webkit.org/changeset/113241
+        https://bugs.webkit.org/show_bug.cgi?id=83293
+
+        Requested by siev...@chromium.org (Requested by zhenyao on
+        #webkit).
+
+        * tests/CCLayerTreeHostImplTest.cpp:
+        (WebKitTests::TEST_F):
+        * tests/CCLayerTreeHostTest.cpp:
+        (WTF::CCLayerTreeHostTest::doBeginTest):
+
+2012-04-05  Sheriff Bot  <webkit.review....@gmail.com>
+
         Unreviewed, rolling out r113341.
         http://trac.webkit.org/changeset/113341
         https://bugs.webkit.org/show_bug.cgi?id=83299

Modified: trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp (113349 => 113350)


--- trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp	2012-04-05 19:05:55 UTC (rev 113349)
+++ trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp	2012-04-05 19:07:29 UTC (rev 113350)
@@ -248,7 +248,6 @@
     m_hostImpl->initializeLayerRenderer(createContext());
 
     OwnPtr<CCLayerImpl> root = CCLayerImpl::create(0);
-    root->setBounds(IntSize(1, 1));
     root->setScrollable(true);
     root->setScrollPosition(IntPoint(0, 0));
     root->setMaxScrollPosition(IntSize(100, 100));

Modified: trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp (113349 => 113350)


--- trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp	2012-04-05 19:05:55 UTC (rev 113349)
+++ trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp	2012-04-05 19:07:29 UTC (rev 113350)
@@ -534,10 +534,6 @@
     m_client = MockLayerTreeHostClient::create(this);
 
     RefPtr<LayerChromium> rootLayer = LayerChromium::create();
-
-    // Only non-empty root layers will cause drawing to happen.
-    rootLayer->setBounds(IntSize(1, 1));
-
     m_layerTreeHost = MockLayerTreeHost::create(this, m_client.get(), rootLayer, m_settings);
     ASSERT_TRUE(m_layerTreeHost);
     rootLayer->setLayerTreeHost(m_layerTreeHost.get());
@@ -827,56 +823,6 @@
     runTestThreaded();
 }
 
-// If the root layer has no content bounds, we should see a commit, but should not be
-// pushing any frames as the contents will be undefined. Regardless, forced draws need
-// to always signal completion.
-class CCLayerTreeHostTestEmptyContentsShouldNotDraw : public CCLayerTreeHostTestThreadOnly {
-public:
-    CCLayerTreeHostTestEmptyContentsShouldNotDraw()
-        : m_numCommits(0)
-    {
-    }
-
-    virtual void beginTest()
-    {
-    }
-
-    virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl)
-    {
-        // Only the initial draw should bring us here.
-        EXPECT_FALSE(impl->rootLayer()->bounds().isEmpty());
-    }
-
-    virtual void didCommitAndDrawFrame()
-    {
-        m_numCommits++;
-        if (m_numCommits == 1) {
-            // Put an empty root layer.
-            RefPtr<LayerChromium> rootLayer = LayerChromium::create();
-            m_layerTreeHost->setRootLayer(rootLayer);
-
-            OwnArrayPtr<char> pixels(adoptArrayPtr(new char[4]));
-            m_layerTreeHost->compositeAndReadback(static_cast<void*>(pixels.get()), IntRect(0, 0, 1, 1));
-        } else if (m_numCommits == 2) {
-            m_layerTreeHost->setNeedsCommit();
-            m_layerTreeHost->finishAllRendering();
-            endTest();
-        }
-    }
-
-    virtual void afterTest()
-    {
-    }
-
-private:
-    int m_numCommits;
-};
-
-TEST_F(CCLayerTreeHostTestEmptyContentsShouldNotDraw, runMultiThread)
-{
-    runTestThreaded();
-}
-
 // A compositeAndReadback while invisible should force a normal commit without assertion.
 class CCLayerTreeHostTestCompositeAndReadbackWhileInvisible : public CCLayerTreeHostTestThreadOnly {
 public:
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to