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

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

Issue 2875753002: Implement aura::WindowPortMus::CreateCompositorFrameSink() (Closed)
Patch Set: Rebase 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SERVICES_UI_PUBLIC_CPP_WINDOW_COMPOSITOR_FRAME_SINK_H_ 5 #ifndef SERVICES_UI_PUBLIC_CPP_WINDOW_COMPOSITOR_FRAME_SINK_H_
6 #define SERVICES_UI_PUBLIC_CPP_WINDOW_COMPOSITOR_FRAME_SINK_H_ 6 #define SERVICES_UI_PUBLIC_CPP_WINDOW_COMPOSITOR_FRAME_SINK_H_
7 7
8 #include "base/callback.h"
8 #include "base/macros.h" 9 #include "base/macros.h"
9 #include "cc/ipc/mojo_compositor_frame_sink.mojom.h" 10 #include "cc/ipc/mojo_compositor_frame_sink.mojom.h"
10 #include "cc/output/compositor_frame_sink.h" 11 #include "cc/output/compositor_frame_sink.h"
11 #include "cc/output/context_provider.h" 12 #include "cc/output/context_provider.h"
12 #include "cc/scheduler/begin_frame_source.h" 13 #include "cc/scheduler/begin_frame_source.h"
13 #include "cc/surfaces/local_surface_id_allocator.h" 14 #include "cc/surfaces/local_surface_id_allocator.h"
14 #include "cc/surfaces/surface_id.h" 15 #include "cc/surfaces/surface_id.h"
15 #include "mojo/public/cpp/bindings/binding.h" 16 #include "mojo/public/cpp/bindings/binding.h"
16 17
17 namespace ui { 18 namespace ui {
18 19
19 class ClientCompositorFrameSinkBinding; 20 class ClientCompositorFrameSinkBinding;
20 21
21 class ClientCompositorFrameSink 22 class ClientCompositorFrameSink
22 : public cc::CompositorFrameSink, 23 : public cc::CompositorFrameSink,
23 public cc::mojom::MojoCompositorFrameSinkClient, 24 public cc::mojom::MojoCompositorFrameSinkClient,
24 public cc::ExternalBeginFrameSourceClient { 25 public cc::ExternalBeginFrameSourceClient {
25 public: 26 public:
26 // static 27 // static
27 static std::unique_ptr<ClientCompositorFrameSink> Create( 28 static std::unique_ptr<ClientCompositorFrameSink> Create(
28 scoped_refptr<cc::ContextProvider> context_provider, 29 scoped_refptr<cc::ContextProvider> context_provider,
29 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, 30 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
30 std::unique_ptr<ClientCompositorFrameSinkBinding>* 31 std::unique_ptr<ClientCompositorFrameSinkBinding>*
31 compositor_frame_sink_binding, 32 compositor_frame_sink_binding,
32 bool enable_surface_synchronization); 33 bool enable_surface_synchronization);
33 34
34 ~ClientCompositorFrameSink() override; 35 ~ClientCompositorFrameSink() override;
35 36
37 using SurfaceChangedCallback =
38 base::Callback<void(const cc::LocalSurfaceId&, const gfx::Size&)>;
39 // Set a callback which will be called when the surface is changed.
40 void SetSurfaceChangedCallback(const SurfaceChangedCallback& callback);
Fady Samuel 2017/05/18 16:48:50 This is fundamentally not compatible with surface
Peng 2017/05/18 19:37:59 Done.
41
36 // cc::CompositorFrameSink implementation. 42 // cc::CompositorFrameSink implementation.
37 bool BindToClient(cc::CompositorFrameSinkClient* client) override; 43 bool BindToClient(cc::CompositorFrameSinkClient* client) override;
38 void DetachFromClient() override; 44 void DetachFromClient() override;
39 void SetLocalSurfaceId(const cc::LocalSurfaceId& local_surface_id) override; 45 void SetLocalSurfaceId(const cc::LocalSurfaceId& local_surface_id) override;
40 void SubmitCompositorFrame(cc::CompositorFrame frame) override; 46 void SubmitCompositorFrame(cc::CompositorFrame frame) override;
41 47
42 private: 48 private:
43 ClientCompositorFrameSink( 49 ClientCompositorFrameSink(
44 scoped_refptr<cc::ContextProvider> context_provider, 50 scoped_refptr<cc::ContextProvider> context_provider,
45 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, 51 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
(...skipping 15 matching lines...) Expand all
61 cc::LocalSurfaceId local_surface_id_; 67 cc::LocalSurfaceId local_surface_id_;
62 cc::LocalSurfaceIdAllocator id_allocator_; 68 cc::LocalSurfaceIdAllocator id_allocator_;
63 std::unique_ptr<cc::ExternalBeginFrameSource> begin_frame_source_; 69 std::unique_ptr<cc::ExternalBeginFrameSource> begin_frame_source_;
64 cc::mojom::MojoCompositorFrameSinkPtrInfo compositor_frame_sink_info_; 70 cc::mojom::MojoCompositorFrameSinkPtrInfo compositor_frame_sink_info_;
65 cc::mojom::MojoCompositorFrameSinkClientRequest client_request_; 71 cc::mojom::MojoCompositorFrameSinkClientRequest client_request_;
66 cc::mojom::MojoCompositorFrameSinkPtr compositor_frame_sink_; 72 cc::mojom::MojoCompositorFrameSinkPtr compositor_frame_sink_;
67 std::unique_ptr<mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient>> 73 std::unique_ptr<mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient>>
68 client_binding_; 74 client_binding_;
69 std::unique_ptr<base::ThreadChecker> thread_checker_; 75 std::unique_ptr<base::ThreadChecker> thread_checker_;
70 const bool enable_surface_synchronization_; 76 const bool enable_surface_synchronization_;
77 SurfaceChangedCallback surface_changed_callback_;
71 78
72 DISALLOW_COPY_AND_ASSIGN(ClientCompositorFrameSink); 79 DISALLOW_COPY_AND_ASSIGN(ClientCompositorFrameSink);
73 }; 80 };
74 81
75 // A ClientCompositorFrameSinkBinding is a bundle of mojo interfaces that is 82 // A ClientCompositorFrameSinkBinding is a bundle of mojo interfaces that is
76 // created by ClientCompositorFrameSink::Create and is used by or implemented by 83 // created by ClientCompositorFrameSink::Create and is used by or implemented by
77 // Mus when a window is attached to a frame-sink.. 84 // Mus when a window is attached to a frame-sink..
78 // ClientCompositorFrameSinkBinding has no standalone functionality. Its purpose 85 // ClientCompositorFrameSinkBinding has no standalone functionality. Its purpose
79 // is to allow safely creating and attaching a CompositorFrameSink on one 86 // is to allow safely creating and attaching a CompositorFrameSink on one
80 // thread and using it on another. 87 // thread and using it on another.
(...skipping 13 matching lines...) Expand all
94 compositor_frame_sink_client); 101 compositor_frame_sink_client);
95 102
96 cc::mojom::MojoCompositorFrameSinkRequest compositor_frame_sink_request_; 103 cc::mojom::MojoCompositorFrameSinkRequest compositor_frame_sink_request_;
97 cc::mojom::MojoCompositorFrameSinkClientPtrInfo compositor_frame_sink_client_; 104 cc::mojom::MojoCompositorFrameSinkClientPtrInfo compositor_frame_sink_client_;
98 105
99 DISALLOW_COPY_AND_ASSIGN(ClientCompositorFrameSinkBinding); 106 DISALLOW_COPY_AND_ASSIGN(ClientCompositorFrameSinkBinding);
100 }; 107 };
101 } // namespace ui 108 } // namespace ui
102 109
103 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_COMPOSITOR_FRAME_SINK_H_ 110 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_COMPOSITOR_FRAME_SINK_H_
OLDNEW
« no previous file with comments | « no previous file | services/ui/public/cpp/client_compositor_frame_sink.cc » ('j') | services/ui/public/interfaces/window_tree.mojom » ('J')

Powered by Google App Engine
This is Rietveld 408576698