From 6f90b9e6f0ad978c11510fa362791aa896fdde7d Mon Sep 17 00:00:00 2001 From: "reveman@chromium.org" Date: Thu, 17 Jan 2013 23:42:00 +0000 Subject: cc: Fix resource eviction with impl-side painting. When evicting resources with impl-side painting we need wait until the active tree is without evicted resources before we can draw. This moves the ContentsTexturesPurged state from LTHI to the LTI and makes LTHI::canDraw() return false when the active LTI has ContentsTexturesPurged set. The result is no change in behavior when we only have one tree, while with impl-side painting when we have two trees, canDraw() will not return true until the new tree without ContentsTexturesPurged set has been activated. BUG=170157 Review URL: https://chromiumcodereview.appspot.com/11886091 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177532 0039d316-1c4b-4281-b951-d872f2087c98 --- cc/single_thread_proxy.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'cc/single_thread_proxy.cc') diff --git a/cc/single_thread_proxy.cc b/cc/single_thread_proxy.cc index 1dc1e6b..f4b7f29 100644 --- a/cc/single_thread_proxy.cc +++ b/cc/single_thread_proxy.cc @@ -7,6 +7,7 @@ #include "base/debug/trace_event.h" #include "cc/draw_quad.h" #include "cc/layer_tree_host.h" +#include "cc/layer_tree_impl.h" #include "cc/output_surface.h" #include "cc/prioritized_resource_manager.h" #include "cc/resource_update_controller.h" @@ -257,7 +258,7 @@ void SingleThreadProxy::stop() DebugScopedSetMainThreadBlocked mainThreadBlocked(this); DebugScopedSetImplThread impl(this); - if (!m_layerTreeHostImpl->contentsTexturesPurged()) + if (!m_layerTreeHostImpl->activeTree()->ContentsTexturesPurged()) m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->resourceProvider()); m_layerTreeHostImpl.reset(); } @@ -344,9 +345,6 @@ bool SingleThreadProxy::commitAndComposite() scoped_ptr queue = make_scoped_ptr(new ResourceUpdateQueue); m_layerTreeHost->updateLayers(*(queue.get()), m_layerTreeHostImpl->memoryAllocationLimitBytes()); - if (m_layerTreeHostImpl->contentsTexturesPurged()) - m_layerTreeHostImpl->resetContentsTexturesPurged(); - m_layerTreeHost->willCommit(); doCommit(queue.Pass()); bool result = doComposite(); -- cgit v1.1