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

Unified Diff: cc/resources/managed_tile_state.h

Issue 15715031: cc: Remove memory state from tile management (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 7 years, 7 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/resources/managed_tile_state.cc » ('j') | cc/resources/resource_pool.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/managed_tile_state.h
diff --git a/cc/resources/managed_tile_state.h b/cc/resources/managed_tile_state.h
index 51271eca00e114ade40456c1e5e13bf9d9500489..7cdc65836e9167cec9b94ff3c0657adb2cba675d 100644
--- a/cc/resources/managed_tile_state.h
+++ b/cc/resources/managed_tile_state.h
@@ -14,13 +14,6 @@
namespace cc {
-enum TileVersionMemoryState {
- NOT_ALLOWED_TO_USE_MEMORY,
- CAN_USE_MEMORY,
- USING_UNRELEASABLE_MEMORY,
- USING_RELEASABLE_MEMORY
-};
-
// This is state that is specific to a tile that is
// managed by the TileManager.
class CC_EXPORT ManagedTileState {
@@ -46,8 +39,8 @@ class CC_EXPORT ManagedTileState {
ResourceProvider::ResourceId get_resource_id() const {
DCHECK(mode_ == RESOURCE_MODE);
DCHECK(resource_id_);
- DCHECK(memory_state_ == USING_RELEASABLE_MEMORY || forced_upload_);
- return resource_id_;
+ DCHECK(resource_ || (resource_id_ && forced_upload_));
+ return (resource_ ? resource_->id() : resource_id_);
reveman 2013/06/03 18:07:23 nit: resource_->id() should be the same as resourc
vmpstr 2013/06/03 18:25:48 Done.
}
SkColor get_solid_color() const {
@@ -76,10 +69,6 @@ class CC_EXPORT ManagedTileState {
return resource_;
}
- void SetMemoryStateForTesting(TileVersionMemoryState state) {
- memory_state_ = state;
- }
-
private:
friend class TileManager;
friend class Tile;
@@ -87,20 +76,16 @@ class CC_EXPORT ManagedTileState {
void set_use_resource() {
mode_ = RESOURCE_MODE;
- if (memory_state_ == NOT_ALLOWED_TO_USE_MEMORY)
- memory_state_ = CAN_USE_MEMORY;
}
void set_solid_color(const SkColor& color) {
mode_ = SOLID_COLOR_MODE;
solid_color_ = color;
- memory_state_ = NOT_ALLOWED_TO_USE_MEMORY;
resource_id_ = 0;
}
void set_rasterize_on_demand() {
mode_ = PICTURE_PILE_MODE;
- memory_state_ = NOT_ALLOWED_TO_USE_MEMORY;
resource_id_ = 0;
}
@@ -113,7 +98,6 @@ class CC_EXPORT ManagedTileState {
ResourceProvider::ResourceId resource_id_;
scoped_ptr<ResourcePool::Resource> resource_;
GLenum resource_format_;
- TileVersionMemoryState memory_state_;
bool forced_upload_;
};
« no previous file with comments | « no previous file | cc/resources/managed_tile_state.cc » ('j') | cc/resources/resource_pool.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698