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

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

Powered by Google App Engine
This is Rietveld 408576698