Chromium Code Reviews| Index: cc/layers/picture_layer.h |
| diff --git a/cc/layers/picture_layer.h b/cc/layers/picture_layer.h |
| index 447a936be981de3302a485e4d2ff0f2ec9a73db0..b27ddacc81bc103b050ef62280e774e441f73a08 100644 |
| --- a/cc/layers/picture_layer.h |
| +++ b/cc/layers/picture_layer.h |
| @@ -10,6 +10,7 @@ |
| #include "cc/debug/devtools_instrumentation.h" |
| #include "cc/debug/micro_benchmark_controller.h" |
| #include "cc/layers/layer.h" |
| +#include "cc/playback/recording_source.h" |
| namespace cc { |
| @@ -39,15 +40,29 @@ class CC_EXPORT PictureLayer : public Layer { |
| ContentLayerClient* client() { return inputs_.client; } |
| - RecordingSource* GetRecordingSourceForTesting() { |
| - return recording_source_.get(); |
| - } |
| + bool UpdateAndExpandInvalidation( |
| + Region* invalidation, |
| + const gfx::Size& layer_size, |
| + RecordingSource::RecordingMode recording_mode, |
| + PictureLayerData* pl_data, |
|
vmpstr
2016/07/19 23:43:22
layer_data or picture_layer_data (here and everywh
Menglin
2016/07/20 21:25:22
Done. I'm very bad at names...
|
| + ContentLayerClientData* clc_data, |
|
vmpstr
2016/07/19 23:43:22
client_data (here and everywhere)
Menglin
2016/07/20 21:25:22
Done.
|
| + InvalidationRegion* invalidation_state) const; |
| + |
| + void SetEmptyBounds(); |
|
vmpstr
2016/07/19 23:43:22
This is confusing since cc::Layer has a SetBounds
Menglin
2016/07/20 21:25:22
change it to ResetLayerAndClientData
|
| + void SetSlowdownRasterScaleFactor(int factor); |
| + void SetGenerateDiscardableImagesMetadata(bool generate_metadata); |
| + void SetBackgroundColorSimple(SkColor background_color); |
| + void SetRequiresClear(bool requires_clear); |
| + void SetNeedsDisplayRectSimple(const gfx::Rect& layer_rect); |
| + gfx::Size GetSize() const; |
|
vmpstr
2016/07/19 23:43:22
Some of these concept become ambiguous/weird when
Menglin
2016/07/20 21:25:22
removed Clear. change GetSize to GetSizeInLayerDat
|
| + const DisplayItemList* GetDisplayItemList(); |
| protected: |
| explicit PictureLayer(ContentLayerClient* client); |
| - // Allow tests to inject a recording source. |
| + // Tests will pass in data instead of a RecordingSource. |
| PictureLayer(ContentLayerClient* client, |
| - std::unique_ptr<RecordingSource> source); |
| + const PictureLayerData& pl_data, |
| + const ContentLayerClientData& clc_data); |
| ~PictureLayer() override; |
| bool HasDrawableContent() const override; |
| @@ -56,14 +71,28 @@ class CC_EXPORT PictureLayer : public Layer { |
| void FromLayerSpecificPropertiesProto( |
| const proto::LayerProperties& proto) override; |
| + void Clear(); |
| + |
| bool is_mask() const { return is_mask_; } |
| + PictureLayerData pl_data_; |
| + ContentLayerClientData clc_data_; |
| + |
| private: |
| friend class TestSerializationPictureLayer; |
| void DropRecordingSourceContentIfInvalid(); |
| - std::unique_ptr<RecordingSource> recording_source_; |
| + void UpdateInvalidationForNewViewport(const gfx::Rect& old_recorded_viewport, |
| + const gfx::Rect& new_recorded_viewport, |
| + Region* invalidation) const; |
| + |
| + void FinishDisplayItemListUpdate(PictureLayerData* pl_data, |
| + ContentLayerClientData* clc_data) const; |
| + |
| + void DetermineIfSolidColor(PictureLayerData* pl_data, |
| + ContentLayerClientData* clc_data) const; |
| + |
| devtools_instrumentation:: |
| ScopedLayerObjectTracker instrumentation_object_tracker_; |
| @@ -80,6 +109,8 @@ class CC_EXPORT PictureLayer : public Layer { |
| Inputs inputs_; |
| + InvalidationRegion invalidation_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(PictureLayer); |
| }; |