OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 #include "cc/layers/tiled_layer.h" | 5 #include "cc/layers/tiled_layer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 iter != invalid_tiles.end(); | 228 iter != invalid_tiles.end(); |
229 ++iter) | 229 ++iter) |
230 tiler_->TakeTile((*iter)->i(), (*iter)->j()); | 230 tiler_->TakeTile((*iter)->i(), (*iter)->j()); |
231 | 231 |
232 // TiledLayer must push properties every frame, since viewport state and | 232 // TiledLayer must push properties every frame, since viewport state and |
233 // occlusion from anywhere in the tree can change what the layer decides to | 233 // occlusion from anywhere in the tree can change what the layer decides to |
234 // push to the impl tree. | 234 // push to the impl tree. |
235 needs_push_properties_ = true; | 235 needs_push_properties_ = true; |
236 } | 236 } |
237 | 237 |
238 bool TiledLayer::BlocksPendingCommit() const { return true; } | |
239 | |
240 PrioritizedResourceManager* TiledLayer::ResourceManager() { | 238 PrioritizedResourceManager* TiledLayer::ResourceManager() { |
241 if (!layer_tree_host()) | 239 if (!layer_tree_host()) |
242 return NULL; | 240 return NULL; |
243 return layer_tree_host()->contents_texture_manager(); | 241 return layer_tree_host()->contents_texture_manager(); |
244 } | 242 } |
245 | 243 |
246 const PrioritizedResource* TiledLayer::ResourceAtForTesting(int i, | 244 const PrioritizedResource* TiledLayer::ResourceAtForTesting(int i, |
247 int j) const { | 245 int j) const { |
248 UpdatableTile* tile = TileAt(i, j); | 246 UpdatableTile* tile = TileAt(i, j); |
249 if (!tile) | 247 if (!tile) |
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 gfx::Rect prepaint_rect = visible_content_rect(); | 890 gfx::Rect prepaint_rect = visible_content_rect(); |
893 prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns, | 891 prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns, |
894 -tiler_->tile_size().height() * kPrepaintRows); | 892 -tiler_->tile_size().height() * kPrepaintRows); |
895 gfx::Rect content_rect(content_bounds()); | 893 gfx::Rect content_rect(content_bounds()); |
896 prepaint_rect.Intersect(content_rect); | 894 prepaint_rect.Intersect(content_rect); |
897 | 895 |
898 return prepaint_rect; | 896 return prepaint_rect; |
899 } | 897 } |
900 | 898 |
901 } // namespace cc | 899 } // namespace cc |
OLD | NEW |