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 | |
14 namespace ui { | |
15 class ContextProviderFactory; | |
16 } // namespace ui | |
17 | |
18 // A wrapper for the Blimp compositor dependencies that passes through to the | |
19 // ui::ContextProviderFactory. The ContextProviderFactory must outlive this | |
20 // class. | |
21 class ChromeCompositorDependencies | |
22 : public blimp::client::CompositorDependencies { | |
23 public: | |
24 ChromeCompositorDependencies( | |
25 ui::ContextProviderFactory* context_provider_factory); | |
26 ~ChromeCompositorDependencies() override; | |
27 | |
28 // CompositorDependencies implementation. | |
29 cc::LayerTreeSettings* GetLayerTreeSettings() override; | |
30 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; | |
31 cc::SurfaceManager* GetSurfaceManager() override; | |
32 uint32_t AllocateSurfaceClientId() override; | |
33 void GetContextProviders(const ContextProviderCallback& callback) override; | |
34 | |
35 private: | |
36 void OnWorkerContextCreated( | |
37 const scoped_refptr<cc::ContextProvider>& worker_context); | |
38 | |
39 void HandleCompositorContextRequest(const ContextProviderCallback& callback); | |
40 | |
41 ui::ContextProviderFactory* context_provider_factory_; | |
42 | |
43 bool worker_context_request_pending_; | |
David Trainor- moved to gerrit
2016/08/31 00:28:58
Add some comments around why we're doing it this w
Khushal
2016/08/31 21:22:51
Done.
| |
44 | |
45 // Worker context shared across all Blimp Compositors. | |
46 scoped_refptr<cc::ContextProvider> shared_main_thread_worker_context_; | |
47 | |
48 std::list<ContextProviderCallback> pending_requests_; | |
49 | |
50 base::WeakPtrFactory<ChromeCompositorDependencies> weak_factory_; | |
51 | |
52 DISALLOW_COPY_AND_ASSIGN(ChromeCompositorDependencies); | |
53 }; | |
54 | |
55 #endif // CHROME_BROWSER_ANDROID_BLIMP_CHROME_COMPOSITOR_DEPENDENCIES_H_ | |
OLD | NEW |