| Index: cc/resources/managed_tile_state.h
|
| diff --git a/cc/resources/managed_tile_state.h b/cc/resources/managed_tile_state.h
|
| index e8abed9a5d8ecaabe6cc65434aca0794dbf905e3..cc024796cfb242a6f842de8831e93e0e034cc515 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_);
|
| }
|
|
|
| SkColor get_solid_color() const {
|
| @@ -67,12 +60,13 @@ class CC_EXPORT ManagedTileState {
|
|
|
| size_t GPUMemoryUsageInBytes() const;
|
|
|
| - scoped_ptr<ResourcePool::Resource>& GetResourceForTesting() {
|
| - return resource_;
|
| + void SetResourceForTesting(scoped_ptr<ResourcePool::Resource> resource) {
|
| + resource_ = resource.Pass();
|
| + resource_id_ = resource_->id();
|
| }
|
|
|
| - void SetMemoryStateForTesting(TileVersionMemoryState state) {
|
| - memory_state_ = state;
|
| + scoped_ptr<ResourcePool::Resource>& GetResourceForTesting() {
|
| + return resource_;
|
| }
|
|
|
| private:
|
| @@ -82,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;
|
| }
|
|
|
| @@ -105,7 +95,6 @@ class CC_EXPORT ManagedTileState {
|
| ResourceProvider::ResourceId resource_id_;
|
| scoped_ptr<ResourcePool::Resource> resource_;
|
| GLenum resource_format_;
|
| - TileVersionMemoryState memory_state_;
|
| bool forced_upload_;
|
| };
|
|
|
|
|