Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Unified Diff: cc/layer_tree_host_impl.cc

Issue 11886091: cc: Fix resource eviction with impl-side painting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix enforceManagedMemoryPolicy. It's possible we have pending tree when this is called. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layer_tree_host_impl.h ('k') | cc/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host_impl.cc
diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc
index 4f2827d38b4fb456e226da3e1a0ac59ca8ca77d5..1fb1b692de7afdc942e9845d89ce3a65014321a7 100644
--- a/cc/layer_tree_host_impl.cc
+++ b/cc/layer_tree_host_impl.cc
@@ -136,7 +136,6 @@ LayerTreeHostImpl::LayerTreeHostImpl(const LayerTreeSettings& settings, LayerTre
, m_debugState(settings.initialDebugState)
, m_deviceScaleFactor(1)
, m_visible(true)
- , m_contentsTexturesPurged(false)
, m_managedMemoryPolicy(PrioritizedResourceManager::defaultMemoryAllocationLimit(),
ManagedMemoryPolicy::CUTOFF_ALLOW_EVERYTHING,
0,
@@ -219,7 +218,7 @@ bool LayerTreeHostImpl::canDraw()
TRACE_EVENT_INSTANT0("cc", "LayerTreeHostImpl::canDraw no renderer");
return false;
}
- if (m_contentsTexturesPurged) {
+ if (m_activeTree->ContentsTexturesPurged()) {
TRACE_EVENT_INSTANT0("cc", "LayerTreeHostImpl::canDraw contents textures purged");
return false;
}
@@ -698,7 +697,9 @@ void LayerTreeHostImpl::enforceManagedMemoryPolicy(const ManagedMemoryPolicy& po
ManagedMemoryPolicy::priorityCutoffToValue(
m_visible ? policy.priorityCutoffWhenVisible : policy.priorityCutoffWhenNotVisible));
if (evictedResources) {
- setContentsTexturesPurged();
+ activeTree()->SetContentsTexturesPurged();
+ if (pendingTree())
+ pendingTree()->SetContentsTexturesPurged();
m_client->setNeedsCommitOnImplThread();
m_client->onCanDrawStateChanged(canDraw());
}
@@ -1028,18 +1029,6 @@ bool LayerTreeHostImpl::initializeRenderer(scoped_ptr<OutputSurface> outputSurfa
return true;
}
-void LayerTreeHostImpl::setContentsTexturesPurged()
-{
- m_contentsTexturesPurged = true;
- m_client->onCanDrawStateChanged(canDraw());
-}
-
-void LayerTreeHostImpl::resetContentsTexturesPurged()
-{
- m_contentsTexturesPurged = false;
- m_client->onCanDrawStateChanged(canDraw());
-}
-
void LayerTreeHostImpl::setViewportSize(const gfx::Size& layoutViewportSize, const gfx::Size& deviceViewportSize)
{
if (layoutViewportSize == m_layoutViewportSize && deviceViewportSize == m_deviceViewportSize)
« no previous file with comments | « cc/layer_tree_host_impl.h ('k') | cc/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698