| Index: services/ui/ws/compositor_frame_sink_client_binding.h
|
| diff --git a/services/ui/ws/compositor_frame_sink_client_binding.h b/services/ui/ws/compositor_frame_sink_client_binding.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..3d1b76fda415e1d4b9e2b529451487e3b160bd95
|
| --- /dev/null
|
| +++ b/services/ui/ws/compositor_frame_sink_client_binding.h
|
| @@ -0,0 +1,58 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef SERVICES_UI_WS_COMPOSITOR_FRAME_SINK_CLIENT_BINDING_H_
|
| +#define SERVICES_UI_WS_COMPOSITOR_FRAME_SINK_CLIENT_BINDING_H_
|
| +
|
| +#include "base/macros.h"
|
| +#include "cc/ipc/frame_sink_manager.mojom.h"
|
| +#include "cc/ipc/mojo_compositor_frame_sink.mojom.h"
|
| +#include "cc/surfaces/local_surface_id_allocator.h"
|
| +#include "mojo/public/cpp/bindings/binding.h"
|
| +
|
| +namespace ui {
|
| +namespace ws {
|
| +
|
| +// CompositorFrameSinkClientBinding manages the binding between a FrameGenerator
|
| +// and its MojoCompositorFrameSink. CompositorFrameSinkClientBinding exists so
|
| +// that a mock implementation of MojoCompositorFrameSink can be injected for
|
| +// tests. FrameGenerator owns its associated CompositorFrameSinkClientBinding.
|
| +// TODO(staraz): DisplayClientCompositorFrameSink implements
|
| +// CompositorFrameSinkClientBinding
|
| +class CompositorFrameSinkClientBinding {
|
| + public:
|
| + virtual ~CompositorFrameSinkClientBinding() = default;
|
| + virtual void SubmitCompositorFrame(cc::CompositorFrame frame) = 0;
|
| + virtual void SetNeedsBeginFrame(bool needs_begin_frame) = 0;
|
| +};
|
| +
|
| +// Bindings implementation of CompositorFrameSinkClientBinding.
|
| +class DefaultCompositorFrameSinkClientBinding
|
| + : public CompositorFrameSinkClientBinding {
|
| + public:
|
| + DefaultCompositorFrameSinkClientBinding(
|
| + cc::mojom::MojoCompositorFrameSinkClient* sink_client,
|
| + cc::mojom::MojoCompositorFrameSinkClientRequest sink_client_request,
|
| + cc::mojom::MojoCompositorFrameSinkAssociatedPtr compositor_frame_sink,
|
| + cc::mojom::DisplayPrivateAssociatedPtr display_private);
|
| + ~DefaultCompositorFrameSinkClientBinding() override;
|
| +
|
| + // CompositorFrameSinkClientBinding implementation:
|
| + void SubmitCompositorFrame(cc::CompositorFrame frame) override;
|
| + void SetNeedsBeginFrame(bool needs_begin_frame) override;
|
| +
|
| + private:
|
| + mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient> binding_;
|
| + cc::mojom::DisplayPrivateAssociatedPtr display_private_;
|
| + cc::mojom::MojoCompositorFrameSinkAssociatedPtr compositor_frame_sink_;
|
| + cc::LocalSurfaceId local_surface_id_;
|
| + cc::LocalSurfaceIdAllocator id_allocator_;
|
| + gfx::Size last_submitted_frame_size_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(DefaultCompositorFrameSinkClientBinding);
|
| +};
|
| +}
|
| +}
|
| +
|
| +#endif // SERVICES_UI_WS_COMPOSITOR_FRAME_SINK_CLIENT_BINDING_H_
|
|
|