Chromium Code Reviews| Index: webkit/support/webkit_support.cc |
| diff --git a/webkit/support/webkit_support.cc b/webkit/support/webkit_support.cc |
| index 1b39cb2218576b9a331c52a690c651c150b29fe2..4681b38e0733a32c22f1faec373b941ee0dd3f1e 100644 |
| --- a/webkit/support/webkit_support.cc |
| +++ b/webkit/support/webkit_support.cc |
| @@ -50,6 +50,8 @@ |
| #include "webkit/glue/webkit_constants.h" |
| #include "webkit/glue/webkit_glue.h" |
| #include "webkit/glue/webkitplatformsupport_impl.h" |
| +#include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" |
| +#include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" |
| #include "webkit/media/webmediaplayer_impl.h" |
| #include "webkit/plugins/npapi/plugin_list.h" |
| #include "webkit/plugins/npapi/webplugin_impl.h" |
| @@ -366,6 +368,29 @@ GraphicsContext3DImplementation GetGraphicsContext3DImplementation() { |
| return g_graphics_context_3d_implementation; |
| } |
| +WebKit::WebGraphicsContext3D* CreateGraphicsContext3D( |
| + WebKit::WebGraphicsContext3D::Attributes attributes, |
| + WebKit::WebView* web_view, |
| + bool direct) { |
| + scoped_ptr<WebKit::WebGraphicsContext3D> context; |
| + switch (webkit_support::GetGraphicsContext3DImplementation()) { |
| + case webkit_support::IN_PROCESS: |
| + context.reset(new webkit::gpu::WebGraphicsContext3DInProcessImpl( |
| + gfx::kNullPluginWindow, NULL)); |
| + break; |
| + case webkit_support::IN_PROCESS_COMMAND_BUFFER: |
| + context.reset( |
| + new webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl()); |
| + break; |
| + default: |
|
tony
2012/01/19 21:09:53
Nit: Remove the default. If the enum changes, you
piman
2012/01/19 21:25:20
Done.
|
| + CHECK(false) << "Unknown GraphicsContext3D Implementation"; |
| + return NULL; |
| + } |
| + if (!context->initialize(attributes, web_view, direct)) |
| + return NULL; |
| + return context.release(); |
| +} |
| + |
| void RegisterMockedURL(const WebKit::WebURL& url, |
| const WebKit::WebURLResponse& response, |
| const WebKit::WebString& file_path) { |