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

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

Issue 1944623002: CC Animation: Use ElementId to attach CC animation players. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@erasedomids
Patch Set: Created 4 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
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 <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
11 11
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "cc/layers/picture_layer.h" 13 #include "cc/layers/picture_layer.h"
14 #include "cc/playback/recording_source.h" 14 #include "cc/playback/recording_source.h"
15 15
16 namespace cc { 16 namespace cc {
17 class FakePictureLayer : public PictureLayer { 17 class FakePictureLayer : public PictureLayer {
18 public: 18 public:
19 static scoped_refptr<FakePictureLayer> Create(ContentLayerClient* client) { 19 static scoped_refptr<FakePictureLayer> Create(ContentLayerClient* client) {
20 return make_scoped_refptr(new FakePictureLayer(client)); 20 auto layer = make_scoped_refptr(new FakePictureLayer(client));
21 layer->SetElementId(NextElementId());
22 return layer;
21 } 23 }
22 24
23 static scoped_refptr<FakePictureLayer> CreateWithRecordingSource( 25 static scoped_refptr<FakePictureLayer> CreateWithRecordingSource(
24 ContentLayerClient* client, 26 ContentLayerClient* client,
25 std::unique_ptr<RecordingSource> source) { 27 std::unique_ptr<RecordingSource> source) {
26 return make_scoped_refptr(new FakePictureLayer(client, std::move(source))); 28 auto layer =
29 make_scoped_refptr(new FakePictureLayer(client, std::move(source)));
30 layer->SetElementId(NextElementId());
31 return layer;
27 } 32 }
28 33
29 std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; 34 std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
30 35
31 int update_count() const { return update_count_; } 36 int update_count() const { return update_count_; }
32 void reset_update_count() { update_count_ = 0; } 37 void reset_update_count() { update_count_ = 0; }
33 38
34 size_t push_properties_count() const { return push_properties_count_; } 39 size_t push_properties_count() const { return push_properties_count_; }
35 void reset_push_properties_count() { push_properties_count_ = 0; } 40 void reset_push_properties_count() { push_properties_count_ = 0; }
36 41
(...skipping 12 matching lines...) Expand all
49 ~FakePictureLayer() override; 54 ~FakePictureLayer() override;
50 55
51 int update_count_; 56 int update_count_;
52 size_t push_properties_count_; 57 size_t push_properties_count_;
53 bool always_update_resources_; 58 bool always_update_resources_;
54 }; 59 };
55 60
56 } // namespace cc 61 } // namespace cc
57 62
58 #endif // CC_TEST_FAKE_PICTURE_LAYER_H_ 63 #endif // CC_TEST_FAKE_PICTURE_LAYER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698