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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 15855008: cc: Call ManageTiles explicitly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 6 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/trees/layer_tree_host_impl.h ('k') | cc/trees/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/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 d384ea716996f05d7171f3ddb04a0a1f284d1c6a..ccd69d2ea14e53fa16ac3616a0632d1d3ec1c030 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -163,6 +163,7 @@ LayerTreeHostImpl::LayerTreeHostImpl(
did_lock_scrolling_layer_(false),
should_bubble_scrolls_(false),
wheel_scrolling_(false),
+ manage_tiles_needed_(false),
root_layer_scroll_offset_delegate_(NULL),
settings_(settings),
visible_(true),
@@ -238,6 +239,8 @@ void LayerTreeHostImpl::CommitComplete() {
if (settings_.impl_side_painting) {
pending_tree_->set_needs_update_draw_properties();
pending_tree_->UpdateDrawProperties();
+ // Start working on newly created tiles immediately if needed.
+ ManageTiles();
} else {
active_tree_->set_needs_update_draw_properties();
}
@@ -292,7 +295,11 @@ void LayerTreeHostImpl::Animate(base::TimeTicks monotonic_time,
}
void LayerTreeHostImpl::ManageTiles() {
- DCHECK(tile_manager_);
+ if (!tile_manager_)
+ return;
+ if (!manage_tiles_needed_)
+ return;
+ manage_tiles_needed_ = false;
tile_manager_->ManageTiles();
size_t memory_required_bytes;
@@ -970,17 +977,13 @@ void LayerTreeHostImpl::UpdateTileManagerMemoryPolicy(
policy.priority_cutoff_when_visible :
policy.priority_cutoff_when_not_visible);
tile_manager_->SetGlobalState(new_state);
+ manage_tiles_needed_ = true;
}
bool LayerTreeHostImpl::HasImplThread() const {
return proxy_->HasImplThread();
}
-void LayerTreeHostImpl::ScheduleManageTiles() {
- if (client_)
- client_->SetNeedsManageTilesOnImplThread();
-}
-
void LayerTreeHostImpl::DidInitializeVisibleTile() {
// TODO(reveman): Determine tiles that changed and only damage
// what's necessary.
@@ -1338,6 +1341,9 @@ bool LayerTreeHostImpl::ActivatePendingTreeIfNeeded() {
// TODO(enne): This needs to be moved somewhere else (post-animate?)
pending_tree_->UpdateDrawProperties();
+ // Note: This will likely cause ManageTiles to be needed. However,
+ // it is only out of date as far as the last commit or the last draw.
+ // For performance reasons, don't call ManageTiles again here.
TRACE_EVENT_ASYNC_STEP1(
"cc",
@@ -2231,6 +2237,7 @@ void LayerTreeHostImpl::SetTreePriority(TreePriority priority) {
new_state.tree_priority = priority;
tile_manager_->SetGlobalState(new_state);
+ manage_tiles_needed_ = true;
}
void LayerTreeHostImpl::ResetCurrentFrameTimeForNextFrame() {
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698