Title: [127880] trunk/Source/WebCore
Revision
127880
Author
commit-qu...@webkit.org
Date
2012-09-07 09:58:23 -0700 (Fri, 07 Sep 2012)

Log Message

Unreviewed, rolling out r127820.
http://trac.webkit.org/changeset/127820
https://bugs.webkit.org/show_bug.cgi?id=96117

Introduces crashes in Chromium compositing tests (Requested by
fsamuel on #webkit).

Patch by Sheriff Bot <webkit.review....@gmail.com> on 2012-09-07

* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::evictAllContentTextures):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(CCLayerTreeHost):
* platform/graphics/chromium/cc/CCPrioritizedTextureManager.cpp:
(WebCore::CCPrioritizedTextureManager::clearAllMemory):
(WebCore::CCPrioritizedTextureManager::allBackingTexturesWereDeleted):
* platform/graphics/chromium/cc/CCPrioritizedTextureManager.h:
(CCPrioritizedTextureManager):
* platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
(WebCore::CCSingleThreadProxy::commitAndComposite):
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore::CCThreadProxy::beginFrame):
(WebCore::CCThreadProxy::beginFrameCompleteOnImplThread):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (127879 => 127880)


--- trunk/Source/WebCore/ChangeLog	2012-09-07 16:55:45 UTC (rev 127879)
+++ trunk/Source/WebCore/ChangeLog	2012-09-07 16:58:23 UTC (rev 127880)
@@ -1,3 +1,27 @@
+2012-09-07  Sheriff Bot  <webkit.review....@gmail.com>
+
+        Unreviewed, rolling out r127820.
+        http://trac.webkit.org/changeset/127820
+        https://bugs.webkit.org/show_bug.cgi?id=96117
+
+        Introduces crashes in Chromium compositing tests (Requested by
+        fsamuel on #webkit).
+
+        * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+        (WebCore::CCLayerTreeHost::evictAllContentTextures):
+        * platform/graphics/chromium/cc/CCLayerTreeHost.h:
+        (CCLayerTreeHost):
+        * platform/graphics/chromium/cc/CCPrioritizedTextureManager.cpp:
+        (WebCore::CCPrioritizedTextureManager::clearAllMemory):
+        (WebCore::CCPrioritizedTextureManager::allBackingTexturesWereDeleted):
+        * platform/graphics/chromium/cc/CCPrioritizedTextureManager.h:
+        (CCPrioritizedTextureManager):
+        * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
+        (WebCore::CCSingleThreadProxy::commitAndComposite):
+        * platform/graphics/chromium/cc/CCThreadProxy.cpp:
+        (WebCore::CCThreadProxy::beginFrame):
+        (WebCore::CCThreadProxy::beginFrameCompleteOnImplThread):
+
 2012-09-07  Simon Hausmann  <simon.hausm...@nokia.com>
 
         [Qt] Add another all-in-one source

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp (127879 => 127880)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp	2012-09-07 16:55:45 UTC (rev 127879)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp	2012-09-07 16:58:23 UTC (rev 127880)
@@ -414,20 +414,13 @@
     m_proxy->setVisible(visible);
 }
 
-void CCLayerTreeHost::unlinkAllContentTextures()
+void CCLayerTreeHost::evictAllContentTextures()
 {
     ASSERT(CCProxy::isMainThread());
     ASSERT(m_contentsTextureManager.get());
-    m_contentsTextureManager->unlinkAllBackings();
+    m_contentsTextureManager->allBackingTexturesWereDeleted();
 }
 
