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

Unified Diff: cc/layers/surface_layer.h

Issue 666163006: Allow layers to signal that additional sequences are needed before surface destruction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 0b886ebe2c98c780f70db2b1cbd2ce3aac426e1e..6dd55b1f94a9a9451c22c7ac97037a7409058488 100644
--- a/cc/layers/surface_layer.h
+++ b/cc/layers/surface_layer.h
@@ -8,29 +8,48 @@
#include "cc/base/cc_export.h"
#include "cc/layers/layer.h"
#include "cc/surfaces/surface_id.h"
+#include "cc/surfaces/surface_sequence.h"
namespace cc {
+class SatisfySwapPromise;
// A layer that renders a surface referencing the output of another compositor
// instance or client.
class CC_EXPORT SurfaceLayer : public Layer {
public:
- static scoped_refptr<SurfaceLayer> Create();
+ // This callback is run when a SurfaceSequence needs to be satisfied, but
+ // the parent compositor is unable to. It can be called on either the main
+ // or impl threads.
+ using SatisfyCallback = base::Callback<void(SurfaceSequence)>;
+
+ // This callback is run to require that a specific SurfaceSequence is
+ // received before a SurfaceId is destroyed.
+ using RequireCallback = base::Callback<void(SurfaceId, SurfaceSequence)>;
+
+ static scoped_refptr<SurfaceLayer> Create(SatisfyCallback satisfy_callback,
+ RequireCallback require_callback);
void SetSurfaceId(SurfaceId surface_id);
// Layer overrides.
scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
+ void SetLayerTreeHost(LayerTreeHost* host) override;
void PushPropertiesTo(LayerImpl* layer) override;
protected:
- SurfaceLayer();
+ SurfaceLayer(SatisfyCallback satisfy_callback,
+ RequireCallback require_callback);
bool HasDrawableContent() const override;
private:
~SurfaceLayer() override;
+ void CreateNewDestroySequence();
+ void SatisfyDestroySequence();
SurfaceId surface_id_;
+ SurfaceSequence destroy_sequence_;
+ SatisfyCallback satisfy_callback_;
+ RequireCallback require_callback_;
DISALLOW_COPY_AND_ASSIGN(SurfaceLayer);
};
« no previous file with comments | « cc/cc_tests.gyp ('k') | cc/layers/surface_layer.cc » ('j') | cc/layers/surface_layer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698