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

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: Address comments 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
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 // TODO(staraz): DisplayClientCompositorFrameSink implements
22 // CompositorFrameSinkClientBinding
23 class CompositorFrameSinkClientBinding {
Fady Samuel 2017/05/17 20:33:04 What if this implements cc::mojom::MojoCompositorF
Alex Z. 2017/05/17 20:52:01 Would it be weird if there is a MojoCFS implementa
Alex Z. 2017/05/17 21:20:24 A few more concerns: ClientBinding starts to seem
Fady Samuel 2017/05/18 11:55:27 Not at all. The InterfacePtr probably also impleme
Fady Samuel 2017/05/18 11:55:27 Yea, we store the LocalSurfaceId in both places (c
24 public:
25 virtual ~CompositorFrameSinkClientBinding() = default;
26 virtual void SubmitCompositorFrame(cc::CompositorFrame frame) = 0;
27 virtual void SetNeedsBeginFrame(bool needs_begin_frame) = 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
45 private:
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698