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

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

Issue 2738923002: Add DisplayClientCompositorFrameSink (Closed)
Patch Set: addressed comments 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"
msw 2017/03/10 20:08:40 optional nit: explicit include not needed (transit
Alex Z. 2017/03/11 03:52:20 Done.
16 #include "ui/gfx/native_widget_types.h"
msw 2017/03/10 20:08:40 nit: not needed?
Alex Z. 2017/03/11 03:52:20 Done.
17
18 namespace base {
19 class ThreadChecker;
20 } // namespace base
21
22 namespace ui {
23 namespace ws {
24
25 class DisplayClientCompositorFrameSink
msw 2017/03/10 20:08:40 Add an explanatory class comment.
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 compositor_frame_sink,
33 cc::mojom::DisplayPrivateAssociatedPtr display_private,
34 cc::mojom::MojoCompositorFrameSinkClientRequest client_request);
35
36 ~DisplayClientCompositorFrameSink() override;
37
38 // cc::CompositorFrameSink implementation.
msw 2017/03/10 20:08:40 nit: be consistent about trailing period/colon
Alex Z. 2017/03/11 03:52:20 Done.
39 bool BindToClient(cc::CompositorFrameSinkClient* client) override;
40 void DetachFromClient() override;
41 void SubmitCompositorFrame(cc::CompositorFrame frame) override;
42
43 private:
44 // cc::mojom::MojoCompositorFrameSinkClient implementation:
45 void DidReceiveCompositorFrameAck() override;
46 void OnBeginFrame(const cc::BeginFrameArgs& begin_frame_args) override;
47 void ReclaimResources(const cc::ReturnedResourceArray& resources) override;
48 void WillDrawSurface(const cc::LocalSurfaceId& local_surface_id,
49 const gfx::Rect& damage_rect) override;
50
51 // cc::ExternalBeginFrameSourceClient implementation:
52 void OnNeedsBeginFrames(bool needs_begin_frame) override;
53 void OnDidFinishFrame(const cc::BeginFrameAck& ack) override;
54
55 gfx::Size last_submitted_frame_size_;
msw 2017/03/10 20:08:40 nit: include size.h?
Alex Z. 2017/03/11 03:52:20 Done. But why do we need to include size.h but not
56 cc::LocalSurfaceId local_surface_id_;
57 cc::LocalSurfaceIdAllocator id_allocator_;
58 cc::mojom::MojoCompositorFrameSinkClientRequest client_request_;
59 cc::mojom::MojoCompositorFrameSinkAssociatedPtr compositor_frame_sink_;
60 mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient> client_binding_;
61 cc::mojom::DisplayPrivateAssociatedPtr display_private_;
62 std::unique_ptr<base::ThreadChecker> thread_checker_;
63 std::unique_ptr<cc::ExternalBeginFrameSource> begin_frame_source_;
64 const cc::FrameSinkId frame_sink_id_;
65
66 DISALLOW_COPY_AND_ASSIGN(DisplayClientCompositorFrameSink);
67 };
68
69 } // namspace ws
70 } // namespace ui
71
72 #endif // SERVICES_UI_PUBLIC_CPP_DISPLAY_CLIENT_COMPOSITOR_FRAME_SINK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698