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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "cc/layers/content_layer_client.h" | 8 #include "cc/layers/content_layer_client.h" |
9 #include "cc/layers/picture_layer_impl.h" | 9 #include "cc/layers/picture_layer_impl.h" |
10 #include "cc/playback/display_list_recording_source.h" | 10 #include "cc/playback/display_list_recording_source.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer); | 51 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer); |
52 // TODO(danakj): Make is_mask_ a constructor parameter for PictureLayer. | 52 // TODO(danakj): Make is_mask_ a constructor parameter for PictureLayer. |
53 DCHECK_EQ(layer_impl->is_mask(), is_mask_); | 53 DCHECK_EQ(layer_impl->is_mask(), is_mask_); |
54 | 54 |
55 int source_frame_number = layer_tree_host()->source_frame_number(); | 55 int source_frame_number = layer_tree_host()->source_frame_number(); |
56 gfx::Size impl_bounds = layer_impl->bounds(); | 56 gfx::Size impl_bounds = layer_impl->bounds(); |
57 gfx::Size recording_source_bounds = recording_source_->GetSize(); | 57 gfx::Size recording_source_bounds = recording_source_->GetSize(); |
58 | 58 |
59 // If update called, then recording source size must match bounds pushed to | 59 // If update called, then recording source size must match bounds pushed to |
60 // impl layer. | 60 // impl layer. |
61 DCHECK_IMPLIES(update_source_frame_number_ == source_frame_number, | 61 DCHECK(update_source_frame_number_ != source_frame_number || |
62 impl_bounds == recording_source_bounds) | 62 impl_bounds == recording_source_bounds) |
63 << " bounds " << impl_bounds.ToString() << " recording source " | 63 << " bounds " << impl_bounds.ToString() << " recording source " |
64 << recording_source_bounds.ToString(); | 64 << recording_source_bounds.ToString(); |
65 | 65 |
66 if (update_source_frame_number_ != source_frame_number && | 66 if (update_source_frame_number_ != source_frame_number && |
67 recording_source_bounds != impl_bounds) { | 67 recording_source_bounds != impl_bounds) { |
68 // Update may not get called for the layer (if it's not in the viewport | 68 // Update may not get called for the layer (if it's not in the viewport |
69 // for example, even though it has resized making the recording source no | 69 // for example, even though it has resized making the recording source no |
70 // longer valid. In this case just destroy the recording source. | 70 // longer valid. In this case just destroy the recording source. |
71 recording_source_->SetEmptyBounds(); | 71 recording_source_->SetEmptyBounds(); |
72 } | 72 } |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 | 229 |
230 bool PictureLayer::HasDrawableContent() const { | 230 bool PictureLayer::HasDrawableContent() const { |
231 return client_ && Layer::HasDrawableContent(); | 231 return client_ && Layer::HasDrawableContent(); |
232 } | 232 } |
233 | 233 |
234 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 234 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
235 benchmark->RunOnLayer(this); | 235 benchmark->RunOnLayer(this); |
236 } | 236 } |
237 | 237 |
238 } // namespace cc | 238 } // namespace cc |
OLD | NEW |