| 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 |
| 238 PrioritizedResourceManager* TiledLayer::ResourceManager() { | 240 PrioritizedResourceManager* TiledLayer::ResourceManager() { |
| 239 if (!layer_tree_host()) | 241 if (!layer_tree_host()) |
| 240 return NULL; | 242 return NULL; |
| 241 return layer_tree_host()->contents_texture_manager(); | 243 return layer_tree_host()->contents_texture_manager(); |
| 242 } | 244 } |
| 243 | 245 |
| 244 const PrioritizedResource* TiledLayer::ResourceAtForTesting(int i, | 246 const PrioritizedResource* TiledLayer::ResourceAtForTesting(int i, |
| 245 int j) const { | 247 int j) const { |
| 246 UpdatableTile* tile = TileAt(i, j); | 248 UpdatableTile* tile = TileAt(i, j); |
| 247 if (!tile) | 249 if (!tile) |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 predicted_visible_rect_.Intersect(bound); | 724 predicted_visible_rect_.Intersect(bound); |
| 723 } | 725 } |
| 724 previous_content_bounds_ = content_bounds(); | 726 previous_content_bounds_ = content_bounds(); |
| 725 previous_visible_rect_ = visible_content_rect(); | 727 previous_visible_rect_ = visible_content_rect(); |
| 726 } | 728 } |
| 727 | 729 |
| 728 bool TiledLayer::Update(ResourceUpdateQueue* queue, | 730 bool TiledLayer::Update(ResourceUpdateQueue* queue, |
| 729 const OcclusionTracker* occlusion) { | 731 const OcclusionTracker* occlusion) { |
| 730 DCHECK(!skips_draw_ && !failed_update_); // Did ResetUpdateState get skipped? | 732 DCHECK(!skips_draw_ && !failed_update_); // Did ResetUpdateState get skipped? |
| 731 | 733 |
| 732 // Tiled layer always causes commits to wait for activation, as it does | |
| 733 // not support pending trees. | |
| 734 SetNextCommitWaitsForActivation(); | |
| 735 | |
| 736 bool updated = false; | 734 bool updated = false; |
| 737 | 735 |
| 738 { | 736 { |
| 739 base::AutoReset<bool> ignore_set_needs_commit(&ignore_set_needs_commit_, | 737 base::AutoReset<bool> ignore_set_needs_commit(&ignore_set_needs_commit_, |
| 740 true); | 738 true); |
| 741 | 739 |
| 742 updated |= ContentsScalingLayer::Update(queue, occlusion); | 740 updated |= ContentsScalingLayer::Update(queue, occlusion); |
| 743 UpdateBounds(); | 741 UpdateBounds(); |
| 744 } | 742 } |
| 745 | 743 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 894 gfx::Rect prepaint_rect = visible_content_rect(); | 892 gfx::Rect prepaint_rect = visible_content_rect(); |
| 895 prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns, | 893 prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns, |
| 896 -tiler_->tile_size().height() * kPrepaintRows); | 894 -tiler_->tile_size().height() * kPrepaintRows); |
| 897 gfx::Rect content_rect(content_bounds()); | 895 gfx::Rect content_rect(content_bounds()); |
| 898 prepaint_rect.Intersect(content_rect); | 896 prepaint_rect.Intersect(content_rect); |
| 899 | 897 |
| 900 return prepaint_rect; | 898 return prepaint_rect; |
| 901 } | 899 } |
| 902 | 900 |
| 903 } // namespace cc | 901 } // namespace cc |
| OLD | NEW |