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

Unified Diff: cc/picture_layer_tiling.h

Issue 11414238: implement the logic to set tile priorities based on current matrix (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: passing content scale from layer to tiling so that screenspacetransform can be applied Created 8 years, 1 month 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 d1ccc8213afdae1988f8a51ce266077916c5c05e..6519aeb8fecada5ef85fb8ec445ad6732964c153 100644
--- a/cc/picture_layer_tiling.h
+++ b/cc/picture_layer_tiling.h
@@ -86,7 +86,23 @@ class CC_EXPORT PictureLayerTiling {
void Reset() { return tiles_.clear(); }
+ void UpdateTilePriorities(const gfx::Size& view_port,
+ float layer_content_scale,
+ const gfx::Transform& last_transform,
+ const gfx::Transform& current_transform,
+ double time_delta);
+
protected:
+ // TODO(qinmin): modify ui/range/Range.h to support template so that we
+ // don't need to define this.
+ struct Range {
+ Range(double start, double end) : start_(start), end_(end) {}
+ Range Intersects(const Range& other);
+ bool IsEmpty();
+ double start_;
+ double end_;
+ };
+
typedef std::pair<int, int> TileMapKey;
typedef base::hash_map<TileMapKey, scoped_refptr<Tile> > TileMap;
@@ -94,6 +110,20 @@ class CC_EXPORT PictureLayerTiling {
Tile* TileAt(int, int) const;
void CreateTile(int i, int j);
+ // Calculate the time for the |current_bounds| to intersect with the
+ // |target_bounds| given its previous location and time delta.
+ // This function should work for both scaling and scrolling case.
+ double TimeForBoundsToIntersect(gfx::Rect previous_bounds,
+ gfx::Rect current_bounds,
+ double time_delta,
+ gfx::Rect target_bounds);
+
+ // Calculate a time range that |value| will be larger than |threshold|
+ // given the velocity of its change.
+ Range TimeRangeValueLargerThanThreshold(int value,
+ int threshold,
+ double velocity);
+
PictureLayerTilingClient* client_;
float contents_scale_;
gfx::Size layer_bounds_;
@@ -101,6 +131,7 @@ class CC_EXPORT PictureLayerTiling {
TilingData tiling_data_;
friend class Iterator;
+ friend class PictureLayerTilingTest;
};
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698