Title: [122737] trunk/Source
Revision
122737
Author
[email protected]
Date
2012-07-16 11:01:34 -0700 (Mon, 16 Jul 2012)

Log Message

[chromium] Incorrect assertion: Replicas will cause a RenderPass to be removed twice
https://bugs.webkit.org/show_bug.cgi?id=91328

Reviewed by Adrienne Walker.

Source/WebCore:

We asserted that we would never attempt to remove a render pass that had
already been removed. This was incorrect as a surface with a replica has
two quads and both may cause us to attempt its removal. We must handle
this case gracefully.

Test: CCLayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit

* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::CullRenderPassesWithNoQuads::shouldRemoveRenderPass):

Source/WebKit/chromium:

Add replicas to the surfaces in the test.

* tests/CCLayerTreeHostTest.cpp:
(WTF::CCLayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit::CCLayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit):
(WTF::CCLayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit::beginTest):
(WTF::CCLayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit::afterTest):
(CCLayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (122736 => 122737)


--- trunk/Source/WebCore/ChangeLog	2012-07-16 17:51:06 UTC (rev 122736)
+++ trunk/Source/WebCore/ChangeLog	2012-07-16 18:01:34 UTC (rev 122737)
@@ -1,3 +1,20 @@
+2012-07-16  Dana Jansens  <[email protected]>
+
+        [chromium] Incorrect assertion: Replicas will cause a RenderPass to be removed twice
+        https://bugs.webkit.org/show_bug.cgi?id=91328
+
+        Reviewed by Adrienne Walker.
+
+        We asserted that we would never attempt to remove a render pass that had
+        already been removed. This was incorrect as a surface with a replica has
+        two quads and both may cause us to attempt its removal. We must handle
+        this case gracefully.
+
+        Test: CCLayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit
+
+        * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+        (WebCore::CCLayerTreeHostImpl::CullRenderPassesWithNoQuads::shouldRemoveRenderPass):
+
 2012-07-16  Ilya Tikhonovsky  <[email protected]>
 
         Web Inspector: native memory: fix instrumentation for string members

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


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp	2012-07-16 17:51:06 UTC (rev 122736)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp	2012-07-16 18:01:34 UTC (rev 122737)
@@ -447,8 +447,11 @@
 {
     const CCRenderPass* renderPass = findRenderPassById(quad.renderPassId(), frame);
     size_t passIndex = frame.renderPasses.find(renderPass);
-    ASSERT(passIndex != notFound);
 
+    bool renderPassAlreadyRemoved = passIndex == notFound;
+    if (renderPassAlreadyRemoved)
+        return false;
+
     // If any quad or RenderPass draws into this RenderPass, then keep it.
     const CCQuadList& quadList = frame.renderPasses[passIndex]->quadList();
     for (CCQuadList::constBackToFrontIterator quadListIterator = quadList.backToFrontBegin(); quadListIterator != quadList.backToFrontEnd(); ++quadListIterator) {

Modified: trunk/Source/WebKit/chromium/ChangeLog (122736 => 122737)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-07-16 17:51:06 UTC (rev 122736)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-07-16 18:01:34 UTC (rev 122737)
@@ -1,3 +1,18 @@
+2012-07-16  Dana Jansens  <[email protected]>
+
+        [chromium] Incorrect assertion: Replicas will cause a RenderPass to be removed twice
+        https://bugs.webkit.org/show_bug.cgi?id=91328
+
+        Reviewed by Adrienne Walker.
+
+        Add replicas to the surfaces in the test.
+
+        * tests/CCLayerTreeHostTest.cpp:
+        (WTF::CCLayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit::CCLayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit):
+        (WTF::CCLayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit::beginTest):
+        (WTF::CCLayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit::afterTest):
+        (CCLayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit):
+
 2012-07-13  Eric Penner  <[email protected]>
 
         [chromium] Add 'self-managed' option to CCPrioritizedTexture to enable render-surface and canvas use cases.

Modified: trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp (122736 => 122737)


--- trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp	2012-07-16 17:51:06 UTC (rev 122736)
+++ trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp	2012-07-16 18:01:34 UTC (rev 122737)
@@ -2267,7 +2267,9 @@
     CCLayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit()
         : m_rootLayer(ContentLayerChromiumWithUpdateTracking::create(&m_mockDelegate))
         , m_surfaceLayer1(ContentLayerChromiumWithUpdateTracking::create(&m_mockDelegate))
+        , m_replicaLayer1(ContentLayerChromiumWithUpdateTracking::create(&m_mockDelegate))
         , m_surfaceLayer2(ContentLayerChromiumWithUpdateTracking::create(&m_mockDelegate))
+        , m_replicaLayer2(ContentLayerChromiumWithUpdateTracking::create(&m_mockDelegate))
     {
     }
 
@@ -2283,6 +2285,9 @@
         m_surfaceLayer2->setForceRenderSurface(true);
         m_surfaceLayer2->setOpacity(0.5);
 
+        m_surfaceLayer1->setReplicaLayer(m_replicaLayer1.get());
+        m_surfaceLayer2->setReplicaLayer(m_replicaLayer2.get());
+
         m_rootLayer->addChild(m_surfaceLayer1);
         m_surfaceLayer1->addChild(m_surfaceLayer2);
         m_layerTreeHost->setRootLayer(m_rootLayer);
@@ -2321,14 +2326,18 @@
         // Clear layer references so CCLayerTreeHost dies.
         m_rootLayer.clear();
         m_surfaceLayer1.clear();
+        m_replicaLayer1.clear();
         m_surfaceLayer2.clear();
+        m_replicaLayer2.clear();
     }
 
 private:
     MockContentLayerDelegate m_mockDelegate;
     RefPtr<ContentLayerChromiumWithUpdateTracking> m_rootLayer;
     RefPtr<ContentLayerChromiumWithUpdateTracking> m_surfaceLayer1;
+    RefPtr<ContentLayerChromiumWithUpdateTracking> m_replicaLayer1;
     RefPtr<ContentLayerChromiumWithUpdateTracking> m_surfaceLayer2;
+    RefPtr<ContentLayerChromiumWithUpdateTracking> m_replicaLayer2;
 };
 
 SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to