Index: content/common/webkitplatformsupport_impl.cc |
diff --git a/content/common/webkitplatformsupport_impl.cc b/content/common/webkitplatformsupport_impl.cc |
index 3a32adf1f27cb7df91fc0a80c8eba418d020937c..2ab541bb176a08acf8ef821afebfbcfc0a437725 100644 |
--- a/content/common/webkitplatformsupport_impl.cc |
+++ b/content/common/webkitplatformsupport_impl.cc |
@@ -2,10 +2,14 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+#include "base/command_line.h" |
#include "content/common/child_thread.h" |
+#include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
#include "content/common/socket_stream_dispatcher.h" |
#include "content/common/webkitplatformsupport_impl.h" |
#include "content/public/common/content_client.h" |
+#include "content/public/common/content_switches.h" |
+#include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" |
namespace content { |
@@ -46,4 +50,23 @@ WebKitPlatformSupportImpl::CreateWebSocketBridge( |
return dispatcher->CreateBridge(handle, delegate); |
} |
+WebKit::WebGraphicsContext3D* |
+WebKitPlatformSupportImpl::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. |
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { |
+ return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( |
+ attributes, false); |
+ } else { |
+ base::WeakPtr<WebGraphicsContext3DSwapBuffersClient> null_client; |
+ scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( |
+ new WebGraphicsContext3DCommandBufferImpl(0, GURL(), null_client)); |
+ if (!context->Initialize(attributes)) |
+ return NULL; |
+ return context.release(); |
+ } |
+} |
+ |
} // namespace content |