Chromium Code Reviews| Index: webkit/common/gpu/context_provider_in_process.h |
| diff --git a/webkit/common/gpu/context_provider_in_process.h b/webkit/common/gpu/context_provider_in_process.h |
| index b427abeb043f6144adb281575c3af63e3218b2c7..169a1a8fdd3e6eab49eba6257e7c02199bd4904b 100644 |
| --- a/webkit/common/gpu/context_provider_in_process.h |
| +++ b/webkit/common/gpu/context_provider_in_process.h |
| @@ -19,17 +19,21 @@ class WebGraphicsContext3D; |
| namespace webkit { |
| namespace gpu { |
| class GrContextForWebGraphicsContext3D; |
| +class WebGraphicsContext3DInProcessCommandBufferImpl; |
| class WEBKIT_GPU_EXPORT ContextProviderInProcess |
| : NON_EXPORTED_BASE(public cc::ContextProvider) { |
| public: |
| - static scoped_refptr<ContextProviderInProcess> Create() { |
| - scoped_refptr<ContextProviderInProcess> provider = |
| - new ContextProviderInProcess; |
| - if (!provider->InitializeOnMainThread()) |
| - return NULL; |
| - return provider; |
| - } |
| + typedef base::Callback< |
| + scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl>(void)> |
| + CreateCallback; |
| + |
| + static scoped_refptr<ContextProviderInProcess> Create( |
| + const CreateCallback& create_callback); |
| + |
| + // Calls Create() with a default factory method for creating an offscreen |
| + // context. |
| + static scoped_refptr<ContextProviderInProcess> CreateOffscreen(); |
|
boliu
2013/08/14 04:09:27
Need to update the android-only synchronous_compos
danakj
2013/08/14 04:10:40
Ah, thanks! Done.
|
| virtual bool BindToCurrentThread() OVERRIDE; |
| virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE; |
| @@ -43,7 +47,8 @@ class WEBKIT_GPU_EXPORT ContextProviderInProcess |
| ContextProviderInProcess(); |
| virtual ~ContextProviderInProcess(); |
| - bool InitializeOnMainThread(); |
| + bool InitializeOnMainThread( |
| + const CreateCallback& create_callback); |
| void OnLostContext(); |
| void OnMemoryAllocationChanged(bool nonzero_allocation); |