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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 131 |
132 void set_picture_pile(scoped_refptr<PicturePileImpl> pile) { | 132 void set_picture_pile(scoped_refptr<PicturePileImpl> pile) { |
133 DCHECK(pile->CanRaster(contents_scale_, content_rect_)) | 133 DCHECK(pile->CanRaster(contents_scale_, content_rect_)) |
134 << gfx::ScaleToEnclosingRect(content_rect_, 1.f / contents_scale_) | 134 << gfx::ScaleToEnclosingRect(content_rect_, 1.f / contents_scale_) |
135 .ToString(); | 135 .ToString(); |
136 picture_pile_ = pile; | 136 picture_pile_ = pile; |
137 } | 137 } |
138 | 138 |
139 size_t GPUMemoryUsageInBytes() const; | 139 size_t GPUMemoryUsageInBytes() const; |
140 | 140 |
141 gfx::Size size() const { return tile_size_.size(); } | 141 gfx::Size size() const { return size_; } |
142 | 142 |
143 RasterMode DetermineRasterModeForTree(WhichTree tree) const; | 143 RasterMode DetermineRasterModeForTree(WhichTree tree) const; |
144 RasterMode DetermineOverallRasterMode() const; | 144 RasterMode DetermineOverallRasterMode() const; |
145 | 145 |
146 // Functionality used in tests. | 146 // Functionality used in tests. |
147 RasterMode GetRasterModeForTesting() const { | 147 RasterMode GetRasterModeForTesting() const { |
148 return managed_state().raster_mode; | 148 return managed_state().raster_mode; |
149 } | 149 } |
150 ManagedTileState::TileVersion& GetTileVersionForTesting(RasterMode mode) { | 150 ManagedTileState::TileVersion& GetTileVersionForTesting(RasterMode mode) { |
151 return managed_state_.tile_versions[mode]; | 151 return managed_state_.tile_versions[mode]; |
(...skipping 19 matching lines...) Expand all Loading... |
171 ~Tile(); | 171 ~Tile(); |
172 | 172 |
173 ManagedTileState& managed_state() { return managed_state_; } | 173 ManagedTileState& managed_state() { return managed_state_; } |
174 const ManagedTileState& managed_state() const { return managed_state_; } | 174 const ManagedTileState& managed_state() const { return managed_state_; } |
175 RasterMode DetermineRasterModeForResolution(TileResolution resolution) const; | 175 RasterMode DetermineRasterModeForResolution(TileResolution resolution) const; |
176 | 176 |
177 bool HasRasterTask() const; | 177 bool HasRasterTask() const; |
178 | 178 |
179 TileManager* tile_manager_; | 179 TileManager* tile_manager_; |
180 scoped_refptr<PicturePileImpl> picture_pile_; | 180 scoped_refptr<PicturePileImpl> picture_pile_; |
181 gfx::Rect tile_size_; | 181 gfx::Size size_; |
182 gfx::Rect content_rect_; | 182 gfx::Rect content_rect_; |
183 float contents_scale_; | 183 float contents_scale_; |
184 gfx::Rect opaque_rect_; | 184 gfx::Rect opaque_rect_; |
185 bool is_occluded_[NUM_TREES]; | 185 bool is_occluded_[NUM_TREES]; |
186 | 186 |
187 TilePriority priority_[NUM_TREES]; | 187 TilePriority priority_[NUM_TREES]; |
188 ManagedTileState managed_state_; | 188 ManagedTileState managed_state_; |
189 int layer_id_; | 189 int layer_id_; |
190 int source_frame_number_; | 190 int source_frame_number_; |
191 int flags_; | 191 int flags_; |
192 | 192 |
193 Id id_; | 193 Id id_; |
194 static Id s_next_id_; | 194 static Id s_next_id_; |
195 | 195 |
196 DISALLOW_COPY_AND_ASSIGN(Tile); | 196 DISALLOW_COPY_AND_ASSIGN(Tile); |
197 }; | 197 }; |
198 | 198 |
199 } // namespace cc | 199 } // namespace cc |
200 | 200 |
201 #endif // CC_RESOURCES_TILE_H_ | 201 #endif // CC_RESOURCES_TILE_H_ |
OLD | NEW |