| Index: components/exo/surface.cc
|
| diff --git a/components/exo/surface.cc b/components/exo/surface.cc
|
| index f295aaa46096e5edef0e3a5c9121a23820f4fdb3..06acf72b89d8c25775e7deab81e55681543fc0ea 100644
|
| --- a/components/exo/surface.cc
|
| +++ b/components/exo/surface.cc
|
| @@ -17,6 +17,7 @@
|
| #include "cc/quads/solid_color_draw_quad.h"
|
| #include "cc/quads/texture_draw_quad.h"
|
| #include "cc/resources/single_release_callback.h"
|
| +#include "cc/surfaces/sequence_surface_reference_factory.h"
|
| #include "cc/surfaces/surface.h"
|
| #include "cc/surfaces/surface_id_allocator.h"
|
| #include "components/exo/buffer.h"
|
| @@ -45,6 +46,30 @@ DECLARE_WINDOW_PROPERTY_TYPE(exo::Surface*);
|
| namespace exo {
|
| namespace {
|
|
|
| +class SurfaceReferenceFactory : public cc::SequenceSurfaceReferenceFactory {
|
| + public:
|
| + explicit SurfaceReferenceFactory(
|
| + scoped_refptr<CompositorFrameSinkHolder> sink_holder)
|
| + : sink_holder_(std::move(sink_holder)) {}
|
| +
|
| + private:
|
| + ~SurfaceReferenceFactory() override = default;
|
| +
|
| + // cc::SequenceSurfaceReferenceFactory implementation:
|
| + void SatisfySequence(const cc::SurfaceSequence& sequence) const override {
|
| + sink_holder_->Satisfy(sequence);
|
| + }
|
| +
|
| + void RequireSequence(const cc::SurfaceId& surface_id,
|
| + const cc::SurfaceSequence& sequence) const override {
|
| + sink_holder_->Require(surface_id, sequence);
|
| + }
|
| +
|
| + scoped_refptr<CompositorFrameSinkHolder> sink_holder_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(SurfaceReferenceFactory);
|
| +};
|
| +
|
| // A property key containing the surface that is associated with
|
| // window. If unset, no surface is associated with window.
|
| DEFINE_WINDOW_PROPERTY_KEY(Surface*, kSurfaceKey, nullptr);
|
| @@ -157,6 +182,7 @@ Surface::Surface()
|
| std::move(frame_sink_holder_ptr)));
|
| compositor_frame_sink_holder_ = new CompositorFrameSinkHolder(
|
| this, std::move(frame_sink), std::move(frame_sink_client_request));
|
| + ref_factory_ = new SurfaceReferenceFactory(compositor_frame_sink_holder_);
|
| window_->SetType(ui::wm::WINDOW_TYPE_CONTROL);
|
| window_->SetName("ExoSurface");
|
| window_->SetProperty(kSurfaceKey, this);
|
| @@ -417,13 +443,11 @@ void Surface::CommitSurfaceHierarchy() {
|
| // mirror layer to update its surface using the latest bounds.
|
| window_->layer()->SetBounds(
|
| gfx::Rect(window_->layer()->bounds().origin(), content_size_));
|
| + cc::SurfaceId surface_id(frame_sink_id_, local_frame_id_);
|
| window_->layer()->SetShowSurface(
|
| - cc::SurfaceId(frame_sink_id_, local_frame_id_),
|
| - base::Bind(&CompositorFrameSinkHolder::Satisfy,
|
| - compositor_frame_sink_holder_),
|
| - base::Bind(&CompositorFrameSinkHolder::Require,
|
| - compositor_frame_sink_holder_),
|
| - content_size_, contents_surface_to_layer_scale, content_size_);
|
| + cc::SurfaceInfo(surface_id, contents_surface_to_layer_scale,
|
| + content_size_),
|
| + ref_factory_, content_size_);
|
| window_->layer()->SetFillsBoundsOpaquely(
|
| state_.blend_mode == SkBlendMode::kSrc ||
|
| state_.opaque_region.contains(
|
|
|