Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef SERVICES_UI_WS_COMPOSITOR_FRAME_SINK_CLIENT_BINDING_H_ | |
| 6 #define SERVICES_UI_WS_COMPOSITOR_FRAME_SINK_CLIENT_BINDING_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "cc/ipc/frame_sink_manager.mojom.h" | |
| 10 #include "cc/ipc/mojo_compositor_frame_sink.mojom.h" | |
| 11 #include "cc/surfaces/local_surface_id_allocator.h" | |
| 12 #include "mojo/public/cpp/bindings/binding.h" | |
| 13 | |
| 14 namespace ui { | |
| 15 namespace ws { | |
| 16 | |
| 17 // CompositorFrameSinkClientBinding manages the binding between a FrameGenerator | |
| 18 // and its MojoCompositorFrameSink. CompositorFrameSinkClientBinding exists so | |
| 19 // that a mock implementation of MojoCompositorFrameSink can be injected for | |
| 20 // tests. FrameGenerator owns its associated CompositorFrameSinkClientBinding. | |
| 21 class CompositorFrameSinkClientBinding | |
|
Fady Samuel
2017/05/19 11:51:03
Ahh this is pretty cool. Maybe we don't need this
Alex Z.
2017/05/19 13:26:52
Done.
| |
| 22 : public cc::mojom::MojoCompositorFrameSink { | |
| 23 public: | |
| 24 ~CompositorFrameSinkClientBinding() override = default; | |
| 25 }; | |
| 26 | |
| 27 // Bindings implementation of CompositorFrameSinkClientBinding. | |
| 28 class DefaultCompositorFrameSinkClientBinding | |
| 29 : public CompositorFrameSinkClientBinding { | |
| 30 public: | |
| 31 DefaultCompositorFrameSinkClientBinding( | |
| 32 cc::mojom::MojoCompositorFrameSinkClient* sink_client, | |
| 33 cc::mojom::MojoCompositorFrameSinkClientRequest sink_client_request, | |
| 34 cc::mojom::MojoCompositorFrameSinkAssociatedPtr compositor_frame_sink, | |
| 35 cc::mojom::DisplayPrivateAssociatedPtr display_private); | |
| 36 ~DefaultCompositorFrameSinkClientBinding() override; | |
| 37 | |
| 38 private: | |
| 39 // CompositorFrameSinkClientBinding implementation: | |
| 40 void SubmitCompositorFrame(const cc::LocalSurfaceId& local_surface_id, | |
| 41 cc::CompositorFrame frame) override; | |
| 42 void SetNeedsBeginFrame(bool needs_begin_frame) override; | |
| 43 void BeginFrameDidNotSwap(const cc::BeginFrameAck& ack) override; | |
| 44 void EvictCurrentSurface() override; | |
| 45 | |
| 46 mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient> binding_; | |
| 47 cc::mojom::DisplayPrivateAssociatedPtr display_private_; | |
| 48 cc::mojom::MojoCompositorFrameSinkAssociatedPtr compositor_frame_sink_; | |
| 49 cc::LocalSurfaceId local_surface_id_; | |
| 50 cc::LocalSurfaceIdAllocator id_allocator_; | |
| 51 gfx::Size last_submitted_frame_size_; | |
| 52 | |
| 53 DISALLOW_COPY_AND_ASSIGN(DefaultCompositorFrameSinkClientBinding); | |
| 54 }; | |
| 55 } | |
| 56 } | |
| 57 | |
| 58 #endif // SERVICES_UI_WS_COMPOSITOR_FRAME_SINK_CLIENT_BINDING_H_ | |
| OLD | NEW |