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

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

Issue 2738923002: Add DisplayClientCompositorFrameSink (Closed)
Patch Set: clean up Created 3 years, 9 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_PUBLIC_CPP_DISPLAY_CLIENT_COMPOSITOR_FRAME_SINK_H_
6 #define SERVICES_UI_PUBLIC_CPP_DISPLAY_CLIENT_COMPOSITOR_FRAME_SINK_H_
7
8 #include "cc/ipc/display_compositor.mojom.h"
9 #include "cc/ipc/mojo_compositor_frame_sink.mojom.h"
10 #include "cc/output/compositor_frame_sink.h"
11 #include "cc/scheduler/begin_frame_source.h"
12 #include "cc/surfaces/local_surface_id.h"
13 #include "cc/surfaces/local_surface_id_allocator.h"
14 #include "mojo/public/cpp/bindings/binding.h"
15 #include "ui/gfx/geometry/rect.h"
16 #include "ui/gfx/native_widget_types.h"
17
18 namespace base {
19 class ThreadChecker;
20 } // namespace base
21
22 namespace ui {
23 namespace ws {
24
25 class DisplayClientCompositorFrameSink
26 : public cc::CompositorFrameSink,
27 public cc::mojom::MojoCompositorFrameSinkClient,
28 public cc::ExternalBeginFrameSourceClient {
29 public:
30 DisplayClientCompositorFrameSink(
31 const cc::FrameSinkId& frame_sink_id,
32 cc::mojom::MojoCompositorFrameSinkAssociatedPtr
33 compositor_frame_sink_info,
Fady Samuel 2017/03/10 19:17:40 nit: remove "info"
Alex Z. 2017/03/10 19:28:50 Done.
34 cc::mojom::DisplayPrivateAssociatedPtr display_private_info,
Fady Samuel 2017/03/10 19:17:40 nit: remove info
Alex Z. 2017/03/10 19:28:50 Done.
35 cc::mojom::MojoCompositorFrameSinkClientRequest client_request);
36
37 ~DisplayClientCompositorFrameSink() override;
38
39 // cc::CompositorFrameSink implementation.
40 bool BindToClient(cc::CompositorFrameSinkClient* client) override;
41 void DetachFromClient() override;
42 void SubmitCompositorFrame(cc::CompositorFrame frame) override;
43
44 private:
45 // cc::mojom::MojoCompositorFrameSinkClient implementation:
46 void DidReceiveCompositorFrameAck() override;
47 void OnBeginFrame(const cc::BeginFrameArgs& begin_frame_args) override;
48 void ReclaimResources(const cc::ReturnedResourceArray& resources) override;
49 void WillDrawSurface(const cc::LocalSurfaceId& local_surface_id,
50 const gfx::Rect& damage_rect) override;
51
52 // cc::ExternalBeginFrameSourceClient implementation:
53 void OnNeedsBeginFrames(bool needs_begin_frame) override;
54 void OnDidFinishFrame(const cc::BeginFrameAck& ack) override;
55
56 gfx::Size last_submitted_frame_size_;
57 cc::LocalSurfaceId local_surface_id_;
58 cc::LocalSurfaceIdAllocator id_allocator_;
59 cc::mojom::MojoCompositorFrameSinkClientRequest client_request_;
60 cc::mojom::MojoCompositorFrameSinkAssociatedPtr compositor_frame_sink_;
61 mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient> client_binding_;
62 cc::mojom::DisplayPrivateAssociatedPtr display_private_;
63 std::unique_ptr<base::ThreadChecker> thread_checker_;
64 std::unique_ptr<cc::ExternalBeginFrameSource> begin_frame_source_;
65 const cc::FrameSinkId frame_sink_id_;
66
67 DISALLOW_COPY_AND_ASSIGN(DisplayClientCompositorFrameSink);
68 };
69
70 } // namspace ws
71 } // namespace ui
72
73 #endif // SERVICES_UI_PUBLIC_CPP_DISPLAY_CLIENT_COMPOSITOR_FRAME_SINK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698