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

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: 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 0dff769b565b5453e44e336d719f376dd362bb91..34f06bdb134833765fffafddf57b3faf841eaa33 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>(
enne (OOO) 2013/01/25 20:59:10 I think this might be unneeded. You should only n
danakj 2013/01/25 21:18:15 The idea is that if you update draw props on scrol
+ 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().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