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

Unified Diff: cc/picture_layer_tiling.h

Issue 12259027: cc: Simplify the logic for deciding to update tile priorities. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Avoid project more agressively. Don't save state for tile prio if we didn't compute tile prio. Created 7 years, 10 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/picture_layer_tiling.h
diff --git a/cc/picture_layer_tiling.h b/cc/picture_layer_tiling.h
index 4c4bb147111abcaaec55ca20e340f70e7bad07d1..22580bb37dced6168b3a759d31aa171e5d3c1a24 100644
--- a/cc/picture_layer_tiling.h
+++ b/cc/picture_layer_tiling.h
@@ -144,6 +144,21 @@ class CC_EXPORT PictureLayerTiling {
// also updates the pile on each tile to be the current client's pile.
void DidBecomeActive();
+ bool needs_update_tile_priorities(int current_source_frame_number,
+ double current_frame_time) const {
+ // In pending tree, UpdateTilePriorities is always called with
+ // calcDrawProperties. We want to update tile priorities:
+ // - Immediately after a commit (first_update_in_new_source_frame).
+ // - On animation ticks after the first frame in the tree
+ // (first_update_in_new_impl_frame).
+ // In active tree, UpdateTilePriorities is only called during draw. We
+ // want to update priorities:
+ // - Only if properties were not already computed by the pending tree
+ // and activated for the frame (first_update_in_new_impl_frame).
+ return current_source_frame_number != last_source_frame_number_ ||
+ current_frame_time != last_impl_frame_time_;
+ }
+
protected:
typedef std::pair<int, int> TileMapKey;
typedef base::hash_map<TileMapKey, scoped_refptr<Tile> > TileMap;

Powered by Google App Engine
This is Rietveld 408576698