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_PICTURE_LAYER_TILING_H_ | 5 #ifndef CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
6 #define CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 6 #define CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
7 | 7 |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 // Create a tiling with no tiles. CreateTiles must be called to add some. | 124 // Create a tiling with no tiles. CreateTiles must be called to add some. |
125 static scoped_ptr<PictureLayerTiling> Create( | 125 static scoped_ptr<PictureLayerTiling> Create( |
126 float contents_scale, | 126 float contents_scale, |
127 const gfx::Size& layer_bounds, | 127 const gfx::Size& layer_bounds, |
128 PictureLayerTilingClient* client); | 128 PictureLayerTilingClient* client); |
129 gfx::Size layer_bounds() const { return layer_bounds_; } | 129 gfx::Size layer_bounds() const { return layer_bounds_; } |
130 void UpdateTilesToCurrentPile(const Region& layer_invalidation, | 130 void UpdateTilesToCurrentPile(const Region& layer_invalidation, |
131 const gfx::Size& new_layer_bounds); | 131 const gfx::Size& new_layer_bounds); |
132 void CreateMissingTilesInLiveTilesRect(); | 132 void CreateMissingTilesInLiveTilesRect(); |
| 133 void RemoveTilesInRegion(const Region& layer_region); |
133 | 134 |
134 void SetClient(PictureLayerTilingClient* client); | 135 void SetClient(PictureLayerTilingClient* client); |
135 void set_resolution(TileResolution resolution) { resolution_ = resolution; } | 136 void set_resolution(TileResolution resolution) { resolution_ = resolution; } |
136 TileResolution resolution() const { return resolution_; } | 137 TileResolution resolution() const { return resolution_; } |
137 | 138 |
138 gfx::Size tiling_size() const { return tiling_data_.tiling_size(); } | 139 gfx::Size tiling_size() const { return tiling_data_.tiling_size(); } |
139 gfx::Rect live_tiles_rect() const { return live_tiles_rect_; } | 140 gfx::Rect live_tiles_rect() const { return live_tiles_rect_; } |
140 gfx::Size tile_size() const { return tiling_data_.max_texture_size(); } | 141 gfx::Size tile_size() const { return tiling_data_.max_texture_size(); } |
141 float contents_scale() const { return contents_scale_; } | 142 float contents_scale() const { return contents_scale_; } |
142 | 143 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 // rect and the current visible rect to expand the skewport to where it | 277 // rect and the current visible rect to expand the skewport to where it |
277 // would be in |skewport_target_time| seconds. Note that the skewport | 278 // would be in |skewport_target_time| seconds. Note that the skewport |
278 // is guaranteed to contain the current visible rect. | 279 // is guaranteed to contain the current visible rect. |
279 gfx::Rect ComputeSkewport(double current_frame_time_in_seconds, | 280 gfx::Rect ComputeSkewport(double current_frame_time_in_seconds, |
280 const gfx::Rect& visible_rect_in_content_space) | 281 const gfx::Rect& visible_rect_in_content_space) |
281 const; | 282 const; |
282 | 283 |
283 void UpdateEvictionCacheIfNeeded(TreePriority tree_priority); | 284 void UpdateEvictionCacheIfNeeded(TreePriority tree_priority); |
284 void Invalidate(const Region& layer_region); | 285 void Invalidate(const Region& layer_region); |
285 | 286 |
| 287 void DoInvalidate(const Region& layer_region, |
| 288 bool recreate_invalidated_tiles); |
| 289 |
286 // Given properties. | 290 // Given properties. |
287 float contents_scale_; | 291 float contents_scale_; |
288 gfx::Size layer_bounds_; | 292 gfx::Size layer_bounds_; |
289 TileResolution resolution_; | 293 TileResolution resolution_; |
290 PictureLayerTilingClient* client_; | 294 PictureLayerTilingClient* client_; |
291 | 295 |
292 // Internal data. | 296 // Internal data. |
293 TilingData tiling_data_; | 297 TilingData tiling_data_; |
294 TileMap tiles_; // It is not legal to have a NULL tile in the tiles_ map. | 298 TileMap tiles_; // It is not legal to have a NULL tile in the tiles_ map. |
295 gfx::Rect live_tiles_rect_; | 299 gfx::Rect live_tiles_rect_; |
(...skipping 13 matching lines...) Expand all Loading... |
309 | 313 |
310 private: | 314 private: |
311 DISALLOW_ASSIGN(PictureLayerTiling); | 315 DISALLOW_ASSIGN(PictureLayerTiling); |
312 | 316 |
313 RectExpansionCache expansion_cache_; | 317 RectExpansionCache expansion_cache_; |
314 }; | 318 }; |
315 | 319 |
316 } // namespace cc | 320 } // namespace cc |
317 | 321 |
318 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 322 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
OLD | NEW |