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 <list> | |
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 scoped_refptr<gpu::GpuChannelHost>& gpu_channel_host, | |
34 ui::ContextProviderFactory::GpuChannelHostResult result); | |
35 | |
36 void HandlePendingRequests(gpu::GpuChannelHost* gpu_channel_host); | |
37 | |
38 ui::ContextProviderFactory* context_provider_factory_; | |
39 | |
40 // Worker context shared across all Blimp Compositors. | |
41 scoped_refptr<cc::ContextProvider> shared_main_thread_worker_context_; | |
42 | |
43 std::list<ContextProviderCallback> pending_requests_; | |
danakj
2016/09/01 23:35:19
pls no std::list, it is sloooow cuz pointers are t
Khushal
2016/09/02 00:24:33
Good point. Cool thing, no need for this anymore.
| |
44 | |
45 base::WeakPtrFactory<ChromeCompositorDependencies> weak_factory_; | |
46 | |
47 DISALLOW_COPY_AND_ASSIGN(ChromeCompositorDependencies); | |
48 }; | |
49 | |
50 #endif // CHROME_BROWSER_ANDROID_BLIMP_CHROME_COMPOSITOR_DEPENDENCIES_H_ | |
OLD | NEW |