| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "cc/base/invalidation_region.h" | 9 #include "cc/base/invalidation_region.h" |
| 10 #include "cc/debug/devtools_instrumentation.h" | 10 #include "cc/debug/devtools_instrumentation.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 bool nearest_neighbor() const { | 27 bool nearest_neighbor() const { |
| 28 return picture_layer_inputs_.nearest_neighbor; | 28 return picture_layer_inputs_.nearest_neighbor; |
| 29 } | 29 } |
| 30 | 30 |
| 31 // Layer interface. | 31 // Layer interface. |
| 32 std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; | 32 std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
| 33 void SetLayerTreeHost(LayerTreeHost* host) override; | 33 void SetLayerTreeHost(LayerTreeHost* host) override; |
| 34 void PushPropertiesTo(LayerImpl* layer) override; | 34 void PushPropertiesTo(LayerImpl* layer) override; |
| 35 void SetNeedsDisplayRect(const gfx::Rect& layer_rect) override; | 35 void SetNeedsDisplayRect(const gfx::Rect& layer_rect) override; |
| 36 bool Update() override; | 36 bool Update() override; |
| 37 void SetLayerMaskType(Layer::LayerMaskType mask_type) override; | 37 void SetLayerMaskType(LayerMaskType mask_type) override; |
| 38 sk_sp<SkPicture> GetPicture() const override; | 38 sk_sp<SkPicture> GetPicture() const override; |
| 39 | 39 |
| 40 bool IsSuitableForGpuRasterization() const override; | 40 bool IsSuitableForGpuRasterization() const override; |
| 41 | 41 |
| 42 void RunMicroBenchmark(MicroBenchmark* benchmark) override; | 42 void RunMicroBenchmark(MicroBenchmark* benchmark) override; |
| 43 | 43 |
| 44 ContentLayerClient* client() { return picture_layer_inputs_.client; } | 44 ContentLayerClient* client() { return picture_layer_inputs_.client; } |
| 45 | 45 |
| 46 RecordingSource* GetRecordingSourceForTesting() { | 46 RecordingSource* GetRecordingSourceForTesting() { |
| 47 return recording_source_.get(); | 47 return recording_source_.get(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 explicit PictureLayer(ContentLayerClient* client); | 65 explicit PictureLayer(ContentLayerClient* client); |
| 66 // Allow tests to inject a recording source. | 66 // Allow tests to inject a recording source. |
| 67 PictureLayer(ContentLayerClient* client, | 67 PictureLayer(ContentLayerClient* client, |
| 68 std::unique_ptr<RecordingSource> source); | 68 std::unique_ptr<RecordingSource> source); |
| 69 ~PictureLayer() override; | 69 ~PictureLayer() override; |
| 70 | 70 |
| 71 bool HasDrawableContent() const override; | 71 bool HasDrawableContent() const override; |
| 72 | 72 |
| 73 Layer::LayerMaskType mask_type() { return mask_type_; } | 73 LayerMaskType mask_type() { return mask_type_; } |
| 74 | 74 |
| 75 PictureLayerInputs picture_layer_inputs_; | 75 PictureLayerInputs picture_layer_inputs_; |
| 76 | 76 |
| 77 private: | 77 private: |
| 78 friend class TestSerializationPictureLayer; | 78 friend class TestSerializationPictureLayer; |
| 79 | 79 |
| 80 void DropRecordingSourceContentIfInvalid(); | 80 void DropRecordingSourceContentIfInvalid(); |
| 81 | 81 |
| 82 std::unique_ptr<RecordingSource> recording_source_; | 82 std::unique_ptr<RecordingSource> recording_source_; |
| 83 devtools_instrumentation:: | 83 devtools_instrumentation:: |
| 84 ScopedLayerObjectTracker instrumentation_object_tracker_; | 84 ScopedLayerObjectTracker instrumentation_object_tracker_; |
| 85 | 85 |
| 86 Region last_updated_invalidation_; | 86 Region last_updated_invalidation_; |
| 87 | 87 |
| 88 int update_source_frame_number_; | 88 int update_source_frame_number_; |
| 89 Layer::LayerMaskType mask_type_; | 89 LayerMaskType mask_type_; |
| 90 | 90 |
| 91 DISALLOW_COPY_AND_ASSIGN(PictureLayer); | 91 DISALLOW_COPY_AND_ASSIGN(PictureLayer); |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 } // namespace cc | 94 } // namespace cc |
| 95 | 95 |
| 96 #endif // CC_LAYERS_PICTURE_LAYER_H_ | 96 #endif // CC_LAYERS_PICTURE_LAYER_H_ |
| OLD | NEW |