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

Unified Diff: cc/tile_manager.h

Issue 11417002: First draft of TileManager's tile prioritzation system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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
« no previous file with comments | « cc/tile.cc ('k') | cc/tile_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tile_manager.h
diff --git a/cc/tile_manager.h b/cc/tile_manager.h
index 3446c335b3260f0b8f9f4b72db618f6962b7b928..8f6bf8811b1f3083bb496c46a48e0bf08cf7971a 100644
--- a/cc/tile_manager.h
+++ b/cc/tile_manager.h
@@ -8,6 +8,7 @@
#include <vector>
#include "base/values.h"
+#include "cc/layer_tree_host_impl.h"
#include "cc/tile_priority.h"
namespace cc {
@@ -24,6 +25,36 @@ class TileManagerClient {
virtual ~TileManagerClient() {}
};
+// Tile manager classifying tiles into a few basic
+// bins:
+enum TileManagerBin {
+ NOW_BIN = 0, // Needed ASAP.
+ SOON_BIN = 1, // Impl-side version of prepainting.
+ EVENTUALLY_BIN = 2, // Nice to have, if we've got memory and time.
+ NEVER_BIN = 3, // Dont bother.
+ NUM_BINS = 4
+};
+
+// This is state that is specific to a tile that is
+// managed by the TileManager.
+class ManagedTileState {
+ public:
+ ManagedTileState()
+ : can_use_gpu_memory(false)
+ , resource_id(0)
+ , resource_id_can_be_freed(0) {}
+
+ // Persisted state: valid all the time.
+ bool can_use_gpu_memory;
+ ResourceProvider::ResourceId resource_id;
+ bool resource_id_can_be_freed;
+
+ // Ephemeral state, valid only during Manage.
+ TileManagerBin bin;
+ TileResolution resolution;
+ float time_to_needed_in_seconds;
+};
+
// This class manages tiles, deciding which should get rasterized and which
// should no longer have any memory assigned to them. Tile objects are "owned"
// by layers; they automatically register with the manager when they are
@@ -38,19 +69,24 @@ class TileManager {
protected:
// Methods called by Tile
- void DidCreateTileVersion(TileVersion*);
- void WillModifyTileVersionPriority(TileVersion*, const TilePriority& new_priority);
- void DidDeleteTileVersion(TileVersion*);
+ friend class Tile;
+ void RegisterTile(Tile*);
+ void UnregisterTile(Tile*);
+ void WillModifyTilePriority(Tile*, WhichTree, const TilePriority& new_priority);
private:
- friend class Tile;
+ void FreeResourcesForTile(Tile*);
void ScheduleManageTiles();
+ void ScheduleMorePaintingJobs();
TileManagerClient* client_;
bool manage_tiles_pending_;
GlobalStateThatImpactsTilePriority global_state_;
- std::vector<TileVersion*> tile_versions_;
+
+ typedef std::vector<Tile*> TileVector;
+ TileVector tiles_;
+ TileVector tiles_that_need_to_be_painted_;
};
} // namespace cc
« no previous file with comments | « cc/tile.cc ('k') | cc/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698