Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: services/ui/ws/compositor_frame_sink_client_binding.h

Issue 2890913002: Add CompositorFrameSinkClientBinding To Be Used By FrameGenerator (Closed)
Patch Set: LastBeginFrameAck() Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « services/ui/ws/BUILD.gn ('k') | services/ui/ws/compositor_frame_sink_client_binding.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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/18 17:03:57 Back to my earlier question. Maybe this can implem
Alex Z. 2017/05/18 17:36:19 Yes, I'm working on it.
Alex Z. 2017/05/18 18:00:34 Done.
22 public:
23 virtual ~CompositorFrameSinkClientBinding() = default;
24
25 virtual void SetNeedsBeginFrame(bool needs_begin_frame) = 0;
26 virtual void SubmitCompositorFrame(cc::CompositorFrame frame) = 0;
27 virtual void BeginFrameDidNotSwap(const cc::BeginFrameAck& ack) = 0;
28 };
29
30 // Bindings implementation of CompositorFrameSinkClientBinding.
31 class DefaultCompositorFrameSinkClientBinding
32 : public CompositorFrameSinkClientBinding {
33 public:
34 DefaultCompositorFrameSinkClientBinding(
35 cc::mojom::MojoCompositorFrameSinkClient* sink_client,
36 cc::mojom::MojoCompositorFrameSinkClientRequest sink_client_request,
37 cc::mojom::MojoCompositorFrameSinkAssociatedPtr compositor_frame_sink,
38 cc::mojom::DisplayPrivateAssociatedPtr display_private);
39 ~DefaultCompositorFrameSinkClientBinding() override;
40
41 // CompositorFrameSinkClientBinding implementation:
42 void SubmitCompositorFrame(cc::CompositorFrame frame) override;
43 void SetNeedsBeginFrame(bool needs_begin_frame) override;
44 void BeginFrameDidNotSwap(const cc::BeginFrameAck& ack) override;
45
46 private:
47 mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient> binding_;
48 cc::mojom::DisplayPrivateAssociatedPtr display_private_;
49 cc::mojom::MojoCompositorFrameSinkAssociatedPtr compositor_frame_sink_;
50 cc::LocalSurfaceId local_surface_id_;
51 cc::LocalSurfaceIdAllocator id_allocator_;
52 gfx::Size last_submitted_frame_size_;
53
54 DISALLOW_COPY_AND_ASSIGN(DefaultCompositorFrameSinkClientBinding);
55 };
56 }
57 }
58
59 #endif // SERVICES_UI_WS_COMPOSITOR_FRAME_SINK_CLIENT_BINDING_H_
OLDNEW
« no previous file with comments | « services/ui/ws/BUILD.gn ('k') | services/ui/ws/compositor_frame_sink_client_binding.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698