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

Unified Diff: cc/layers/picture_layer.h

Issue 2141233002: cc: Clean up RecordingSource API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove recoding_source_ from PictureLayer, and move all its internal state to PictureLayer Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/layers/picture_layer.cc » ('j') | cc/layers/picture_layer.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « no previous file | cc/layers/picture_layer.cc » ('j') | cc/layers/picture_layer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698