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