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_TILES_PICTURE_LAYER_TILING_H_ | 5 #ifndef CC_TILES_PICTURE_LAYER_TILING_H_ |
6 #define CC_TILES_PICTURE_LAYER_TILING_H_ | 6 #define CC_TILES_PICTURE_LAYER_TILING_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 can_require_tiles_for_activation_ = can_require_tiles; | 115 can_require_tiles_for_activation_ = can_require_tiles; |
116 } | 116 } |
117 | 117 |
118 const scoped_refptr<RasterSource>& raster_source() const { | 118 const scoped_refptr<RasterSource>& raster_source() const { |
119 return raster_source_; | 119 return raster_source_; |
120 } | 120 } |
121 gfx::Size tiling_size() const { return tiling_data_.tiling_size(); } | 121 gfx::Size tiling_size() const { return tiling_data_.tiling_size(); } |
122 gfx::Rect live_tiles_rect() const { return live_tiles_rect_; } | 122 gfx::Rect live_tiles_rect() const { return live_tiles_rect_; } |
123 gfx::Size tile_size() const { return tiling_data_.max_texture_size(); } | 123 gfx::Size tile_size() const { return tiling_data_.max_texture_size(); } |
124 float contents_scale_key() const { return raster_transform_.scale(); } | 124 float contents_scale_key() const { return raster_transform_.scale(); } |
125 const ScaleTranslate2d& raster_transform() const { | 125 const ScaleTranslate2d& raster_transform() const { return raster_transform_; } |
126 return raster_transform_; | |
127 } | |
128 const TilingData* tiling_data() const { return &tiling_data_; } | 126 const TilingData* tiling_data() const { return &tiling_data_; } |
129 | 127 |
130 Tile* TileAt(int i, int j) const { | 128 Tile* TileAt(int i, int j) const { |
131 TileMap::const_iterator iter = tiles_.find(TileMapKey(i, j)); | 129 TileMap::const_iterator iter = tiles_.find(TileMapKey(i, j)); |
132 return iter == tiles_.end() ? nullptr : iter->second.get(); | 130 return iter == tiles_.end() ? nullptr : iter->second.get(); |
133 } | 131 } |
134 | 132 |
135 bool has_tiles() const { return !tiles_.empty(); } | 133 bool has_tiles() const { return !tiles_.empty(); } |
136 // all_tiles_done() can return false negatives. | 134 // all_tiles_done() can return false negatives. |
137 bool all_tiles_done() const { return all_tiles_done_; } | 135 bool all_tiles_done() const { return all_tiles_done_; } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 SimpleEnclosedRegion(viewport_in_layer_space)); | 174 SimpleEnclosedRegion(viewport_in_layer_space)); |
177 } | 175 } |
178 const gfx::Rect& GetCurrentVisibleRectForTesting() const { | 176 const gfx::Rect& GetCurrentVisibleRectForTesting() const { |
179 return current_visible_rect_; | 177 return current_visible_rect_; |
180 } | 178 } |
181 void SetTilePriorityRectsForTesting( | 179 void SetTilePriorityRectsForTesting( |
182 const gfx::Rect& visible_rect_in_content_space, | 180 const gfx::Rect& visible_rect_in_content_space, |
183 const gfx::Rect& skewport, | 181 const gfx::Rect& skewport, |
184 const gfx::Rect& soon_border_rect, | 182 const gfx::Rect& soon_border_rect, |
185 const gfx::Rect& eventually_rect) { | 183 const gfx::Rect& eventually_rect) { |
186 SetTilePriorityRects(1.f, visible_rect_in_content_space, | 184 SetTilePriorityRects(1.f, visible_rect_in_content_space, skewport, |
187 skewport, soon_border_rect, eventually_rect, | 185 soon_border_rect, eventually_rect, Occlusion()); |
188 Occlusion()); | |
189 } | 186 } |
190 | 187 |
191 // Iterate over all tiles to fill content_rect. Even if tiles are invalid | 188 // Iterate over all tiles to fill content_rect. Even if tiles are invalid |
192 // (i.e. no valid resource) this tiling should still iterate over them. | 189 // (i.e. no valid resource) this tiling should still iterate over them. |
193 // The union of all geometry_rect calls for each element iterated over should | 190 // The union of all geometry_rect calls for each element iterated over should |
194 // exactly equal content_rect and no two geometry_rects should intersect. | 191 // exactly equal content_rect and no two geometry_rects should intersect. |
195 class CC_EXPORT CoverageIterator { | 192 class CC_EXPORT CoverageIterator { |
196 public: | 193 public: |
197 CoverageIterator(); | 194 CoverageIterator(); |
198 // This requests an iterator that produces a coverage of the | 195 // This requests an iterator that produces a coverage of the |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 bool has_eventually_rect_tiles_ = false; | 364 bool has_eventually_rect_tiles_ = false; |
368 bool all_tiles_done_ = true; | 365 bool all_tiles_done_ = true; |
369 | 366 |
370 private: | 367 private: |
371 DISALLOW_COPY_AND_ASSIGN(PictureLayerTiling); | 368 DISALLOW_COPY_AND_ASSIGN(PictureLayerTiling); |
372 }; | 369 }; |
373 | 370 |
374 } // namespace cc | 371 } // namespace cc |
375 | 372 |
376 #endif // CC_TILES_PICTURE_LAYER_TILING_H_ | 373 #endif // CC_TILES_PICTURE_LAYER_TILING_H_ |
OLD | NEW |