Index: content/renderer/renderer_webkitplatformsupport_impl.cc |
diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc |
index 80bb6fa3ef664a166e7bb60a761019a8cdc462ef..7e0f79603dbfe4fa535ee2c399189a0ebf55b4ad 100644 |
--- a/content/renderer/renderer_webkitplatformsupport_impl.cc |
+++ b/content/renderer/renderer_webkitplatformsupport_impl.cc |
@@ -581,6 +581,28 @@ RendererWebKitPlatformSupportImpl::createGraphicsContext3D() { |
} |
} |
+WebKit::WebGraphicsContext3D* |
+RendererWebKitPlatformSupportImpl::createOffscreenGraphicsContext3D( |
+ const WebGraphicsContext3D::Attributes& attributes) { |
+ // The WebGraphicsContext3DInProcessImpl code path is used for |
+ // layout tests (though not through this code) as well as for |
+ // debugging and bringing up new ports. |
+ scoped_ptr<WebGraphicsContext3D> context; |
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { |
+ context.reset(new webkit::gpu::WebGraphicsContext3DInProcessImpl( |
+ gfx::kNullPluginWindow, NULL)); |
+ } else { |
+#if defined(ENABLE_GPU) |
+ context.reset(new WebGraphicsContext3DCommandBufferImpl()); |
+#else |
+ return NULL; |
+#endif |
+ } |
+ if (!context->initialize(attributes, NULL, false)) |
+ return NULL; |
+ return context.release(); |
+} |
+ |
double RendererWebKitPlatformSupportImpl::audioHardwareSampleRate() { |
return audio_hardware::GetOutputSampleRate(); |
} |