OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_TILE_H_ | 5 #ifndef CC_TILE_H_ |
6 #define CC_TILE_H_ | 6 #define CC_TILE_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
54 // Returns 0 if not drawable. | 54 // Returns 0 if not drawable. |
55 ResourceProvider::ResourceId GetResourceId() const { | 55 ResourceProvider::ResourceId GetResourceId() const { |
56 if (!managed_state_.resource) | 56 if (!managed_state_.resource) |
57 return 0; | 57 return 0; |
58 if (managed_state_.resource_is_being_initialized) | 58 if (managed_state_.resource_is_being_initialized) |
59 return 0; | 59 return 0; |
60 | 60 |
61 return managed_state_.resource->id(); | 61 return managed_state_.resource->id(); |
62 } | 62 } |
63 | 63 |
64 bool is_ready_to_draw() const { | |
reveman
2013/02/28 18:54:55
Lower case function names are usually only used fo
| |
65 return GetResourceId() != 0 || | |
66 is_solid_color_ || | |
67 is_transparent_; | |
68 } | |
69 | |
70 bool is_solid_color() const { | |
71 return is_solid_color_; | |
72 } | |
73 | |
74 void set_solid_color(const SkColor& color) { | |
75 is_solid_color_ = true; | |
76 solid_color_ = color; | |
77 } | |
78 | |
79 bool is_transparent() const { | |
80 return is_transparent_; | |
81 } | |
82 | |
83 void set_transparent(bool flag) { | |
84 is_transparent_ = flag; | |
85 } | |
86 | |
87 SkColor get_solid_color() const { | |
88 return solid_color_; | |
89 } | |
90 | |
91 void set_cheap(bool flag) { | |
92 is_cheap_ = flag; | |
93 } | |
94 | |
95 bool is_cheap() const { | |
96 return is_cheap_; | |
97 } | |
98 | |
64 const gfx::Rect& opaque_rect() const { return opaque_rect_; } | 99 const gfx::Rect& opaque_rect() const { return opaque_rect_; } |
65 | 100 |
66 bool contents_swizzled() const { return managed_state_.contents_swizzled; } | 101 bool contents_swizzled() const { return managed_state_.contents_swizzled; } |
67 | 102 |
68 float contents_scale() const { return contents_scale_; } | 103 float contents_scale() const { return contents_scale_; } |
69 gfx::Rect content_rect() const { return content_rect_; } | 104 gfx::Rect content_rect() const { return content_rect_; } |
70 | 105 |
71 int layer_id() const { return layer_id_; } | 106 int layer_id() const { return layer_id_; } |
72 | 107 |
73 void set_picture_pile(scoped_refptr<PicturePileImpl> pile) { | 108 void set_picture_pile(scoped_refptr<PicturePileImpl> pile) { |
(...skipping 24 matching lines...) Expand all Loading... | |
98 scoped_refptr<PicturePileImpl> picture_pile_; | 133 scoped_refptr<PicturePileImpl> picture_pile_; |
99 gfx::Rect tile_size_; | 134 gfx::Rect tile_size_; |
100 GLenum format_; | 135 GLenum format_; |
101 gfx::Rect content_rect_; | 136 gfx::Rect content_rect_; |
102 float contents_scale_; | 137 float contents_scale_; |
103 gfx::Rect opaque_rect_; | 138 gfx::Rect opaque_rect_; |
104 | 139 |
105 TilePriority priority_[NUM_BIN_PRIORITIES]; | 140 TilePriority priority_[NUM_BIN_PRIORITIES]; |
106 ManagedTileState managed_state_; | 141 ManagedTileState managed_state_; |
107 int layer_id_; | 142 int layer_id_; |
143 | |
144 SkColor solid_color_; | |
145 bool is_solid_color_; | |
146 bool is_transparent_; | |
147 bool is_cheap_; | |
108 }; | 148 }; |
109 | 149 |
110 } // namespace cc | 150 } // namespace cc |
111 | 151 |
112 #endif // CC_TILE_H_ | 152 #endif // CC_TILE_H_ |
OLD | NEW |