Index: cc/trees/layer_tree_host_impl.cc |
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc |
index 3109c00652ad58d4dd681d6e328dbfdf03b98a64..412e73618200d43bb8000c6cded2216bb18dcc49 100644 |
--- a/cc/trees/layer_tree_host_impl.cc |
+++ b/cc/trees/layer_tree_host_impl.cc |
@@ -289,10 +289,8 @@ void LayerTreeHostImpl::BeginMainFrameAborted(CommitEarlyOutReason reason) { |
// If the begin frame data was handled, then scroll and scale set was applied |
// by the main thread, so the active tree needs to be updated as if these sent |
// values were applied and committed. |
- if (CommitEarlyOutHandledCommit(reason)) { |
+ if (CommitEarlyOutHandledCommit(reason)) |
active_tree_->ApplySentScrollAndScaleDeltasFromAbortedCommit(); |
- active_tree_->ResetContentsTexturesPurged(); |
- } |
} |
void LayerTreeHostImpl::BeginCommit() { |
@@ -386,12 +384,6 @@ bool LayerTreeHostImpl::CanDraw() const { |
TRACE_EVENT_SCOPE_THREAD); |
return false; |
} |
- if (active_tree_->ContentsTexturesPurged()) { |
- TRACE_EVENT_INSTANT0( |
- "cc", "LayerTreeHostImpl::CanDraw contents textures purged", |
- TRACE_EVENT_SCOPE_THREAD); |
- return false; |
- } |
if (EvictedUIResourcesExist()) { |
TRACE_EVENT_INSTANT0( |
"cc", "LayerTreeHostImpl::CanDraw UI resources evicted not recreated", |
@@ -1149,7 +1141,7 @@ void LayerTreeHostImpl::RemoveRenderPasses(FrameData* frame) { |
} |
void LayerTreeHostImpl::EvictTexturesForTesting() { |
- EnforceManagedMemoryPolicy(ManagedMemoryPolicy(0)); |
+ UpdateTileManagerMemoryPolicy(ManagedMemoryPolicy(0)); |
} |
void LayerTreeHostImpl::BlockNotifyReadyToActivateForTesting(bool block) { |
@@ -1175,26 +1167,6 @@ size_t LayerTreeHostImpl::SourceAnimationFrameNumberForTesting() const { |
return fps_counter_->current_frame_number(); |
} |
-void LayerTreeHostImpl::EnforceManagedMemoryPolicy( |
- const ManagedMemoryPolicy& policy) { |
- |
- bool evicted_resources = client_->ReduceContentsTextureMemoryOnImplThread( |
- visible_ ? policy.bytes_limit_when_visible : 0, |
- ManagedMemoryPolicy::PriorityCutoffToValue( |
- visible_ ? policy.priority_cutoff_when_visible |
- : gpu::MemoryAllocation::CUTOFF_ALLOW_NOTHING)); |
- if (evicted_resources) { |
- active_tree_->SetContentsTexturesPurged(); |
- if (pending_tree_) |
- pending_tree_->SetContentsTexturesPurged(); |
- client_->SetNeedsCommitOnImplThread(); |
- client_->OnCanDrawStateChanged(CanDraw()); |
- client_->RenewTreePriority(); |
- } |
- |
- UpdateTileManagerMemoryPolicy(policy); |
-} |
- |
void LayerTreeHostImpl::UpdateTileManagerMemoryPolicy( |
const ManagedMemoryPolicy& policy) { |
if (!tile_manager_) |
@@ -1367,10 +1339,10 @@ void LayerTreeHostImpl::SetManagedMemoryPolicy( |
// In single-thread mode, this can be called on the main thread by |
// GLRenderer::OnMemoryAllocationChanged. |
DebugScopedSetImplThread impl_thread(proxy_); |
- EnforceManagedMemoryPolicy(actual_policy); |
+ UpdateTileManagerMemoryPolicy(actual_policy); |
} else { |
DCHECK(proxy_->IsImplThread()); |
- EnforceManagedMemoryPolicy(actual_policy); |
+ UpdateTileManagerMemoryPolicy(actual_policy); |
} |
// If there is already enough memory to draw everything imaginable and the |
@@ -1974,7 +1946,7 @@ void LayerTreeHostImpl::SetVisible(bool visible) { |
return; |
visible_ = visible; |
DidVisibilityChange(this, visible_); |
- EnforceManagedMemoryPolicy(ActualManagedMemoryPolicy()); |
+ UpdateTileManagerMemoryPolicy(ActualManagedMemoryPolicy()); |
// If we just became visible, we have to ensure that we draw high res tiles, |
// to prevent checkerboard/low res flashes. |