OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 BLIMP_CLIENT_PUBLIC_COMPOSITOR_COMPOSITOR_DEPENDENCIES_H_ | 5 #ifndef BLIMP_CLIENT_PUBLIC_COMPOSITOR_COMPOSITOR_DEPENDENCIES_H_ |
6 #define BLIMP_CLIENT_PUBLIC_COMPOSITOR_COMPOSITOR_DEPENDENCIES_H_ | 6 #define BLIMP_CLIENT_PUBLIC_COMPOSITOR_COMPOSITOR_DEPENDENCIES_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "cc/surfaces/frame_sink_id.h" |
10 | 11 |
11 namespace cc { | 12 namespace cc { |
12 class ContextProvider; | 13 class ContextProvider; |
13 class SurfaceManager; | 14 class SurfaceManager; |
14 } // namespace cc | 15 } // namespace cc |
15 | 16 |
16 namespace gpu { | 17 namespace gpu { |
17 class GpuMemoryBufferManager; | 18 class GpuMemoryBufferManager; |
18 } // namespace gpu | 19 } // namespace gpu |
19 | 20 |
20 namespace blimp { | 21 namespace blimp { |
21 namespace client { | 22 namespace client { |
22 | 23 |
23 // A set of compositor dependencies that must be provided by the embedder. This | 24 // A set of compositor dependencies that must be provided by the embedder. This |
24 // is expected to outlive all BlimpContents instances. | 25 // is expected to outlive all BlimpContents instances. |
25 class CompositorDependencies { | 26 class CompositorDependencies { |
26 public: | 27 public: |
27 using ContextProviderCallback = base::Callback<void( | 28 using ContextProviderCallback = base::Callback<void( |
28 const scoped_refptr<cc::ContextProvider>& compositor_context_provider, | 29 const scoped_refptr<cc::ContextProvider>& compositor_context_provider, |
29 const scoped_refptr<cc::ContextProvider>& worker_context_provider)>; | 30 const scoped_refptr<cc::ContextProvider>& worker_context_provider)>; |
30 | 31 |
31 virtual ~CompositorDependencies() = default; | 32 virtual ~CompositorDependencies() = default; |
32 | 33 |
33 // Settings used to create all BlimpCompositor instances. | 34 // Settings used to create all BlimpCompositor instances. |
34 virtual gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() = 0; | 35 virtual gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() = 0; |
35 virtual cc::SurfaceManager* GetSurfaceManager() = 0; | 36 virtual cc::SurfaceManager* GetSurfaceManager() = 0; |
36 virtual uint32_t AllocateSurfaceClientId() = 0; | 37 virtual cc::FrameSinkId AllocateFrameSinkId() = 0; |
37 | 38 |
38 // This call may return synchronously if the ContextProvider has already been | 39 // This call may return synchronously if the ContextProvider has already been |
39 // created. | 40 // created. |
40 virtual void GetContextProviders(const ContextProviderCallback& callback) = 0; | 41 virtual void GetContextProviders(const ContextProviderCallback& callback) = 0; |
41 }; | 42 }; |
42 | 43 |
43 } // namespace client | 44 } // namespace client |
44 } // namespace blimp | 45 } // namespace blimp |
45 | 46 |
46 #endif // BLIMP_CLIENT_PUBLIC_COMPOSITOR_COMPOSITOR_DEPENDENCIES_H_ | 47 #endif // BLIMP_CLIENT_PUBLIC_COMPOSITOR_COMPOSITOR_DEPENDENCIES_H_ |
OLD | NEW |