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

Unified Diff: cc/layers/surface_layer.h

Issue 2582823002: WIP: Surface Synchronization System
Patch Set: Only create ClientSurfaceEmbedder if window is visible. Trash it otherwise. Created 3 years, 11 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
Index: cc/layers/surface_layer.h
diff --git a/cc/layers/surface_layer.h b/cc/layers/surface_layer.h
index 6b02364106417e7af217c7f5db57a76d8d5b3dd4..2f3d6f5307a3039a8ecf438650a43c3585db5838 100644
--- a/cc/layers/surface_layer.h
+++ b/cc/layers/surface_layer.h
@@ -23,6 +23,10 @@ class CC_EXPORT SurfaceLayer : public Layer {
void SetSurfaceInfo(const SurfaceInfo& surface_info);
+ // The current |surface_info_| becomes the |fallback_surface_info_| and the
+ // reference to the current fallback is removed.
+ void SwapSurfaceInfo(const SurfaceInfo& surface_info);
+
// When stretch_content_to_fill_bounds is true, the scale of the embedded
// surface is ignored and the content will be stretched to fill the bounds.
void SetStretchContentToFillBounds(bool stretch_content_to_fill_bounds);
@@ -35,7 +39,14 @@ class CC_EXPORT SurfaceLayer : public Layer {
scoped_refptr<SurfaceReferenceFactory> surface_reference_factory() const {
return ref_factory_;
}
- const SurfaceInfo& surface_info() const { return surface_info_; }
+
+ const SurfaceInfo& primary_surface_info() const {
+ return primary_surface_info_;
+ }
+
+ const SurfaceInfo& fallback_surface_info() const {
+ return fallback_surface_info_;
+ }
protected:
explicit SurfaceLayer(scoped_refptr<SurfaceReferenceFactory> ref_factory);
@@ -43,11 +54,15 @@ class CC_EXPORT SurfaceLayer : public Layer {
private:
~SurfaceLayer() override;
- void RemoveCurrentReference();
+ void RemoveReference(base::Closure reference_returner);
+
+ SurfaceInfo primary_surface_info_;
+ base::Closure primary_reference_returner_;
+
+ SurfaceInfo fallback_surface_info_;
+ base::Closure fallback_reference_returner_;
- SurfaceInfo surface_info_;
scoped_refptr<SurfaceReferenceFactory> ref_factory_;
- base::Closure reference_returner_;
bool stretch_content_to_fill_bounds_ = false;
DISALLOW_COPY_AND_ASSIGN(SurfaceLayer);

Powered by Google App Engine
This is Rietveld 408576698