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 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
727 previous_visible_rect_ = visible_content_rect(); | 727 previous_visible_rect_ = visible_content_rect(); |
728 } | 728 } |
729 | 729 |
730 bool TiledLayer::Update(ResourceUpdateQueue* queue, | 730 bool TiledLayer::Update(ResourceUpdateQueue* queue, |
731 const OcclusionTracker* occlusion) { | 731 const OcclusionTracker* occlusion) { |
732 DCHECK(!skips_draw_ && !failed_update_); // Did ResetUpdateState get skipped? | 732 DCHECK(!skips_draw_ && !failed_update_); // Did ResetUpdateState get skipped? |
733 { | 733 { |
734 base::AutoReset<bool> ignore_set_needs_commit(&ignore_set_needs_commit_, | 734 base::AutoReset<bool> ignore_set_needs_commit(&ignore_set_needs_commit_, |
735 true); | 735 true); |
736 | 736 |
737 ContentsScalingLayer::Update(queue, occlusion); | 737 bool contents_scaling_layer_updated = |
738 ContentsScalingLayer::Update(queue, occlusion); | |
739 DCHECK(!contents_scaling_layer_updated) << | |
740 "If this is true, then any return value below would need to " << | |
741 "return true."; | |
738 UpdateBounds(); | 742 UpdateBounds(); |
739 } | 743 } |
740 | 744 |
741 if (tiler_->has_empty_bounds() || !DrawsContent()) | 745 if (tiler_->has_empty_bounds() || !DrawsContent()) |
742 return false; | 746 return false; |
743 | 747 |
744 bool did_paint = false; | 748 bool did_paint = false; |
enne (OOO)
2013/08/02 22:04:55
I think you could just initialize did_paint to con
danakj
2013/08/02 22:11:27
Ah true, I think I'd like to rename this var to "u
enne (OOO)
2013/08/02 22:13:21
sgtm!
| |
745 | 749 |
746 // Animation pre-paint. If the layer is small, try to paint it all | 750 // Animation pre-paint. If the layer is small, try to paint it all |
747 // immediately whether or not it is occluded, to avoid paint/upload | 751 // immediately whether or not it is occluded, to avoid paint/upload |
748 // hiccups while it is animating. | 752 // hiccups while it is animating. |
749 if (IsSmallAnimatedLayer()) { | 753 if (IsSmallAnimatedLayer()) { |
750 int left, top, right, bottom; | 754 int left, top, right, bottom; |
751 tiler_->ContentRectToTileIndices(gfx::Rect(content_bounds()), | 755 tiler_->ContentRectToTileIndices(gfx::Rect(content_bounds()), |
752 &left, | 756 &left, |
753 &top, | 757 &top, |
754 &right, | 758 &right, |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
891 gfx::Rect prepaint_rect = visible_content_rect(); | 895 gfx::Rect prepaint_rect = visible_content_rect(); |
892 prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns, | 896 prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns, |
893 -tiler_->tile_size().height() * kPrepaintRows); | 897 -tiler_->tile_size().height() * kPrepaintRows); |
894 gfx::Rect content_rect(content_bounds()); | 898 gfx::Rect content_rect(content_bounds()); |
895 prepaint_rect.Intersect(content_rect); | 899 prepaint_rect.Intersect(content_rect); |
896 | 900 |
897 return prepaint_rect; | 901 return prepaint_rect; |
898 } | 902 } |
899 | 903 |
900 } // namespace cc | 904 } // namespace cc |
OLD | NEW |