Chromium Code Reviews| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 150 } | 150 } |
| 151 const TilingData& TilingDataForTesting() const { return tiling_data_; } | 151 const TilingData& TilingDataForTesting() const { return tiling_data_; } |
| 152 std::vector<Tile*> AllTilesForTesting() const { | 152 std::vector<Tile*> AllTilesForTesting() const { |
| 153 std::vector<Tile*> all_tiles; | 153 std::vector<Tile*> all_tiles; |
| 154 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) | 154 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) |
| 155 all_tiles.push_back(it->second.get()); | 155 all_tiles.push_back(it->second.get()); |
| 156 return all_tiles; | 156 return all_tiles; |
| 157 } | 157 } |
| 158 | 158 |
| 159 void UpdateAllRequiredStateForTesting() { | 159 void UpdateAllRequiredStateForTesting() { |
| 160 for (const auto& key_tile_pair : tiles_) | 160 for (const auto& key_tile_pair : tiles_) { |
| 161 UpdateRequiredStatesOnTile(key_tile_pair.second.get()); | 161 Tile* tile = key_tile_pair.second.get(); |
| 162 tile->set_required_for_activation(IsTileRequiredForActivation(tile)); | |
| 163 tile->set_required_for_draw(IsTileRequiredForDraw(tile)); | |
| 164 } | |
| 162 } | 165 } |
| 163 std::map<const Tile*, PrioritizedTile> | 166 std::map<const Tile*, PrioritizedTile> |
| 164 UpdateAndGetAllPrioritizedTilesForTesting() const; | 167 UpdateAndGetAllPrioritizedTilesForTesting() const; |
| 165 | 168 |
| 166 void SetAllTilesOccludedForTesting() { | 169 void SetAllTilesOccludedForTesting() { |
| 167 gfx::Rect viewport_in_layer_space = | 170 gfx::Rect viewport_in_layer_space = |
| 168 ScaleToEnclosingRect(current_visible_rect_, 1.f / contents_scale_); | 171 ScaleToEnclosingRect(current_visible_rect_, 1.f / contents_scale_); |
| 169 current_occlusion_in_layer_space_ = | 172 current_occlusion_in_layer_space_ = |
| 170 Occlusion(gfx::Transform(), | 173 Occlusion(gfx::Transform(), |
| 171 SimpleEnclosedRegion(viewport_in_layer_space), | 174 SimpleEnclosedRegion(viewport_in_layer_space), |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 281 const gfx::Rect& visible_rect_in_content_space, | 284 const gfx::Rect& visible_rect_in_content_space, |
| 282 const gfx::Rect& skewport, | 285 const gfx::Rect& skewport, |
| 283 const gfx::Rect& soon_border_rect, | 286 const gfx::Rect& soon_border_rect, |
| 284 const gfx::Rect& eventually_rect, | 287 const gfx::Rect& eventually_rect, |
| 285 const Occlusion& occlusion_in_layer_space); | 288 const Occlusion& occlusion_in_layer_space); |
| 286 | 289 |
| 287 bool IsTileOccludedOnCurrentTree(const Tile* tile) const; | 290 bool IsTileOccludedOnCurrentTree(const Tile* tile) const; |
| 288 Tile::CreateInfo CreateInfoForTile(int i, int j) const; | 291 Tile::CreateInfo CreateInfoForTile(int i, int j) const; |
| 289 bool ShouldCreateTileAt(const Tile::CreateInfo& info) const; | 292 bool ShouldCreateTileAt(const Tile::CreateInfo& info) const; |
| 290 bool IsTileOccluded(const Tile* tile) const; | 293 bool IsTileOccluded(const Tile* tile) const; |
| 291 void UpdateRequiredStatesOnTile(Tile* tile) const; | 294 void UpdateRequiredStatesOnTile(Tile* tile) const; |
|
danakj
2017/01/30 16:55:18
remove this
vmpstr
2017/01/30 19:38:20
Done.
| |
| 292 PrioritizedTile MakePrioritizedTile( | 295 PrioritizedTile MakePrioritizedTile( |
| 293 Tile* tile, | 296 Tile* tile, |
| 294 PriorityRectType priority_rect_type) const; | 297 PriorityRectType priority_rect_type) const; |
| 295 TilePriority ComputePriorityForTile( | 298 TilePriority ComputePriorityForTile( |
| 296 const Tile* tile, | 299 const Tile* tile, |
| 297 PriorityRectType priority_rect_type) const; | 300 PriorityRectType priority_rect_type) const; |
| 298 PriorityRectType ComputePriorityRectTypeForTile(const Tile* tile) const; | 301 PriorityRectType ComputePriorityRectTypeForTile(const Tile* tile) const; |
| 299 bool has_visible_rect_tiles() const { return has_visible_rect_tiles_; } | 302 bool has_visible_rect_tiles() const { return has_visible_rect_tiles_; } |
| 300 bool has_skewport_rect_tiles() const { return has_skewport_rect_tiles_; } | 303 bool has_skewport_rect_tiles() const { return has_skewport_rect_tiles_; } |
| 301 bool has_soon_border_rect_tiles() const { | 304 bool has_soon_border_rect_tiles() const { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 358 bool has_eventually_rect_tiles_ = false; | 361 bool has_eventually_rect_tiles_ = false; |
| 359 bool all_tiles_done_ = true; | 362 bool all_tiles_done_ = true; |
| 360 | 363 |
| 361 private: | 364 private: |
| 362 DISALLOW_COPY_AND_ASSIGN(PictureLayerTiling); | 365 DISALLOW_COPY_AND_ASSIGN(PictureLayerTiling); |
| 363 }; | 366 }; |
| 364 | 367 |
| 365 } // namespace cc | 368 } // namespace cc |
| 366 | 369 |
| 367 #endif // CC_TILES_PICTURE_LAYER_TILING_H_ | 370 #endif // CC_TILES_PICTURE_LAYER_TILING_H_ |
| OLD | NEW |