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

Side by Side Diff: services/ui/public/cpp/display_client_compositor_frame_sink.h

Issue 2738923002: Add DisplayClientCompositorFrameSink (Closed)
Patch Set: Implement DisplayClientCompositorFrameSink 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
24 class DisplayClientCompositorFrameSink
Fady Samuel 2017/03/09 18:50:10 Put this in the window server: services/ui/ws as t
Alex Z. 2017/03/09 18:56:08 Done.
25 : public cc::CompositorFrameSink,
26 public cc::mojom::MojoCompositorFrameSinkClient,
27 public cc::ExternalBeginFrameSourceClient {
28 public:
29 DisplayClientCompositorFrameSink(
30 const cc::FrameSinkId& frame_sink_id,
31 cc::mojom::MojoCompositorFrameSinkAssociatedPtrInfo
32 compositor_frame_sink_info,
33 cc::mojom::DisplayPrivateAssociatedPtrInfo display_private_info,
34 cc::mojom::MojoCompositorFrameSinkClientRequest client_request);
35
36 ~DisplayClientCompositorFrameSink() override;
37
38 // cc::CompositorFrameSink implementation.
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_;
56 cc::LocalSurfaceId local_surface_id_;
57 cc::LocalSurfaceIdAllocator id_allocator_;
58 cc::mojom::MojoCompositorFrameSinkAssociatedPtrInfo
59 compositor_frame_sink_info_;
60 cc::mojom::MojoCompositorFrameSinkClientRequest client_request_;
61 cc::mojom::MojoCompositorFrameSinkAssociatedPtr compositor_frame_sink_;
62 std::unique_ptr<mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient>>
63 client_binding_;
64 cc::mojom::DisplayPrivateAssociatedPtrInfo display_private_info_;
65 cc::mojom::DisplayPrivateAssociatedPtr display_private_;
66 std::unique_ptr<base::ThreadChecker> thread_checker_;
67 std::unique_ptr<cc::ExternalBeginFrameSource> begin_frame_source_;
68 const cc::FrameSinkId frame_sink_id_;
69
70 DISALLOW_COPY_AND_ASSIGN(DisplayClientCompositorFrameSink);
71 };
72
73 } // namespace ui
74
75 #endif // SERVICES_UI_PUBLIC_CPP_DISPLAY_CLIENT_COMPOSITOR_FRAME_SINK_H_
OLDNEW
« no previous file with comments | « services/ui/public/cpp/BUILD.gn ('k') | services/ui/public/cpp/display_client_compositor_frame_sink.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698