| Index: services/ui/surfaces/gpu_compositor_frame_sink.h
|
| diff --git a/services/ui/surfaces/gpu_compositor_frame_sink.h b/services/ui/surfaces/gpu_compositor_frame_sink.h
|
| index 5da93934da8749b4cc175aac09f9f046c36c1362..f50ebad5ad29a2a77ab6285ab225597279adcc06 100644
|
| --- a/services/ui/surfaces/gpu_compositor_frame_sink.h
|
| +++ b/services/ui/surfaces/gpu_compositor_frame_sink.h
|
| @@ -5,21 +5,11 @@
|
| #ifndef SERVICES_UI_SURFACES_GPU_COMPOSITOR_FRAME_SINK_H_
|
| #define SERVICES_UI_SURFACES_GPU_COMPOSITOR_FRAME_SINK_H_
|
|
|
| -#include <memory>
|
| -#include <set>
|
| -
|
| #include "base/macros.h"
|
| -#include "base/memory/ref_counted.h"
|
| #include "base/memory/weak_ptr.h"
|
| -#include "cc/ipc/compositor_frame.mojom.h"
|
| #include "cc/ipc/mojo_compositor_frame_sink.mojom.h"
|
| -#include "cc/scheduler/begin_frame_source.h"
|
| -#include "cc/surfaces/display_client.h"
|
| -#include "cc/surfaces/frame_sink_id.h"
|
| -#include "cc/surfaces/surface_factory.h"
|
| -#include "cc/surfaces/surface_factory_client.h"
|
| -#include "cc/surfaces/surface_id.h"
|
| -#include "cc/surfaces/surface_id_allocator.h"
|
| +#include "cc/surfaces/compositor_frame_sink_support.h"
|
| +#include "cc/surfaces/compositor_frame_sink_support_client.h"
|
| #include "mojo/public/cpp/bindings/binding.h"
|
|
|
| namespace cc {
|
| @@ -31,11 +21,10 @@ namespace ui {
|
| class DisplayCompositor;
|
|
|
| // Server side representation of a WindowSurface.
|
| -class GpuCompositorFrameSink : public cc::mojom::MojoCompositorFrameSink,
|
| - public cc::DisplayClient,
|
| - public cc::mojom::MojoCompositorFrameSinkPrivate,
|
| - public cc::SurfaceFactoryClient,
|
| - public cc::BeginFrameObserver {
|
| +class GpuCompositorFrameSink
|
| + : public cc::CompositorFrameSinkSupportClient,
|
| + public cc::mojom::MojoCompositorFrameSink,
|
| + public cc::mojom::MojoCompositorFrameSinkPrivate {
|
| public:
|
| GpuCompositorFrameSink(
|
| DisplayCompositor* display_compositor,
|
| @@ -58,65 +47,25 @@ class GpuCompositorFrameSink : public cc::mojom::MojoCompositorFrameSink,
|
| const cc::FrameSinkId& child_frame_sink_id) override;
|
|
|
| private:
|
| - void DidReceiveCompositorFrameAck();
|
| -
|
| - // cc::DisplayClient implementation.
|
| - void DisplayOutputSurfaceLost() override;
|
| - void DisplayWillDrawAndSwap(bool will_draw_and_swap,
|
| - const cc::RenderPassList& render_passes) override;
|
| - void DisplayDidDrawAndSwap() override;
|
| -
|
| - // cc::SurfaceFactoryClient implementation.
|
| - void ReturnResources(const cc::ReturnedResourceArray& resources) override;
|
| - void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override;
|
| -
|
| - // cc::BeginFrameObserver implementation.
|
| + // cc::CompositorFrameSinkSupportClient implementation:
|
| + void DidReceiveCompositorFrameAck() override;
|
| void OnBeginFrame(const cc::BeginFrameArgs& args) override;
|
| - const cc::BeginFrameArgs& LastUsedBeginFrameArgs() const override;
|
| - void OnBeginFrameSourcePausedChanged(bool paused) override;
|
| -
|
| - void UpdateNeedsBeginFramesInternal();
|
| + void ReclaimResources(const cc::ReturnedResourceArray& resources) override;
|
|
|
| void OnClientConnectionLost();
|
| void OnPrivateConnectionLost();
|
|
|
| - const cc::FrameSinkId frame_sink_id_;
|
| -
|
| - DisplayCompositor* const display_compositor_; // owns this.
|
| + DisplayCompositor* const display_compositor_;
|
|
|
| - // GpuCompositorFrameSink holds a cc::Display if it created with
|
| - // non-null gpu::SurfaceHandle. In the window server, the display root
|
| - // window's CompositorFrameSink will have a valid gpu::SurfaceHandle.
|
| - std::unique_ptr<cc::Display> display_;
|
| -
|
| - cc::LocalFrameId local_frame_id_;
|
| - cc::SurfaceFactory surface_factory_;
|
| - // Counts the number of CompositorFrames that have been submitted and have not
|
| - // yet received an ACK.
|
| - int ack_pending_count_ = 0;
|
| - cc::ReturnedResourceArray surface_returned_resources_;
|
| + cc::CompositorFrameSinkSupport support_;
|
|
|
| bool client_connection_lost_ = false;
|
| bool private_connection_lost_ = false;
|
|
|
| - // The begin frame source being observered. Null if none.
|
| - cc::BeginFrameSource* begin_frame_source_ = nullptr;
|
| -
|
| - // The last begin frame args generated by the begin frame source.
|
| - cc::BeginFrameArgs last_begin_frame_args_;
|
| -
|
| - // Whether a request for begin frames has been issued.
|
| - bool needs_begin_frame_ = false;
|
| -
|
| - // Whether or not a frame observer has been added.
|
| - bool added_frame_observer_ = false;
|
| -
|
| cc::mojom::MojoCompositorFrameSinkClientPtr client_;
|
| mojo::Binding<cc::mojom::MojoCompositorFrameSink> binding_;
|
| mojo::Binding<cc::mojom::MojoCompositorFrameSinkPrivate> private_binding_;
|
|
|
| - base::WeakPtrFactory<GpuCompositorFrameSink> weak_factory_;
|
| -
|
| DISALLOW_COPY_AND_ASSIGN(GpuCompositorFrameSink);
|
| };
|
|
|
|
|