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 CHROME_BROWSER_ANDROID_BLIMP_CHROME_COMPOSITOR_DEPENDENCIES_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_BLIMP_CHROME_COMPOSITOR_DEPENDENCIES_H_ |
6 #define CHROME_BROWSER_ANDROID_BLIMP_CHROME_COMPOSITOR_DEPENDENCIES_H_ | 6 #define CHROME_BROWSER_ANDROID_BLIMP_CHROME_COMPOSITOR_DEPENDENCIES_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "blimp/client/public/compositor/compositor_dependencies.h" | 10 #include "blimp/client/public/compositor/compositor_dependencies.h" |
11 #include "ui/android/context_provider_factory.h" | 11 #include "ui/android/context_provider_factory.h" |
12 | 12 |
13 // A wrapper for the Blimp compositor dependencies that passes through to the | 13 // A wrapper for the Blimp compositor dependencies that passes through to the |
14 // ui::ContextProviderFactory. The ContextProviderFactory must outlive this | 14 // ui::ContextProviderFactory. The ContextProviderFactory must outlive this |
15 // class. | 15 // class. |
16 class ChromeCompositorDependencies | 16 class ChromeCompositorDependencies |
17 : public blimp::client::CompositorDependencies { | 17 : public blimp::client::CompositorDependencies { |
18 public: | 18 public: |
19 ChromeCompositorDependencies( | 19 ChromeCompositorDependencies( |
20 ui::ContextProviderFactory* context_provider_factory); | 20 ui::ContextProviderFactory* context_provider_factory); |
21 ~ChromeCompositorDependencies() override; | 21 ~ChromeCompositorDependencies() override; |
22 | 22 |
23 // CompositorDependencies implementation. | 23 // CompositorDependencies implementation. |
24 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; | 24 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; |
25 cc::SurfaceManager* GetSurfaceManager() override; | 25 cc::SurfaceManager* GetSurfaceManager() override; |
26 uint32_t AllocateSurfaceClientId() override; | 26 cc::FrameSinkId AllocateFrameSinkId() override; |
27 void GetContextProviders(const ContextProviderCallback& callback) override; | 27 void GetContextProviders(const ContextProviderCallback& callback) override; |
28 | 28 |
29 private: | 29 private: |
30 void OnGpuChannelEstablished( | 30 void OnGpuChannelEstablished( |
31 const ContextProviderCallback& callback, | 31 const ContextProviderCallback& callback, |
32 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host, | 32 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host, |
33 ui::ContextProviderFactory::GpuChannelHostResult result); | 33 ui::ContextProviderFactory::GpuChannelHostResult result); |
34 | 34 |
35 void HandlePendingRequests(gpu::GpuChannelHost* gpu_channel_host); | 35 void HandlePendingRequests(gpu::GpuChannelHost* gpu_channel_host); |
36 | 36 |
37 ui::ContextProviderFactory* context_provider_factory_; | 37 ui::ContextProviderFactory* context_provider_factory_; |
38 | 38 |
39 // Worker context shared across all Blimp Compositors. | 39 // Worker context shared across all Blimp Compositors. |
40 scoped_refptr<cc::ContextProvider> shared_main_thread_worker_context_; | 40 scoped_refptr<cc::ContextProvider> shared_main_thread_worker_context_; |
41 | 41 |
42 base::WeakPtrFactory<ChromeCompositorDependencies> weak_factory_; | 42 base::WeakPtrFactory<ChromeCompositorDependencies> weak_factory_; |
43 | 43 |
44 DISALLOW_COPY_AND_ASSIGN(ChromeCompositorDependencies); | 44 DISALLOW_COPY_AND_ASSIGN(ChromeCompositorDependencies); |
45 }; | 45 }; |
46 | 46 |
47 #endif // CHROME_BROWSER_ANDROID_BLIMP_CHROME_COMPOSITOR_DEPENDENCIES_H_ | 47 #endif // CHROME_BROWSER_ANDROID_BLIMP_CHROME_COMPOSITOR_DEPENDENCIES_H_ |
OLD | NEW |