OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_RESOURCES_MANAGED_TILE_STATE_H_ | 5 #ifndef CC_RESOURCES_MANAGED_TILE_STATE_H_ |
6 #define CC_RESOURCES_MANAGED_TILE_STATE_H_ | 6 #define CC_RESOURCES_MANAGED_TILE_STATE_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 } | 60 } |
61 | 61 |
62 scoped_ptr<ResourcePool::Resource>& GetResourceForTesting() { | 62 scoped_ptr<ResourcePool::Resource>& GetResourceForTesting() { |
63 return resource_; | 63 return resource_; |
64 } | 64 } |
65 | 65 |
66 private: | 66 private: |
67 friend class TileManager; | 67 friend class TileManager; |
68 friend class ManagedTileState; | 68 friend class ManagedTileState; |
69 | 69 |
70 void set_texture() { | |
reveman
2013/03/22 23:56:50
set_resource() and please change the enum to RESOU
Leandro GraciĆ” Gil
2013/03/25 15:21:02
Done.
| |
71 mode_ = TEXTURE_MODE; | |
72 } | |
73 | |
70 void set_transparent() { | 74 void set_transparent() { |
71 mode_ = TRANSPARENT_MODE; | 75 mode_ = TRANSPARENT_MODE; |
72 } | 76 } |
73 | 77 |
74 void set_solid_color(const SkColor& color) { | 78 void set_solid_color(const SkColor& color) { |
75 mode_ = SOLID_COLOR_MODE; | 79 mode_ = SOLID_COLOR_MODE; |
76 solid_color_ = color; | 80 solid_color_ = color; |
77 } | 81 } |
78 | 82 |
83 void set_rasterize_on_demand() { | |
84 mode_ = PICTURE_PILE_MODE; | |
85 } | |
86 | |
87 void set_contents_swizzled(bool contents_swizzled) { | |
88 contents_swizzled_ = contents_swizzled; | |
89 } | |
90 | |
79 Mode mode_; | 91 Mode mode_; |
80 SkColor solid_color_; | 92 SkColor solid_color_; |
81 | 93 |
82 scoped_ptr<ResourcePool::Resource> resource_; | 94 scoped_ptr<ResourcePool::Resource> resource_; |
83 bool resource_is_being_initialized_; | 95 bool resource_is_being_initialized_; |
84 bool can_be_freed_; | 96 bool can_be_freed_; |
85 bool contents_swizzled_; | 97 bool contents_swizzled_; |
86 }; | 98 }; |
87 | 99 |
88 | 100 |
(...skipping 19 matching lines...) Expand all Loading... | |
108 // to determine policy. | 120 // to determine policy. |
109 TileManagerBin gpu_memmgr_stats_bin; | 121 TileManagerBin gpu_memmgr_stats_bin; |
110 TileResolution resolution; | 122 TileResolution resolution; |
111 float time_to_needed_in_seconds; | 123 float time_to_needed_in_seconds; |
112 float distance_to_visible_in_pixels; | 124 float distance_to_visible_in_pixels; |
113 }; | 125 }; |
114 | 126 |
115 } // namespace cc | 127 } // namespace cc |
116 | 128 |
117 #endif // CC_RESOURCES_MANAGED_TILE_STATE_H_ | 129 #endif // CC_RESOURCES_MANAGED_TILE_STATE_H_ |
OLD | NEW |