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

Side by Side Diff: cc/test/fake_picture_layer.h

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/test/fake_painted_scrollbar_layer.cc ('k') | cc/test/fake_picture_layer.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 #ifndef CC_TEST_FAKE_PICTURE_LAYER_H_ 5 #ifndef CC_TEST_FAKE_PICTURE_LAYER_H_
6 #define CC_TEST_FAKE_PICTURE_LAYER_H_ 6 #define CC_TEST_FAKE_PICTURE_LAYER_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "cc/layers/picture_layer.h" 10 #include "cc/layers/picture_layer.h"
11 #include "cc/playback/recording_source.h" 11 #include "cc/playback/recording_source.h"
12 12
13 namespace cc { 13 namespace cc {
14 class FakePictureLayer : public PictureLayer { 14 class FakePictureLayer : public PictureLayer {
15 public: 15 public:
16 static scoped_refptr<FakePictureLayer> Create(ContentLayerClient* client) { 16 static scoped_refptr<FakePictureLayer> Create(const LayerSettings& settings,
17 return make_scoped_refptr(new FakePictureLayer(client)); 17 ContentLayerClient* client) {
18 return make_scoped_refptr(new FakePictureLayer(settings, client));
18 } 19 }
19 20
20 static scoped_refptr<FakePictureLayer> CreateWithRecordingSource( 21 static scoped_refptr<FakePictureLayer> CreateWithRecordingSource(
22 const LayerSettings& settings,
21 ContentLayerClient* client, 23 ContentLayerClient* client,
22 scoped_ptr<RecordingSource> source) { 24 scoped_ptr<RecordingSource> source) {
23 return make_scoped_refptr(new FakePictureLayer(client, source.Pass())); 25 return make_scoped_refptr(
26 new FakePictureLayer(settings, client, source.Pass()));
24 } 27 }
25 28
26 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; 29 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
27 30
28 size_t update_count() const { return update_count_; } 31 size_t update_count() const { return update_count_; }
29 void reset_update_count() { update_count_ = 0; } 32 void reset_update_count() { update_count_ = 0; }
30 33
31 size_t push_properties_count() const { return push_properties_count_; } 34 size_t push_properties_count() const { return push_properties_count_; }
32 void reset_push_properties_count() { push_properties_count_ = 0; } 35 void reset_push_properties_count() { push_properties_count_ = 0; }
33 36
34 void set_always_update_resources(bool always_update_resources) { 37 void set_always_update_resources(bool always_update_resources) {
35 always_update_resources_ = always_update_resources; 38 always_update_resources_ = always_update_resources;
36 } 39 }
37 40
38 void disable_lcd_text() { disable_lcd_text_ = true; } 41 void disable_lcd_text() { disable_lcd_text_ = true; }
39 42
40 bool Update(ResourceUpdateQueue* queue, 43 bool Update(ResourceUpdateQueue* queue,
41 const OcclusionTracker<Layer>* occlusion) override; 44 const OcclusionTracker<Layer>* occlusion) override;
42 45
43 void PushPropertiesTo(LayerImpl* layer) override; 46 void PushPropertiesTo(LayerImpl* layer) override;
44 47
45 void OnOutputSurfaceCreated() override; 48 void OnOutputSurfaceCreated() override;
46 size_t output_surface_created_count() const { 49 size_t output_surface_created_count() const {
47 return output_surface_created_count_; 50 return output_surface_created_count_;
48 } 51 }
49 52
50 private: 53 private:
51 explicit FakePictureLayer(ContentLayerClient* client); 54 FakePictureLayer(const LayerSettings& settings, ContentLayerClient* client);
52 FakePictureLayer(ContentLayerClient* client, 55 FakePictureLayer(const LayerSettings& settings,
56 ContentLayerClient* client,
53 scoped_ptr<RecordingSource> source); 57 scoped_ptr<RecordingSource> source);
54 ~FakePictureLayer() override; 58 ~FakePictureLayer() override;
55 59
56 size_t update_count_; 60 size_t update_count_;
57 size_t push_properties_count_; 61 size_t push_properties_count_;
58 size_t output_surface_created_count_; 62 size_t output_surface_created_count_;
59 bool always_update_resources_; 63 bool always_update_resources_;
60 bool disable_lcd_text_; 64 bool disable_lcd_text_;
61 }; 65 };
62 66
63 } // namespace cc 67 } // namespace cc
64 68
65 #endif // CC_TEST_FAKE_PICTURE_LAYER_H_ 69 #endif // CC_TEST_FAKE_PICTURE_LAYER_H_
OLDNEW
« no previous file with comments | « cc/test/fake_painted_scrollbar_layer.cc ('k') | cc/test/fake_picture_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698