Chromium Code Reviews| Index: chrome/browser/android/blimp/chrome_compositor_dependencies.h |
| diff --git a/chrome/browser/android/blimp/chrome_compositor_dependencies.h b/chrome/browser/android/blimp/chrome_compositor_dependencies.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..393a5b761003a5a8603a3f36b86a5c5e4593a673 |
| --- /dev/null |
| +++ b/chrome/browser/android/blimp/chrome_compositor_dependencies.h |
| @@ -0,0 +1,50 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_ANDROID_BLIMP_CHROME_COMPOSITOR_DEPENDENCIES_H_ |
| +#define CHROME_BROWSER_ANDROID_BLIMP_CHROME_COMPOSITOR_DEPENDENCIES_H_ |
| + |
| +#include <list> |
| + |
| +#include "base/macros.h" |
| +#include "base/memory/weak_ptr.h" |
| +#include "blimp/client/public/compositor/compositor_dependencies.h" |
| +#include "ui/android/context_provider_factory.h" |
| + |
| +// A wrapper for the Blimp compositor dependencies that passes through to the |
| +// ui::ContextProviderFactory. The ContextProviderFactory must outlive this |
| +// class. |
| +class ChromeCompositorDependencies |
| + : public blimp::client::CompositorDependencies { |
| + public: |
| + ChromeCompositorDependencies( |
| + ui::ContextProviderFactory* context_provider_factory); |
| + ~ChromeCompositorDependencies() override; |
| + |
| + // CompositorDependencies implementation. |
| + gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; |
| + cc::SurfaceManager* GetSurfaceManager() override; |
| + uint32_t AllocateSurfaceClientId() override; |
| + void GetContextProviders(const ContextProviderCallback& callback) override; |
| + |
| + private: |
| + void OnGpuChannelEstablished( |
| + const scoped_refptr<gpu::GpuChannelHost>& gpu_channel_host, |
| + ui::ContextProviderFactory::GpuChannelHostResult result); |
| + |
| + void HandlePendingRequests(gpu::GpuChannelHost* gpu_channel_host); |
| + |
| + ui::ContextProviderFactory* context_provider_factory_; |
| + |
| + // Worker context shared across all Blimp Compositors. |
| + scoped_refptr<cc::ContextProvider> shared_main_thread_worker_context_; |
| + |
| + 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.
|
| + |
| + base::WeakPtrFactory<ChromeCompositorDependencies> weak_factory_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ChromeCompositorDependencies); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_ANDROID_BLIMP_CHROME_COMPOSITOR_DEPENDENCIES_H_ |