| 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 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 base::AutoReset<bool> ignore_set_needs_commit(&ignore_set_needs_commit_, | 726 base::AutoReset<bool> ignore_set_needs_commit(&ignore_set_needs_commit_, |
| 727 true); | 727 true); |
| 728 | 728 |
| 729 ContentsScalingLayer::Update(queue, occlusion, stats); | 729 ContentsScalingLayer::Update(queue, occlusion, stats); |
| 730 UpdateBounds(); | 730 UpdateBounds(); |
| 731 } | 731 } |
| 732 | 732 |
| 733 if (tiler_->has_empty_bounds() || !DrawsContent()) | 733 if (tiler_->has_empty_bounds() || !DrawsContent()) |
| 734 return; | 734 return; |
| 735 | 735 |
| 736 printf("TiledLayer::Update\n"); |
| 737 |
| 736 bool did_paint = false; | 738 bool did_paint = false; |
| 737 | 739 |
| 738 // Animation pre-paint. If the layer is small, try to paint it all | 740 // Animation pre-paint. If the layer is small, try to paint it all |
| 739 // immediately whether or not it is occluded, to avoid paint/upload | 741 // immediately whether or not it is occluded, to avoid paint/upload |
| 740 // hiccups while it is animating. | 742 // hiccups while it is animating. |
| 741 if (IsSmallAnimatedLayer()) { | 743 if (IsSmallAnimatedLayer()) { |
| 742 int left, top, right, bottom; | 744 int left, top, right, bottom; |
| 743 tiler_->ContentRectToTileIndices(gfx::Rect(content_bounds()), | 745 tiler_->ContentRectToTileIndices(gfx::Rect(content_bounds()), |
| 744 &left, | 746 &left, |
| 745 &top, | 747 &top, |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 gfx::Rect prepaint_rect = visible_content_rect(); | 884 gfx::Rect prepaint_rect = visible_content_rect(); |
| 883 prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns, | 885 prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns, |
| 884 -tiler_->tile_size().height() * kPrepaintRows); | 886 -tiler_->tile_size().height() * kPrepaintRows); |
| 885 gfx::Rect content_rect(content_bounds()); | 887 gfx::Rect content_rect(content_bounds()); |
| 886 prepaint_rect.Intersect(content_rect); | 888 prepaint_rect.Intersect(content_rect); |
| 887 | 889 |
| 888 return prepaint_rect; | 890 return prepaint_rect; |
| 889 } | 891 } |
| 890 | 892 |
| 891 } // namespace cc | 893 } // namespace cc |
| OLD | NEW |