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

Unified Diff: cc/layer_tree_impl.cc

Issue 12045086: cc: Throttle tile priority updates to once a frame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebasedonmaster 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_impl.h ('k') | cc/occlusion_tracker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_impl.cc
diff --git a/cc/layer_tree_impl.cc b/cc/layer_tree_impl.cc
index e57bc51ff198007a835a58eb6b6d436a11a840f9..f7e59b44a563ed2dbadbe4d387bf8e2ea5aad33e 100644
--- a/cc/layer_tree_impl.cc
+++ b/cc/layer_tree_impl.cc
@@ -121,9 +121,19 @@ void LayerTreeImpl::UpdateMaxScrollOffset() {
root_scroll_layer_->setMaxScrollOffset(gfx::ToFlooredVector2d(max_scroll));
}
-void LayerTreeImpl::UpdateDrawProperties() {
- if (!needs_update_draw_properties_)
+struct UpdateTilePrioritiesForLayer {
+ void operator()(LayerImpl *layer) {
+ layer->updateTilePriorities();
+ }
+};
+
+void LayerTreeImpl::UpdateDrawProperties(UpdateDrawPropertiesReason reason) {
+ if (!needs_update_draw_properties_) {
+ if (reason == UPDATE_ACTIVE_TREE_FOR_DRAW && RootLayer())
+ LayerTreeHostCommon::callFunctionForSubtree<UpdateTilePrioritiesForLayer>(
+ RootLayer());
return;
+ }
needs_update_draw_properties_ = false;
render_surface_layer_list_.clear();
@@ -144,6 +154,9 @@ void LayerTreeImpl::UpdateDrawProperties() {
{
TRACE_EVENT1("cc", "LayerTreeImpl::UpdateDrawProperties", "IsActive", IsActiveTree());
+ bool update_tile_priorities =
+ reason == UPDATE_PENDING_TREE ||
+ reason == UPDATE_ACTIVE_TREE_FOR_DRAW;
LayerTreeHostCommon::calculateDrawProperties(
RootLayer(),
device_viewport_size(),
@@ -151,7 +164,8 @@ void LayerTreeImpl::UpdateDrawProperties() {
pinch_zoom_viewport().total_page_scale_factor(),
MaxTextureSize(),
settings().canUseLCDText,
- render_surface_layer_list_);
+ render_surface_layer_list_,
+ update_tile_priorities);
}
DCHECK(!needs_update_draw_properties_) <<
« no previous file with comments | « cc/layer_tree_impl.h ('k') | cc/occlusion_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698