[chromium] Avoid deleting impl tree when becoming invisible
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 7 Apr 2012 02:13:14 +0000 (02:13 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 7 Apr 2012 02:13:14 +0000 (02:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=83396

Patch by James Robinson <jamesr@chromium.org> on 2012-04-06
Reviewed by Adrienne Walker.

This bit of code in CCLayerTreeHost::didBecomeInvisible..() was an attempt to drop resources when becoming
invisible. However, it's fairly confused - we drop textures via TextureManagers when going invisible and
CCLayerImpl destructors can't delete non-managed resources since they do not have access to a context - so this
code was never actually freeing up GPU resources. Having a sometimes-null CCLayerImpl tree when we still have a
valid LayerChromium tree has lead to various tricky bugs.

No new tests since this code wasn't doing anything useful in the first place.

* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::didBecomeInvisibleOnImplThread):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113538 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp

index e598412..df904d9 100644 (file)
@@ -1,3 +1,21 @@
+2012-04-06  James Robinson  <jamesr@chromium.org>
+
+        [chromium] Avoid deleting impl tree when becoming invisible
+        https://bugs.webkit.org/show_bug.cgi?id=83396
+
+        Reviewed by Adrienne Walker.
+
+        This bit of code in CCLayerTreeHost::didBecomeInvisible..() was an attempt to drop resources when becoming
+        invisible. However, it's fairly confused - we drop textures via TextureManagers when going invisible and
+        CCLayerImpl destructors can't delete non-managed resources since they do not have access to a context - so this
+        code was never actually freeing up GPU resources. Having a sometimes-null CCLayerImpl tree when we still have a
+        valid LayerChromium tree has lead to various tricky bugs.
+
+        No new tests since this code wasn't doing anything useful in the first place.
+
+        * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+        (WebCore::CCLayerTreeHost::didBecomeInvisibleOnImplThread):
+
 2012-04-06  Leo Yang  <leo.yang@torchmobile.com.cn>
 
         LocalFileSystem::initializeLocalFileSystem should be static
index d3fc970..8dc9b4f 100644 (file)
@@ -386,14 +386,6 @@ void CCLayerTreeHost::didBecomeInvisibleOnImplThread(CCLayerTreeHostImpl* hostIm
         contentsTextureManager()->deleteEvictedTextures(hostImpl->contentsTextureAllocator());
     }
 
-    // Ensure that the dropped tiles are propagated to the impl tree.
-    // If the frontbuffer is cached, then clobber the impl tree. Otherwise,
-    // push over the tree changes.
-    if (m_proxy->layerRendererCapabilities().contextHasCachedFrontBuffer) {
-        hostImpl->setRootLayer(nullptr);
-        return;
-    }
-
     hostImpl->setRootLayer(TreeSynchronizer::synchronizeTrees(rootLayer(), hostImpl->releaseRootLayer()));
 
     // We may have added an animation during the tree sync. This will cause both layer tree hosts