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 <set> | 8 #include <map> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/containers/hash_tables.h" | 13 #include "base/containers/hash_tables.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "cc/base/cc_export.h" | 15 #include "cc/base/cc_export.h" |
16 #include "cc/base/region.h" | 16 #include "cc/base/region.h" |
17 #include "cc/base/tiling_data.h" | 17 #include "cc/base/tiling_data.h" |
18 #include "cc/resources/tile.h" | 18 #include "cc/resources/tile.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 | 133 |
134 const gfx::Rect& GetCurrentVisibleRectForTesting() const { | 134 const gfx::Rect& GetCurrentVisibleRectForTesting() const { |
135 return current_visible_rect_; | 135 return current_visible_rect_; |
136 } | 136 } |
137 | 137 |
138 bool IsTileOccluded(const Tile* tile) const; | 138 bool IsTileOccluded(const Tile* tile) const; |
139 bool IsTileRequiredForActivationIfVisible(const Tile* tile) const; | 139 bool IsTileRequiredForActivationIfVisible(const Tile* tile) const; |
140 bool IsTileRequiredForDrawIfVisible(const Tile* tile) const; | 140 bool IsTileRequiredForDrawIfVisible(const Tile* tile) const; |
141 | 141 |
142 void UpdateTileAndTwinPriority(Tile* tile) const; | 142 void UpdateTileAndTwinPriority(Tile* tile) const; |
| 143 TilePriority ComputePriorityForTile(const Tile* tile) const; |
| 144 void UpdateRequiredStateForTile(Tile* tile, WhichTree tree) const; |
143 bool has_visible_rect_tiles() const { return has_visible_rect_tiles_; } | 145 bool has_visible_rect_tiles() const { return has_visible_rect_tiles_; } |
144 bool has_skewport_rect_tiles() const { return has_skewport_rect_tiles_; } | 146 bool has_skewport_rect_tiles() const { return has_skewport_rect_tiles_; } |
145 bool has_soon_border_rect_tiles() const { | 147 bool has_soon_border_rect_tiles() const { |
146 return has_soon_border_rect_tiles_; | 148 return has_soon_border_rect_tiles_; |
147 } | 149 } |
148 bool has_eventually_rect_tiles() const { return has_eventually_rect_tiles_; } | 150 bool has_eventually_rect_tiles() const { return has_eventually_rect_tiles_; } |
149 | 151 |
150 const gfx::Rect& current_visible_rect() const { | 152 const gfx::Rect& current_visible_rect() const { |
151 return current_visible_rect_; | 153 return current_visible_rect_; |
152 } | 154 } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 friend class PictureLayerTiling; | 206 friend class PictureLayerTiling; |
205 }; | 207 }; |
206 | 208 |
207 void Reset(); | 209 void Reset(); |
208 | 210 |
209 bool ComputeTilePriorityRects(const gfx::Rect& viewport_in_layer_space, | 211 bool ComputeTilePriorityRects(const gfx::Rect& viewport_in_layer_space, |
210 float ideal_contents_scale, | 212 float ideal_contents_scale, |
211 double current_frame_time_in_seconds, | 213 double current_frame_time_in_seconds, |
212 const Occlusion& occlusion_in_layer_space); | 214 const Occlusion& occlusion_in_layer_space); |
213 | 215 |
214 void GetAllTilesForTracing(std::set<const Tile*>* tiles) const; | 216 void GetAllTilesAndPrioritiesForTracing( |
| 217 std::map<const Tile*, TilePriority>* tile_map) const; |
215 void AsValueInto(base::trace_event::TracedValue* array) const; | 218 void AsValueInto(base::trace_event::TracedValue* array) const; |
216 size_t GPUMemoryUsageInBytes() const; | 219 size_t GPUMemoryUsageInBytes() const; |
217 | 220 |
218 struct RectExpansionCache { | 221 struct RectExpansionCache { |
219 RectExpansionCache(); | 222 RectExpansionCache(); |
220 | 223 |
221 gfx::Rect previous_start; | 224 gfx::Rect previous_start; |
222 gfx::Rect previous_bounds; | 225 gfx::Rect previous_bounds; |
223 gfx::Rect previous_result; | 226 gfx::Rect previous_result; |
224 int64 previous_target; | 227 int64 previous_target; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 | 340 |
338 private: | 341 private: |
339 DISALLOW_ASSIGN(PictureLayerTiling); | 342 DISALLOW_ASSIGN(PictureLayerTiling); |
340 | 343 |
341 RectExpansionCache expansion_cache_; | 344 RectExpansionCache expansion_cache_; |
342 }; | 345 }; |
343 | 346 |
344 } // namespace cc | 347 } // namespace cc |
345 | 348 |
346 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 349 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
OLD | NEW |