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

Unified Diff: cc/trees/layer_tree_host_common.cc

Issue 12259027: cc: Simplify the logic for deciding to update tile priorities. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sper simple x2 Created 7 years, 8 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
Index: cc/trees/layer_tree_host_common.cc
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc
index 7548cd293bbf1a2212062e961bc269fa34b0f08e..96f214894245d8bc97c0f103a67a6061666bc2b3 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -252,6 +252,15 @@ static inline bool SubtreeShouldBeSkipped(Layer* layer) {
!layer->OpacityCanAnimateOnImplThread();
}
+static inline bool NeedsFirstTimeUpdateTilePrioritiesForLayer(
+ LayerImpl* layer) {
+ return layer->NeedsFirstTimeUpdateTilePriorities();
+}
+
+static inline bool NeedsFirstTimeUpdateTilePrioritiesForLayer(Layer* layer) {
+ return false;
+}
+
// 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).
@@ -412,10 +421,10 @@ gfx::Transform ComputeSizeDeltaCompensation(
// Apply step 3
gfx::Transform container_layer_space_to_target_surface_space;
if (target_surface_space_to_container_layer_space.GetInverse(
- &container_layer_space_to_target_surface_space))
+ &container_layer_space_to_target_surface_space)) {
result_transform.PreconcatTransform(
container_layer_space_to_target_surface_space);
- else {
+ } else {
// FIXME: A non-invertible matrix could still make meaningful projection.
// For example ScaleZ(0) is non-invertible but the layer is still visible.
return gfx::Transform();
@@ -440,8 +449,7 @@ void ApplyPositionAdjustment(
LayerImpl* layer,
LayerImpl* container,
const gfx::Transform& scroll_compensation,
- gfx::Transform* combined_transform)
-{
+ gfx::Transform* combined_transform) {
if (!layer->position_constraint().is_fixed_position())
return;
@@ -1391,7 +1399,8 @@ static void CalculateDrawPropertiesInternal(
}
}
- if (update_tile_priorities)
+ if (update_tile_priorities ||
+ NeedsFirstTimeUpdateTilePrioritiesForLayer(layer))
enne (OOO) 2013/04/22 17:03:48 I'm a little ಠ_ಠ at adding yet another virtual fun
danakj 2013/04/22 18:37:30 I could certainly call the current function always
enne (OOO) 2013/04/22 18:44:13 You have LayerTreeImpl::frame_time_last_update_til
danakj 2013/04/22 18:59:38 Hm... right. Okay! Just using that now. PTAL.
UpdateTilePrioritiesForLayer(layer);
// If neither this layer nor any of its children were added, early out.

Powered by Google App Engine
This is Rietveld 408576698