| 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 "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
| 9 #include "cc/layers/content_layer_client.h" | 9 #include "cc/layers/content_layer_client.h" |
| 10 #include "cc/layers/picture_layer_impl.h" | 10 #include "cc/layers/picture_layer_impl.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 ContentLayerClient* client, | 38 ContentLayerClient* client, |
| 39 scoped_ptr<DisplayListRecordingSource> source) | 39 scoped_ptr<DisplayListRecordingSource> source) |
| 40 : PictureLayer(settings, client) { | 40 : PictureLayer(settings, client) { |
| 41 recording_source_ = std::move(source); | 41 recording_source_ = std::move(source); |
| 42 } | 42 } |
| 43 | 43 |
| 44 PictureLayer::~PictureLayer() { | 44 PictureLayer::~PictureLayer() { |
| 45 } | 45 } |
| 46 | 46 |
| 47 scoped_ptr<LayerImpl> PictureLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) { | 47 scoped_ptr<LayerImpl> PictureLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) { |
| 48 return PictureLayerImpl::Create(tree_impl, id(), is_mask_, | 48 return PictureLayerImpl::Create(tree_impl, id(), is_mask_); |
| 49 new LayerImpl::SyncedScrollOffset); | |
| 50 } | 49 } |
| 51 | 50 |
| 52 void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) { | 51 void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) { |
| 53 Layer::PushPropertiesTo(base_layer); | 52 Layer::PushPropertiesTo(base_layer); |
| 54 TRACE_EVENT0("cc", "PictureLayer::PushPropertiesTo"); | 53 TRACE_EVENT0("cc", "PictureLayer::PushPropertiesTo"); |
| 55 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer); | 54 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer); |
| 56 // TODO(danakj): Make is_mask_ a constructor parameter for PictureLayer. | 55 // TODO(danakj): Make is_mask_ a constructor parameter for PictureLayer. |
| 57 DCHECK_EQ(layer_impl->is_mask(), is_mask_); | 56 DCHECK_EQ(layer_impl->is_mask(), is_mask_); |
| 58 DropRecordingSourceContentIfInvalid(); | 57 DropRecordingSourceContentIfInvalid(); |
| 59 | 58 |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 if (update_source_frame_number_ != source_frame_number && | 254 if (update_source_frame_number_ != source_frame_number && |
| 256 recording_source_bounds != layer_bounds) { | 255 recording_source_bounds != layer_bounds) { |
| 257 // Update may not get called for the layer (if it's not in the viewport | 256 // Update may not get called for the layer (if it's not in the viewport |
| 258 // for example), even though it has resized making the recording source no | 257 // for example), even though it has resized making the recording source no |
| 259 // longer valid. In this case just destroy the recording source. | 258 // longer valid. In this case just destroy the recording source. |
| 260 recording_source_->SetEmptyBounds(); | 259 recording_source_->SetEmptyBounds(); |
| 261 } | 260 } |
| 262 } | 261 } |
| 263 | 262 |
| 264 } // namespace cc | 263 } // namespace cc |
| OLD | NEW |