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_RESOURCES_TILE_H_ | 5 #ifndef CC_RESOURCES_TILE_H_ |
6 #define CC_RESOURCES_TILE_H_ | 6 #define CC_RESOURCES_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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } | 117 } |
118 | 118 |
119 const ManagedTileState::TileVersion& GetTileVersionForDrawing() const { | 119 const ManagedTileState::TileVersion& GetTileVersionForDrawing() const { |
120 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { | 120 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { |
121 if (managed_state_.tile_versions[mode].IsReadyToDraw()) | 121 if (managed_state_.tile_versions[mode].IsReadyToDraw()) |
122 return managed_state_.tile_versions[mode]; | 122 return managed_state_.tile_versions[mode]; |
123 } | 123 } |
124 return managed_state_.tile_versions[HIGH_QUALITY_RASTER_MODE]; | 124 return managed_state_.tile_versions[HIGH_QUALITY_RASTER_MODE]; |
125 } | 125 } |
126 | 126 |
127 gfx::Rect opaque_rect() const { return opaque_rect_; } | |
128 float contents_scale() const { return contents_scale_; } | 127 float contents_scale() const { return contents_scale_; } |
129 gfx::Rect content_rect() const { return content_rect_; } | 128 gfx::Rect content_rect() const { return content_rect_; } |
130 | 129 |
131 int layer_id() const { return layer_id_; } | 130 int layer_id() const { return layer_id_; } |
132 | 131 |
133 int source_frame_number() const { return source_frame_number_; } | 132 int source_frame_number() const { return source_frame_number_; } |
134 | 133 |
135 void set_picture_pile(scoped_refptr<PicturePileImpl> pile) { | 134 void set_picture_pile(scoped_refptr<PicturePileImpl> pile) { |
136 DCHECK(pile->CanRaster(contents_scale_, content_rect_)) | 135 DCHECK(pile->CanRaster(contents_scale_, content_rect_)) |
137 << "Recording rect: " | 136 << "Recording rect: " |
(...skipping 22 matching lines...) Expand all Loading... |
160 friend class PrioritizedTileSet; | 159 friend class PrioritizedTileSet; |
161 friend class FakeTileManager; | 160 friend class FakeTileManager; |
162 friend class BinComparator; | 161 friend class BinComparator; |
163 friend class FakePictureLayerImpl; | 162 friend class FakePictureLayerImpl; |
164 | 163 |
165 // Methods called by by tile manager. | 164 // Methods called by by tile manager. |
166 Tile(TileManager* tile_manager, | 165 Tile(TileManager* tile_manager, |
167 PicturePileImpl* picture_pile, | 166 PicturePileImpl* picture_pile, |
168 const gfx::Size& tile_size, | 167 const gfx::Size& tile_size, |
169 const gfx::Rect& content_rect, | 168 const gfx::Rect& content_rect, |
170 const gfx::Rect& opaque_rect, | |
171 float contents_scale, | 169 float contents_scale, |
172 int layer_id, | 170 int layer_id, |
173 int source_frame_number, | 171 int source_frame_number, |
174 int flags); | 172 int flags); |
175 ~Tile(); | 173 ~Tile(); |
176 | 174 |
177 ManagedTileState& managed_state() { return managed_state_; } | 175 ManagedTileState& managed_state() { return managed_state_; } |
178 const ManagedTileState& managed_state() const { return managed_state_; } | 176 const ManagedTileState& managed_state() const { return managed_state_; } |
179 RasterMode DetermineRasterModeForResolution(TileResolution resolution) const; | 177 RasterMode DetermineRasterModeForResolution(TileResolution resolution) const; |
180 | 178 |
181 bool HasRasterTask() const; | 179 bool HasRasterTask() const; |
182 | 180 |
183 TileManager* tile_manager_; | 181 TileManager* tile_manager_; |
184 scoped_refptr<PicturePileImpl> picture_pile_; | 182 scoped_refptr<PicturePileImpl> picture_pile_; |
185 gfx::Size size_; | 183 gfx::Size size_; |
186 gfx::Rect content_rect_; | 184 gfx::Rect content_rect_; |
187 float contents_scale_; | 185 float contents_scale_; |
188 gfx::Rect opaque_rect_; | |
189 bool is_occluded_[NUM_TREES]; | 186 bool is_occluded_[NUM_TREES]; |
190 | 187 |
191 TilePriority priority_[NUM_TREES]; | 188 TilePriority priority_[NUM_TREES]; |
192 ManagedTileState managed_state_; | 189 ManagedTileState managed_state_; |
193 int layer_id_; | 190 int layer_id_; |
194 int source_frame_number_; | 191 int source_frame_number_; |
195 int flags_; | 192 int flags_; |
196 bool is_shared_; | 193 bool is_shared_; |
197 | 194 |
198 Id id_; | 195 Id id_; |
199 static Id s_next_id_; | 196 static Id s_next_id_; |
200 | 197 |
201 DISALLOW_COPY_AND_ASSIGN(Tile); | 198 DISALLOW_COPY_AND_ASSIGN(Tile); |
202 }; | 199 }; |
203 | 200 |
204 } // namespace cc | 201 } // namespace cc |
205 | 202 |
206 #endif // CC_RESOURCES_TILE_H_ | 203 #endif // CC_RESOURCES_TILE_H_ |
OLD | NEW |