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

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

Issue 1122393003: CC: Plumb LayerSettings parameter for cc::Layer construction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 7 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_layer.h ('k') | cc/layers/picture_layer_impl_unittest.cc » ('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 "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"
11 #include "cc/playback/picture_pile.h" 11 #include "cc/playback/picture_pile.h"
12 #include "cc/trees/layer_tree_host.h" 12 #include "cc/trees/layer_tree_host.h"
13 #include "cc/trees/layer_tree_impl.h" 13 #include "cc/trees/layer_tree_impl.h"
14 #include "third_party/skia/include/core/SkPictureRecorder.h" 14 #include "third_party/skia/include/core/SkPictureRecorder.h"
15 #include "ui/gfx/geometry/rect_conversions.h" 15 #include "ui/gfx/geometry/rect_conversions.h"
16 16
17 namespace cc { 17 namespace cc {
18 18
19 scoped_refptr<PictureLayer> PictureLayer::Create(ContentLayerClient* client) { 19 scoped_refptr<PictureLayer> PictureLayer::Create(const LayerSettings& settings,
20 return make_scoped_refptr(new PictureLayer(client)); 20 ContentLayerClient* client) {
21 return make_scoped_refptr(new PictureLayer(settings, client));
21 } 22 }
22 23
23 PictureLayer::PictureLayer(ContentLayerClient* client) 24 PictureLayer::PictureLayer(const LayerSettings& settings,
24 : client_(client), 25 ContentLayerClient* client)
26 : Layer(settings),
27 client_(client),
25 instrumentation_object_tracker_(id()), 28 instrumentation_object_tracker_(id()),
26 update_source_frame_number_(-1), 29 update_source_frame_number_(-1),
27 is_mask_(false), 30 is_mask_(false),
28 nearest_neighbor_(false) { 31 nearest_neighbor_(false) {
29 } 32 }
30 33
31 PictureLayer::PictureLayer(ContentLayerClient* client, 34 PictureLayer::PictureLayer(const LayerSettings& settings,
35 ContentLayerClient* client,
32 scoped_ptr<RecordingSource> source) 36 scoped_ptr<RecordingSource> source)
33 : PictureLayer(client) { 37 : PictureLayer(settings, client) {
34 recording_source_ = source.Pass(); 38 recording_source_ = source.Pass();
35 } 39 }
36 40
37 PictureLayer::~PictureLayer() { 41 PictureLayer::~PictureLayer() {
38 } 42 }
39 43
40 scoped_ptr<LayerImpl> PictureLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) { 44 scoped_ptr<LayerImpl> PictureLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) {
41 return PictureLayerImpl::Create(tree_impl, id(), is_mask_, 45 return PictureLayerImpl::Create(tree_impl, id(), is_mask_,
42 new LayerImpl::SyncedScrollOffset); 46 new LayerImpl::SyncedScrollOffset);
43 } 47 }
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 235
232 bool PictureLayer::HasDrawableContent() const { 236 bool PictureLayer::HasDrawableContent() const {
233 return client_ && Layer::HasDrawableContent(); 237 return client_ && Layer::HasDrawableContent();
234 } 238 }
235 239
236 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { 240 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) {
237 benchmark->RunOnLayer(this); 241 benchmark->RunOnLayer(this);
238 } 242 }
239 243
240 } // namespace cc 244 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer.h ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698