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

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

Issue 2626023007: Passing FrameSinkId to WindowCompositorFrameSink (Closed)
Patch Set: c Created 3 years, 11 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/macros.h" 8 #include "base/macros.h"
9 #include "cc/ipc/mojo_compositor_frame_sink.mojom.h" 9 #include "cc/ipc/mojo_compositor_frame_sink.mojom.h"
10 #include "cc/output/compositor_frame_sink.h" 10 #include "cc/output/compositor_frame_sink.h"
11 #include "cc/output/context_provider.h" 11 #include "cc/output/context_provider.h"
12 #include "cc/scheduler/begin_frame_source.h" 12 #include "cc/scheduler/begin_frame_source.h"
13 #include "cc/surfaces/surface_id.h" 13 #include "cc/surfaces/surface_id.h"
14 #include "cc/surfaces/surface_id_allocator.h" 14 #include "cc/surfaces/surface_id_allocator.h"
15 #include "mojo/public/cpp/bindings/binding.h" 15 #include "mojo/public/cpp/bindings/binding.h"
16 16
17 namespace ui { 17 namespace ui {
18 18
19 class WindowCompositorFrameSinkBinding; 19 class WindowCompositorFrameSinkBinding;
20 20
21 class WindowCompositorFrameSink 21 class WindowCompositorFrameSink
22 : public cc::CompositorFrameSink, 22 : public cc::CompositorFrameSink,
23 public cc::mojom::MojoCompositorFrameSinkClient, 23 public cc::mojom::MojoCompositorFrameSinkClient,
24 public cc::ExternalBeginFrameSourceClient { 24 public cc::ExternalBeginFrameSourceClient {
25 public: 25 public:
26 // static 26 // static
27 static std::unique_ptr<WindowCompositorFrameSink> Create( 27 static std::unique_ptr<WindowCompositorFrameSink> Create(
28 const cc::FrameSinkId& frame_sink_id,
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<WindowCompositorFrameSinkBinding>* 31 std::unique_ptr<WindowCompositorFrameSinkBinding>*
31 compositor_frame_sink_binding); 32 compositor_frame_sink_binding);
32 33
33 ~WindowCompositorFrameSink() override; 34 ~WindowCompositorFrameSink() override;
34 35
35 // cc::CompositorFrameSink implementation. 36 // cc::CompositorFrameSink implementation.
36 bool BindToClient(cc::CompositorFrameSinkClient* client) override; 37 bool BindToClient(cc::CompositorFrameSinkClient* client) override;
37 void DetachFromClient() override; 38 void DetachFromClient() override;
38 void SubmitCompositorFrame(cc::CompositorFrame frame) override; 39 void SubmitCompositorFrame(cc::CompositorFrame frame) override;
39 40
40 private: 41 private:
41 friend class Window; 42 friend class Window;
42 43
43 WindowCompositorFrameSink( 44 WindowCompositorFrameSink(
45 const cc::FrameSinkId& frame_sink_id,
44 scoped_refptr<cc::ContextProvider> context_provider, 46 scoped_refptr<cc::ContextProvider> context_provider,
45 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, 47 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
46 cc::mojom::MojoCompositorFrameSinkPtrInfo compositor_frame_sink_info, 48 cc::mojom::MojoCompositorFrameSinkPtrInfo compositor_frame_sink_info,
47 cc::mojom::MojoCompositorFrameSinkClientRequest client_request); 49 cc::mojom::MojoCompositorFrameSinkClientRequest client_request);
48 50
49 // cc::mojom::MojoCompositorFrameSinkClient implementation: 51 // cc::mojom::MojoCompositorFrameSinkClient implementation:
50 void DidReceiveCompositorFrameAck() override; 52 void DidReceiveCompositorFrameAck() override;
51 void OnBeginFrame(const cc::BeginFrameArgs& begin_frame_args) override; 53 void OnBeginFrame(const cc::BeginFrameArgs& begin_frame_args) override;
52 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; 54 void ReclaimResources(const cc::ReturnedResourceArray& resources) override;
53 void WillDrawSurface() override; 55 void WillDrawSurface() override;
54 56
55 // cc::ExternalBeginFrameSourceClient implementation. 57 // cc::ExternalBeginFrameSourceClient implementation.
56 void OnNeedsBeginFrames(bool needs_begin_frames) override; 58 void OnNeedsBeginFrames(bool needs_begin_frames) override;
57 59
58 gfx::Size last_submitted_frame_size_; 60 gfx::Size last_submitted_frame_size_;
59 cc::LocalFrameId local_frame_id_; 61 cc::LocalFrameId local_frame_id_;
60 cc::SurfaceIdAllocator id_allocator_; 62 cc::SurfaceIdAllocator id_allocator_;
61 std::unique_ptr<cc::ExternalBeginFrameSource> begin_frame_source_; 63 std::unique_ptr<cc::ExternalBeginFrameSource> begin_frame_source_;
62 cc::mojom::MojoCompositorFrameSinkPtrInfo compositor_frame_sink_info_; 64 cc::mojom::MojoCompositorFrameSinkPtrInfo compositor_frame_sink_info_;
63 cc::mojom::MojoCompositorFrameSinkClientRequest client_request_; 65 cc::mojom::MojoCompositorFrameSinkClientRequest client_request_;
64 cc::mojom::MojoCompositorFrameSinkPtr compositor_frame_sink_; 66 cc::mojom::MojoCompositorFrameSinkPtr compositor_frame_sink_;
65 std::unique_ptr<mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient>> 67 std::unique_ptr<mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient>>
66 client_binding_; 68 client_binding_;
67 std::unique_ptr<base::ThreadChecker> thread_checker_; 69 std::unique_ptr<base::ThreadChecker> thread_checker_;
70 const cc::FrameSinkId frame_sink_id_;
68 71
69 DISALLOW_COPY_AND_ASSIGN(WindowCompositorFrameSink); 72 DISALLOW_COPY_AND_ASSIGN(WindowCompositorFrameSink);
70 }; 73 };
71 74
72 // A WindowCompositorFrameSinkBinding is a bundle of mojo interfaces that is 75 // A WindowCompositorFrameSinkBinding is a bundle of mojo interfaces that is
73 // created by WindowCompositorFrameSink::Create and is used by or implemented by 76 // created by WindowCompositorFrameSink::Create and is used by or implemented by
74 // Mus when passed into Window::AttachCompositorFrameSink. 77 // Mus when passed into Window::AttachCompositorFrameSink.
75 // WindowCompositorFrameSinkBinding has no standalone functionality. Its purpose 78 // WindowCompositorFrameSinkBinding has no standalone functionality. Its purpose
76 // is to allow safely creating and attaching a CompositorFrameSink on one 79 // is to allow safely creating and attaching a CompositorFrameSink on one
77 // thread and using it on another. 80 // thread and using it on another.
(...skipping 11 matching lines...) Expand all
89 compositor_frame_sink_client); 92 compositor_frame_sink_client);
90 93
91 cc::mojom::MojoCompositorFrameSinkRequest compositor_frame_sink_request_; 94 cc::mojom::MojoCompositorFrameSinkRequest compositor_frame_sink_request_;
92 cc::mojom::MojoCompositorFrameSinkClientPtrInfo compositor_frame_sink_client_; 95 cc::mojom::MojoCompositorFrameSinkClientPtrInfo compositor_frame_sink_client_;
93 96
94 DISALLOW_COPY_AND_ASSIGN(WindowCompositorFrameSinkBinding); 97 DISALLOW_COPY_AND_ASSIGN(WindowCompositorFrameSinkBinding);
95 }; 98 };
96 } // namespace ui 99 } // namespace ui
97 100
98 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_COMPOSITOR_FRAME_SINK_H_ 101 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_COMPOSITOR_FRAME_SINK_H_
OLDNEW
« no previous file with comments | « services/ui/public/cpp/window.cc ('k') | services/ui/public/cpp/window_compositor_frame_sink.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698