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