summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-19 16:54:28 +0000
committerenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-19 16:54:28 +0000
commite4be026ef9443644df8aa95195d8d1ea6012f2a1 (patch)
tree7286387b1a7a34fad2ba741dbd1791294382ba7d /cc
parent31b6c106a0ae4b8509fd1b6730cc53f20387b6ae (diff)
downloadchromium_src-e4be026ef9443644df8aa95195d8d1ea6012f2a1.zip
chromium_src-e4be026ef9443644df8aa95195d8d1ea6012f2a1.tar.gz
chromium_src-e4be026ef9443644df8aa95195d8d1ea6012f2a1.tar.bz2
cc: Make UpdateTilePriorities a separate step
This will make it more obvious in traces where work is really being done and make it possible to optimize this further. Comparing average times spent in the renderer compositor while scrolling Wikipedia's List of Pokemon page on an N4 in two different runs: Before change: UpdateDrawProperties: 0.754ms After change: UpdateDrawProperties: 0.249ms UpdateTilePriorities: 0.553ms R=danakj@chromium.org BUG=308244 Review URL: https://codereview.chromium.org/26880009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229590 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r--cc/trees/layer_tree_host_common.cc17
-rw-r--r--cc/trees/layer_tree_impl.cc31
2 files changed, 31 insertions, 17 deletions
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc
index c9d453f..8bab4ab 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -525,22 +525,6 @@ static inline bool SubtreeShouldBeSkipped(Layer* layer,
!layer->OpacityCanAnimateOnImplThread();
}
-// Called on each layer that could be drawn after all information from
-// CalcDrawProperties has been updated on that layer. May have some false
-// positives (e.g. layers get this called on them but don't actually get drawn).
-static inline void UpdateTilePrioritiesForLayer(LayerImpl* layer) {
- layer->UpdateTilePriorities();
-
- // Mask layers don't get this call, so explicitly update them so they can
- // kick off tile rasterization.
- if (layer->mask_layer())
- layer->mask_layer()->UpdateTilePriorities();
- if (layer->replica_layer() && layer->replica_layer()->mask_layer())
- layer->replica_layer()->mask_layer()->UpdateTilePriorities();
-}
-
-static inline void UpdateTilePrioritiesForLayer(Layer* layer) {}
-
static inline void SavePaintPropertiesLayer(LayerImpl* layer) {}
static inline void SavePaintPropertiesLayer(Layer* layer) {
@@ -2092,7 +2076,6 @@ static void CalculateDrawPropertiesInternal(
}
}
- UpdateTilePrioritiesForLayer(layer);
SavePaintPropertiesLayer(layer);
// If neither this layer nor any of its children were added, early out.
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 471a133..d124a63 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -385,6 +385,37 @@ void LayerTreeImpl::UpdateDrawProperties() {
LayerTreeHostCommon::CalculateDrawProperties(&inputs);
}
+ {
+ TRACE_EVENT2("cc",
+ "LayerTreeImpl::UpdateTilePriorities",
+ "IsActive",
+ IsActiveTree(),
+ "SourceFrameNumber",
+ source_frame_number_);
+ // LayerIterator is used here instead of CallFunctionForSubtree to only
+ // UpdateTilePriorities on layers that will be visible (and thus have valid
+ // draw properties) and not because any ordering is required.
+ typedef LayerIterator<LayerImpl,
+ LayerImplList,
+ RenderSurfaceImpl,
+ LayerIteratorActions::FrontToBack> LayerIteratorType;
+ LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_);
+ for (LayerIteratorType it =
+ LayerIteratorType::Begin(&render_surface_layer_list_);
+ it != end;
+ ++it) {
+ if (!it.represents_itself())
+ continue;
+ LayerImpl* layer = *it;
+
+ layer->UpdateTilePriorities();
+ if (layer->mask_layer())
+ layer->mask_layer()->UpdateTilePriorities();
+ if (layer->replica_layer() && layer->replica_layer()->mask_layer())
+ layer->replica_layer()->mask_layer()->UpdateTilePriorities();
+ }
+ }
+
DCHECK(!needs_update_draw_properties_) <<
"CalcDrawProperties should not set_needs_update_draw_properties()";
}