| OLD | NEW |
| 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" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 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 const cc::FrameSinkId& frame_sink_id, |
| 29 scoped_refptr<cc::ContextProvider> context_provider, | 29 scoped_refptr<cc::ContextProvider> context_provider, |
| 30 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 30 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 31 std::unique_ptr<WindowCompositorFrameSinkBinding>* | 31 std::unique_ptr<WindowCompositorFrameSinkBinding>* |
| 32 compositor_frame_sink_binding); | 32 compositor_frame_sink_binding); |
| 33 | 33 |
| 34 ~WindowCompositorFrameSink() override; | 34 ~WindowCompositorFrameSink() override; |
| 35 | 35 |
| 36 base::WeakPtr<WindowCompositorFrameSink> GetWeakPtr(); |
| 37 |
| 38 void SetLocalFrameId(const cc::LocalFrameId& local_frame_id); |
| 39 |
| 36 // cc::CompositorFrameSink implementation. | 40 // cc::CompositorFrameSink implementation. |
| 37 bool BindToClient(cc::CompositorFrameSinkClient* client) override; | 41 bool BindToClient(cc::CompositorFrameSinkClient* client) override; |
| 38 void DetachFromClient() override; | 42 void DetachFromClient() override; |
| 39 void SubmitCompositorFrame(cc::CompositorFrame frame) override; | 43 void SubmitCompositorFrame(cc::CompositorFrame frame) override; |
| 40 | 44 |
| 41 private: | 45 private: |
| 42 WindowCompositorFrameSink( | 46 WindowCompositorFrameSink( |
| 43 const cc::FrameSinkId& frame_sink_id, | 47 const cc::FrameSinkId& frame_sink_id, |
| 44 scoped_refptr<cc::ContextProvider> context_provider, | 48 scoped_refptr<cc::ContextProvider> context_provider, |
| 45 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 49 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 59 cc::LocalFrameId local_frame_id_; | 63 cc::LocalFrameId local_frame_id_; |
| 60 cc::SurfaceIdAllocator id_allocator_; | 64 cc::SurfaceIdAllocator id_allocator_; |
| 61 std::unique_ptr<cc::ExternalBeginFrameSource> begin_frame_source_; | 65 std::unique_ptr<cc::ExternalBeginFrameSource> begin_frame_source_; |
| 62 cc::mojom::MojoCompositorFrameSinkPtrInfo compositor_frame_sink_info_; | 66 cc::mojom::MojoCompositorFrameSinkPtrInfo compositor_frame_sink_info_; |
| 63 cc::mojom::MojoCompositorFrameSinkClientRequest client_request_; | 67 cc::mojom::MojoCompositorFrameSinkClientRequest client_request_; |
| 64 cc::mojom::MojoCompositorFrameSinkPtr compositor_frame_sink_; | 68 cc::mojom::MojoCompositorFrameSinkPtr compositor_frame_sink_; |
| 65 std::unique_ptr<mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient>> | 69 std::unique_ptr<mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient>> |
| 66 client_binding_; | 70 client_binding_; |
| 67 std::unique_ptr<base::ThreadChecker> thread_checker_; | 71 std::unique_ptr<base::ThreadChecker> thread_checker_; |
| 68 const cc::FrameSinkId frame_sink_id_; | 72 const cc::FrameSinkId frame_sink_id_; |
| 73 base::Optional<cc::CompositorFrame> pending_compositor_frame_; |
| 74 |
| 75 base::WeakPtrFactory<WindowCompositorFrameSink> factory_; |
| 69 | 76 |
| 70 DISALLOW_COPY_AND_ASSIGN(WindowCompositorFrameSink); | 77 DISALLOW_COPY_AND_ASSIGN(WindowCompositorFrameSink); |
| 71 }; | 78 }; |
| 72 | 79 |
| 73 // A WindowCompositorFrameSinkBinding is a bundle of mojo interfaces that is | 80 // A WindowCompositorFrameSinkBinding is a bundle of mojo interfaces that is |
| 74 // created by WindowCompositorFrameSink::Create and is used by or implemented by | 81 // created by WindowCompositorFrameSink::Create and is used by or implemented by |
| 75 // Mus when a window is attached to a frame-sink.. | 82 // Mus when a window is attached to a frame-sink.. |
| 76 // WindowCompositorFrameSinkBinding has no standalone functionality. Its purpose | 83 // WindowCompositorFrameSinkBinding has no standalone functionality. Its purpose |
| 77 // is to allow safely creating and attaching a CompositorFrameSink on one | 84 // is to allow safely creating and attaching a CompositorFrameSink on one |
| 78 // thread and using it on another. | 85 // thread and using it on another. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 92 compositor_frame_sink_client); | 99 compositor_frame_sink_client); |
| 93 | 100 |
| 94 cc::mojom::MojoCompositorFrameSinkRequest compositor_frame_sink_request_; | 101 cc::mojom::MojoCompositorFrameSinkRequest compositor_frame_sink_request_; |
| 95 cc::mojom::MojoCompositorFrameSinkClientPtrInfo compositor_frame_sink_client_; | 102 cc::mojom::MojoCompositorFrameSinkClientPtrInfo compositor_frame_sink_client_; |
| 96 | 103 |
| 97 DISALLOW_COPY_AND_ASSIGN(WindowCompositorFrameSinkBinding); | 104 DISALLOW_COPY_AND_ASSIGN(WindowCompositorFrameSinkBinding); |
| 98 }; | 105 }; |
| 99 } // namespace ui | 106 } // namespace ui |
| 100 | 107 |
| 101 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_COMPOSITOR_FRAME_SINK_H_ | 108 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_COMPOSITOR_FRAME_SINK_H_ |
| OLD | NEW |