Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: cc/layers/picture_layer.cc

Issue 1736073002: cc: Move SyncedScrollOffset to scroll tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve comments Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 28 matching lines...) Expand all
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); 49 new SyncedScrollOffset);
50 } 50 }
51 51
52 void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) { 52 void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) {
53 Layer::PushPropertiesTo(base_layer); 53 Layer::PushPropertiesTo(base_layer);
54 TRACE_EVENT0("cc", "PictureLayer::PushPropertiesTo"); 54 TRACE_EVENT0("cc", "PictureLayer::PushPropertiesTo");
55 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer); 55 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer);
56 // TODO(danakj): Make is_mask_ a constructor parameter for PictureLayer. 56 // TODO(danakj): Make is_mask_ a constructor parameter for PictureLayer.
57 DCHECK_EQ(layer_impl->is_mask(), is_mask_); 57 DCHECK_EQ(layer_impl->is_mask(), is_mask_);
58 DropRecordingSourceContentIfInvalid(); 58 DropRecordingSourceContentIfInvalid();
59 59
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 if (update_source_frame_number_ != source_frame_number && 255 if (update_source_frame_number_ != source_frame_number &&
256 recording_source_bounds != layer_bounds) { 256 recording_source_bounds != layer_bounds) {
257 // Update may not get called for the layer (if it's not in the viewport 257 // 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 258 // for example), even though it has resized making the recording source no
259 // longer valid. In this case just destroy the recording source. 259 // longer valid. In this case just destroy the recording source.
260 recording_source_->SetEmptyBounds(); 260 recording_source_->SetEmptyBounds();
261 } 261 }
262 } 262 }
263 263
264 } // namespace cc 264 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698