Chromium Code Reviews| Index: cc/layers/surface_layer.h |
| diff --git a/cc/layers/surface_layer.h b/cc/layers/surface_layer.h |
| index a66257d1bd94f6096dee8d9a9a614f70ad0777c8..8bf9cf17573d960294cd790dd9bb2371c09a89f9 100644 |
| --- a/cc/layers/surface_layer.h |
| +++ b/cc/layers/surface_layer.h |
| @@ -8,6 +8,7 @@ |
| #include "base/macros.h" |
| #include "cc/base/cc_export.h" |
| #include "cc/layers/layer.h" |
| +#include "cc/surfaces/surface_embedding_base.h" |
| #include "cc/surfaces/surface_id.h" |
| #include "cc/surfaces/surface_sequence.h" |
| #include "ui/gfx/geometry/size.h" |
| @@ -18,52 +19,32 @@ namespace cc { |
| // instance or client. |
| class CC_EXPORT SurfaceLayer : public Layer { |
| public: |
| - // 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(const SurfaceSequence&)>; |
| + static scoped_refptr<SurfaceLayer> Create(); |
| + static scoped_refptr<SurfaceLayer> Create(SurfaceEmbeddingPtr); |
|
Fady Samuel
2016/12/07 23:29:04
TBH, I'm not a fan of this typedef.
How about jus
|
| - // This callback is run to require that a specific SurfaceSequence is |
| - // received before a SurfaceId is destroyed. |
| - using RequireCallback = |
| - base::Callback<void(const SurfaceId&, const SurfaceSequence&)>; |
| - |
| - static scoped_refptr<SurfaceLayer> Create( |
| - const SatisfyCallback& satisfy_callback, |
| - const RequireCallback& require_callback); |
| - |
| - void SetSurfaceId(const SurfaceId& surface_id, |
| - float scale, |
| - const gfx::Size& size); |
| + void SetSurfaceEmbedding(SurfaceEmbeddingPtr surface_ref); |
| // Layer overrides. |
| std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
| void SetLayerTreeHost(LayerTreeHost* host) override; |
| void PushPropertiesTo(LayerImpl* layer) override; |
| - SurfaceId surface_id() const { return surface_id_; } |
| - const gfx::Size& surface_size() const { return surface_size_; } |
| - float surface_scale() const { return surface_scale_; } |
| - |
| - const SatisfyCallback& satisfy_callback() const { return satisfy_callback_; } |
| - const RequireCallback& require_callback() const { return require_callback_; } |
| + const SurfaceEmbeddingPtr& surface_emb() const { return surface_emb_; } |
|
Fady Samuel
2016/12/07 23:29:04
surface_embedding()
|
| + SurfaceId surface_id() const { return surface_emb_->id(); } |
| + const gfx::Size& surface_size() const { return surface_emb_->size(); } |
| + float surface_scale() const { return surface_emb_->scale(); } |
| protected: |
| - SurfaceLayer(const SatisfyCallback& satisfy_callback, |
| - const RequireCallback& require_callback); |
| + SurfaceLayer(); |
| + explicit SurfaceLayer(SurfaceEmbeddingPtr); |
| bool HasDrawableContent() const override; |
| private: |
| ~SurfaceLayer() override; |
| - void CreateNewDestroySequence(); |
| - void SatisfyDestroySequence(); |
| + void RemoveCurrentReference(); |
| - SurfaceId surface_id_; |
| - gfx::Size surface_size_; |
| - float surface_scale_; |
| - SurfaceSequence destroy_sequence_; |
| - SatisfyCallback satisfy_callback_; |
| - RequireCallback require_callback_; |
| + SurfaceEmbeddingPtr surface_emb_; |
| + SurfaceEmbeddingPtr current_ref_; |
|
Fady Samuel
2016/12/07 23:29:05
I don't understand the difference between these tw
|
| DISALLOW_COPY_AND_ASSIGN(SurfaceLayer); |
| }; |