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

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: Rebase and add comment 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
« no previous file with comments | « cc/layers/picture_image_layer_impl.cc ('k') | cc/layers/picture_layer_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 27 matching lines...) Expand all
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
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
OLDNEW
« no previous file with comments | « cc/layers/picture_image_layer_impl.cc ('k') | cc/layers/picture_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698