-void CCLayerTreeHost::deleteUnlinkedTextures()
-{
-    ASSERT(CCProxy::isImplThread() && CCProxy::isMainThreadBlocked());
-    ASSERT(m_contentsTextureManager.get());
-    m_contentsTextureManager->deleteAllUnlinkedBackings();
-}
-
 void CCLayerTreeHost::startPageScaleAnimation(const IntSize& targetPosition, bool useAnchor, float scale, double durationSec)
 {
     m_proxy->startPageScaleAnimation(targetPosition, useAnchor, scale, durationSec);

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h (127879 => 127880)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h	2012-09-07 16:55:45 UTC (rev 127879)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h	2012-09-07 16:58:23 UTC (rev 127880)
@@ -212,8 +212,11 @@
 
     CCPrioritizedTextureManager* contentsTextureManager() const;
 
-    void unlinkAllContentTextures();
-    void deleteUnlinkedTextures();
+    // This will cause contents texture manager to evict all textures, but
+    // without deleting them. This happens after all content textures have
+    // already been deleted on impl, after getting a 0 allocation limit.
+    // Set during a commit, but before updateLayers.
+    void evictAllContentTextures();
 
     bool visible() const { return m_visible; }
     void setVisible(bool);

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCPrioritizedTextureManager.cpp (127879 => 127880)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCPrioritizedTextureManager.cpp	2012-09-07 16:55:45 UTC (rev 127879)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCPrioritizedTextureManager.cpp	2012-09-07 16:58:23 UTC (rev 127880)
@@ -248,8 +248,6 @@
 
 void CCPrioritizedTextureManager::clearAllMemory(CCResourceProvider* resourceProvider)
 {
-    ASSERT(CCProxy::isImplThread() && CCProxy::isMainThreadBlocked());
-    ASSERT(resourceProvider);
     // Unlink and destroy all backing textures.
     while (m_backings.size() > 0) {
         BackingSet::iterator it = m_backings.begin();
@@ -259,26 +257,14 @@
     }
 }
 
-void CCPrioritizedTextureManager::unlinkAllBackings()
+void CCPrioritizedTextureManager::allBackingTexturesWereDeleted()
 {
-    ASSERT(CCProxy::isMainThread());
-    for (BackingSet::iterator it = m_backings.begin(); it != m_backings.end(); ++it)
-        if ((*it)->owner())
-            (*it)->owner()->unlink();
+    // Same as clearAllMemory, except all our textures were already
+    // deleted externally, so we don't delete them. Passing no
+    // resourceProvider results in leaking the (now invalid) texture ids.
+    clearAllMemory(0);
 }
 
-void CCPrioritizedTextureManager::deleteAllUnlinkedBackings()
-{
-    ASSERT(CCProxy::isImplThread() && CCProxy::isMainThreadBlocked());
-    BackingVector backingsToDelete;
-    for (BackingSet::iterator it = m_backings.begin(); it != m_backings.end(); ++it)
-        if (!(*it)->owner())
-            backingsToDelete.append((*it));
-
-    for (BackingVector::iterator it = backingsToDelete.begin(); it != backingsToDelete.end(); ++it)
-        destroyBacking((*it), 0);
-}
-
 void CCPrioritizedTextureManager::registerTexture(CCPrioritizedTexture* texture)
 {
     ASSERT(CCProxy::isMainThread());

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCPrioritizedTextureManager.h (127879 => 127880)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCPrioritizedTextureManager.h	2012-09-07 16:55:45 UTC (rev 127879)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCPrioritizedTextureManager.h	2012-09-07 16:58:23 UTC (rev 127880)
@@ -78,8 +78,7 @@
 
     void reduceMemory(CCResourceProvider*);
     void clearAllMemory(CCResourceProvider*);
-    void unlinkAllBackings();
-    void deleteAllUnlinkedBackings();
+    void allBackingTexturesWereDeleted();
 
     void acquireBackingTextureIfNeeded(CCPrioritizedTexture*, CCResourceProvider*);
 

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp (127879 => 127880)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp	2012-09-07 16:55:45 UTC (rev 127879)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp	2012-09-07 16:58:23 UTC (rev 127880)
@@ -297,14 +297,12 @@
 {
     ASSERT(CCProxy::isMainThread());
 
+
     if (!m_layerTreeHost->initializeRendererIfNeeded())
         return false;
 
-    if (m_layerTreeHostImpl->contentsTexturesPurged()) {
-        m_layerTreeHost->unlinkAllContentTextures();
-        DebugScopedSetImplThreadAndMainThreadBlocked implAndMainBlocked;
-        m_layerTreeHost->deleteUnlinkedTextures();
-    }
+    if (m_layerTreeHostImpl->contentsTexturesPurged())
+        m_layerTreeHost->evictAllContentTextures();
 
     CCTextureUpdateQueue queue;
     m_layerTreeHost->updateLayers(queue, m_layerTreeHostImpl->memoryAllocationLimitBytes());

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


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp	2012-09-07 16:55:45 UTC (rev 127879)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp	2012-09-07 16:58:23 UTC (rev 127880)
@@ -555,7 +555,7 @@
     }
 
     if (request->contentsTexturesWereDeleted)
-        m_layerTreeHost->unlinkAllContentTextures();
+        m_layerTreeHost->evictAllContentTextures();
 
     OwnPtr<CCTextureUpdateQueue> queue = adoptPtr(new CCTextureUpdateQueue);
     m_layerTreeHost->updateLayers(*(queue.get()), request->memoryAllocationLimitBytes);
@@ -597,7 +597,7 @@
 {
     TRACE_EVENT0("cc", "CCThreadProxy::beginFrameCompleteOnImplThread");
     ASSERT(!m_commitCompletionEventOnImplThread);
-    ASSERT(isImplThread() && isMainThreadBlocked());
+    ASSERT(isImplThread());
     ASSERT(m_schedulerOnImplThread);
     ASSERT(m_schedulerOnImplThread->commitPending());
 
@@ -607,20 +607,15 @@
         return;
     }
 
-    if (contentsTexturesWereDeleted) {
-        ASSERT(m_layerTreeHostImpl->contentsTexturesPurged());
-        // We unlinked all textures on the main thread, delete them now.
-        m_layerTreeHost->deleteUnlinkedTextures();
-        // Mark that we can start drawing again when this commit is complete.
-        m_resetContentsTexturesPurgedAfterCommitOnImplThread = true;
-    } else if (m_layerTreeHostImpl->contentsTexturesPurged()) {
+    if (!contentsTexturesWereDeleted && m_layerTreeHostImpl->contentsTexturesPurged()) {
         // We purged the content textures on the impl thread between the time we
         // posted the beginFrame task and now, meaning we have a bunch of
         // uploads that are now invalid. Clear the uploads (they all go to
         // content textures), and kick another commit to fill them again.
         queue->clearUploads();
         setNeedsCommitOnImplThread();
-    }
+    } else
+        m_resetContentsTexturesPurgedAfterCommitOnImplThread = true;
 
     m_currentTextureUpdateControllerOnImplThread = CCTextureUpdateController::create(CCProxy::implThread(), queue, m_layerTreeHostImpl->resourceProvider(), m_layerTreeHostImpl->renderer()->textureCopier(), m_layerTreeHostImpl->renderer()->textureUploader());
     m_commitCompletionEventOnImplThread = completion;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to