Index: content/renderer/renderer_webkitplatformsupport_impl.cc |
diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc |
index 850166d7663cb5613989f4815c289979a8a2334f..a3d045c3d66c86a5426f2b8145f6a78eb4669268 100644 |
--- a/content/renderer/renderer_webkitplatformsupport_impl.cc |
+++ b/content/renderer/renderer_webkitplatformsupport_impl.cc |
@@ -81,6 +81,7 @@ |
#if defined(OS_ANDROID) |
#include "content/renderer/android/synchronous_compositor_factory.h" |
#include "content/renderer/media/android/audio_decoder_android.h" |
+#include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" |
#endif |
#if defined(OS_MACOSX) |
@@ -952,30 +953,29 @@ RendererWebKitPlatformSupportImpl::createOffscreenGraphicsContext3D( |
if (!RenderThreadImpl::current()) |
return NULL; |
- scoped_ptr<webkit::gpu::WebGraphicsContext3DImpl> context; |
- bool must_use_synchronous_factory = false; |
#if defined(OS_ANDROID) |
+ scoped_ptr<webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl> |
+ context; |
if (SynchronousCompositorFactory* factory = |
SynchronousCompositorFactory::GetInstance()) { |
context.reset(factory->CreateOffscreenGraphicsContext3D(attributes)); |
- must_use_synchronous_factory = true; |
} |
jamesr
2014/09/29 18:00:57
this is not correct.
in the previous code on OS_A
|
+#else |
+ scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context; |
+ scoped_refptr<GpuChannelHost> gpu_channel_host( |
+ RenderThreadImpl::current()->EstablishGpuChannelSync( |
+ CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)); |
+ |
+ WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; |
+ bool lose_context_when_out_of_memory = false; |
+ context.reset(WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( |
+ gpu_channel_host.get(), |
+ attributes, |
+ lose_context_when_out_of_memory, |
+ GURL(attributes.topDocumentURL), |
+ limits, |
+ static_cast<WebGraphicsContext3DCommandBufferImpl*>(share_context))); |
#endif |
- if (!must_use_synchronous_factory) { |
- scoped_refptr<GpuChannelHost> gpu_channel_host( |
- RenderThreadImpl::current()->EstablishGpuChannelSync( |
- CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)); |
- |
- WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; |
- bool lose_context_when_out_of_memory = false; |
- context.reset(WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( |
- gpu_channel_host.get(), |
- attributes, |
- lose_context_when_out_of_memory, |
- GURL(attributes.topDocumentURL), |
- limits, |
- static_cast<WebGraphicsContext3DCommandBufferImpl*>(share_context))); |
- } |
// Most likely the GPU process exited and the attempt to reconnect to it |
// failed. Need to try to restore the context again later. |
if (!context || !context->InitializeOnCurrentThread()) |