OLD | NEW |
---|---|
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_LAYERS_PICTURE_LAYER_H_ | 5 #ifndef CC_LAYERS_PICTURE_LAYER_H_ |
6 #define CC_LAYERS_PICTURE_LAYER_H_ | 6 #define CC_LAYERS_PICTURE_LAYER_H_ |
7 | 7 |
8 #include "cc/base/invalidation_region.h" | 8 #include "cc/base/invalidation_region.h" |
9 #include "cc/debug/devtools_instrumentation.h" | 9 #include "cc/debug/devtools_instrumentation.h" |
10 #include "cc/debug/micro_benchmark_controller.h" | 10 #include "cc/debug/micro_benchmark_controller.h" |
11 #include "cc/layers/layer.h" | 11 #include "cc/layers/layer.h" |
12 | 12 |
13 namespace cc { | 13 namespace cc { |
14 | 14 |
15 class ContentLayerClient; | 15 class ContentLayerClient; |
16 class DisplayListRecordingSource; | 16 class DisplayListRecordingSource; |
17 class ResourceUpdateQueue; | 17 class ResourceUpdateQueue; |
18 class TestSerializationPictureLayer; | |
vmpstr
2015/12/16 04:21:08
Does the friend declaration below act as a forward
David Trainor- moved to gerrit
2015/12/16 19:10:58
Done.
| |
18 | 19 |
19 class CC_EXPORT PictureLayer : public Layer { | 20 class CC_EXPORT PictureLayer : public Layer { |
20 public: | 21 public: |
21 static scoped_refptr<PictureLayer> Create(const LayerSettings& settings, | 22 static scoped_refptr<PictureLayer> Create(const LayerSettings& settings, |
22 ContentLayerClient* client); | 23 ContentLayerClient* client); |
23 | 24 |
24 void ClearClient(); | 25 void ClearClient(); |
25 | 26 |
26 void SetNearestNeighbor(bool nearest_neighbor); | 27 void SetNearestNeighbor(bool nearest_neighbor); |
27 | 28 |
(...skipping 17 matching lines...) Expand all Loading... | |
45 | 46 |
46 protected: | 47 protected: |
47 PictureLayer(const LayerSettings& settings, ContentLayerClient* client); | 48 PictureLayer(const LayerSettings& settings, ContentLayerClient* client); |
48 // Allow tests to inject a recording source. | 49 // Allow tests to inject a recording source. |
49 PictureLayer(const LayerSettings& settings, | 50 PictureLayer(const LayerSettings& settings, |
50 ContentLayerClient* client, | 51 ContentLayerClient* client, |
51 scoped_ptr<DisplayListRecordingSource> source); | 52 scoped_ptr<DisplayListRecordingSource> source); |
52 ~PictureLayer() override; | 53 ~PictureLayer() override; |
53 | 54 |
54 bool HasDrawableContent() const override; | 55 bool HasDrawableContent() const override; |
56 void LayerSpecificPropertiesToProto(proto::LayerProperties* proto) override; | |
57 void FromLayerSpecificPropertiesProto( | |
58 const proto::LayerProperties& proto) override; | |
55 | 59 |
56 bool is_mask() const { return is_mask_; } | 60 bool is_mask() const { return is_mask_; } |
57 | 61 |
58 private: | 62 private: |
63 friend class TestSerializationPictureLayer; | |
64 | |
65 void ValidateRecordingSource(); | |
66 | |
59 ContentLayerClient* client_; | 67 ContentLayerClient* client_; |
60 scoped_ptr<DisplayListRecordingSource> recording_source_; | 68 scoped_ptr<DisplayListRecordingSource> recording_source_; |
61 devtools_instrumentation:: | 69 devtools_instrumentation:: |
62 ScopedLayerObjectTracker instrumentation_object_tracker_; | 70 ScopedLayerObjectTracker instrumentation_object_tracker_; |
63 | 71 |
64 // Invalidation to use the next time update is called. | 72 // Invalidation to use the next time update is called. |
65 InvalidationRegion invalidation_; | 73 InvalidationRegion invalidation_; |
66 | 74 |
67 gfx::Rect last_updated_visible_layer_rect_; | 75 gfx::Rect last_updated_visible_layer_rect_; |
68 | 76 |
69 int update_source_frame_number_; | 77 int update_source_frame_number_; |
70 bool is_mask_; | 78 bool is_mask_; |
71 bool nearest_neighbor_; | 79 bool nearest_neighbor_; |
72 | 80 |
73 DISALLOW_COPY_AND_ASSIGN(PictureLayer); | 81 DISALLOW_COPY_AND_ASSIGN(PictureLayer); |
74 }; | 82 }; |
75 | 83 |
76 } // namespace cc | 84 } // namespace cc |
77 | 85 |
78 #endif // CC_LAYERS_PICTURE_LAYER_H_ | 86 #endif // CC_LAYERS_PICTURE_LAYER_H_ |
OLD | NEW |