OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/picture_layer.h" | 5 #include "cc/layers/picture_layer.h" |
6 | 6 |
7 #include "cc/debug/devtools_instrumentation.h" | 7 #include "cc/debug/devtools_instrumentation.h" |
8 #include "cc/layers/picture_layer_impl.h" | 8 #include "cc/layers/picture_layer_impl.h" |
9 #include "cc/trees/layer_tree_impl.h" | 9 #include "cc/trees/layer_tree_impl.h" |
10 #include "ui/gfx/rect_conversions.h" | 10 #include "ui/gfx/rect_conversions.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 } | 68 } |
69 Layer::SetNeedsDisplayRect(layer_rect); | 69 Layer::SetNeedsDisplayRect(layer_rect); |
70 } | 70 } |
71 | 71 |
72 void PictureLayer::Update(ResourceUpdateQueue*, | 72 void PictureLayer::Update(ResourceUpdateQueue*, |
73 const OcclusionTracker*, | 73 const OcclusionTracker*, |
74 RenderingStats* stats) { | 74 RenderingStats* stats) { |
75 // Do not early-out of this function so that PicturePile::Update has a chance | 75 // Do not early-out of this function so that PicturePile::Update has a chance |
76 // to record pictures due to changing visibility of this layer. | 76 // to record pictures due to changing visibility of this layer. |
77 | 77 |
78 pile_->Resize(bounds()); | 78 pile_->Resize(paint_properties().bounds); |
79 | 79 |
80 // Calling paint in WebKit can sometimes cause invalidations, so save | 80 // Calling paint in WebKit can sometimes cause invalidations, so save |
81 // off the invalidation prior to calling update. | 81 // off the invalidation prior to calling update. |
82 pile_invalidation_.Swap(&pending_invalidation_); | 82 pile_invalidation_.Swap(&pending_invalidation_); |
83 pending_invalidation_.Clear(); | 83 pending_invalidation_.Clear(); |
84 | 84 |
85 gfx::Rect visible_layer_rect = gfx::ToEnclosingRect( | 85 gfx::Rect visible_layer_rect = gfx::ToEnclosingRect( |
86 gfx::ScaleRect(visible_content_rect(), 1.f / contents_scale_x())); | 86 gfx::ScaleRect(visible_content_rect(), 1.f / contents_scale_x())); |
87 devtools_instrumentation::ScopedPaintLayer paint_layer(id()); | 87 devtools_instrumentation::ScopedPaintLayer paint_layer(id()); |
88 pile_->Update(client_, | 88 pile_->Update(client_, |
89 background_color(), | 89 background_color(), |
90 pile_invalidation_, | 90 pile_invalidation_, |
91 visible_layer_rect, | 91 visible_layer_rect, |
92 stats); | 92 stats); |
93 } | 93 } |
94 | 94 |
95 void PictureLayer::SetIsMask(bool is_mask) { | 95 void PictureLayer::SetIsMask(bool is_mask) { |
96 is_mask_ = is_mask; | 96 is_mask_ = is_mask; |
97 } | 97 } |
98 | 98 |
99 } // namespace cc | 99 } // namespace cc |
OLD | NEW |