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

Unified Diff: cc/picture_layer_tiling.h

Issue 12280021: cc: Don't discard tiles unless memory is low (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « no previous file | cc/picture_layer_tiling.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/picture_layer_tiling.h
diff --git a/cc/picture_layer_tiling.h b/cc/picture_layer_tiling.h
index e8e3b44222dbd82ecc4929b026cfd0fa2d5014aa..85e502555b9a75f704f4f3ce111a3164695a2a87 100644
--- a/cc/picture_layer_tiling.h
+++ b/cc/picture_layer_tiling.h
@@ -36,13 +36,36 @@ class PictureLayerTilingClient {
class TileHandle {
public:
- TileHandle(scoped_refptr<Tile> tile);
- Tile* tile() const { return tile_.get(); }
+ TileHandle(std::pair<int, int> key, scoped_refptr<Tile> tile);
+ TileHandle(const TileHandle& tile_handle);
+ ~TileHandle();
+
void RegisterWithTileManager();
void UnregisterFromTileManager();
+
+ void AddToLiveTileList(PictureLayerTiling* tiling);
+ void RemoveFromLiveTileList();
+
+ std::pair<int, int> key() const { return key_; }
+ Tile* tile() const { return tile_.get(); }
+ bool should_be_live() const { return should_be_live_; }
+ void set_should_be_live(bool should_be_live) {
+ should_be_live_ = should_be_live;
+ }
+
private:
+ std::pair<int, int> key_;
scoped_refptr<Tile> tile_;
scoped_refptr<ManagedTileState> managed_tile_state_;
+
+ // Transiently set in UpdateTilePriorities to track tiles that
+ // are actively desired to be painted.
+ bool should_be_live_;
+
+ // tiling_ is non-NULL only if this is in a tiling's live_tile_list_, in
+ // which case tiling_live_tile_list_iterator_ valid.
+ PictureLayerTiling* tiling_;
+ std::list<TileHandle*>::iterator tiling_live_tile_list_iterator_;
};
class CC_EXPORT PictureLayerTiling {
@@ -167,6 +190,7 @@ class CC_EXPORT PictureLayerTiling {
protected:
typedef std::pair<int, int> TileMapKey;
typedef base::hash_map<TileMapKey, TileHandle> TileMap;
+ typedef std::list<TileHandle*> TileList;
PictureLayerTiling(float contents_scale);
Tile* TileAt(int, int) const;
@@ -179,11 +203,13 @@ class CC_EXPORT PictureLayerTiling {
gfx::Rect last_prioritized_rect_;
// It is not legal to have a NULL tile in the tiles_ map.
TileMap tiles_;
+ TileList live_tiles_;
TilingData tiling_data_;
TileResolution resolution_;
int last_source_frame_number_;
double last_impl_frame_time_;
+ friend class TileHandle;
friend class Iterator;
};
« no previous file with comments | « no previous file | cc/picture_layer_tiling.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698