OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
| 5 #include "base/command_line.h" |
5 #include "content/common/child_thread.h" | 6 #include "content/common/child_thread.h" |
| 7 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
6 #include "content/common/socket_stream_dispatcher.h" | 8 #include "content/common/socket_stream_dispatcher.h" |
7 #include "content/common/webkitplatformsupport_impl.h" | 9 #include "content/common/webkitplatformsupport_impl.h" |
8 #include "content/public/common/content_client.h" | 10 #include "content/public/common/content_client.h" |
| 11 #include "content/public/common/content_switches.h" |
| 12 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" |
9 | 13 |
10 namespace content { | 14 namespace content { |
11 | 15 |
12 WebKitPlatformSupportImpl::WebKitPlatformSupportImpl() { | 16 WebKitPlatformSupportImpl::WebKitPlatformSupportImpl() { |
13 } | 17 } |
14 | 18 |
15 WebKitPlatformSupportImpl::~WebKitPlatformSupportImpl() { | 19 WebKitPlatformSupportImpl::~WebKitPlatformSupportImpl() { |
16 } | 20 } |
17 | 21 |
18 string16 WebKitPlatformSupportImpl::GetLocalizedString(int message_id) { | 22 string16 WebKitPlatformSupportImpl::GetLocalizedString(int message_id) { |
(...skipping 20 matching lines...) Expand all Loading... |
39 | 43 |
40 webkit_glue::WebSocketStreamHandleBridge* | 44 webkit_glue::WebSocketStreamHandleBridge* |
41 WebKitPlatformSupportImpl::CreateWebSocketBridge( | 45 WebKitPlatformSupportImpl::CreateWebSocketBridge( |
42 WebKit::WebSocketStreamHandle* handle, | 46 WebKit::WebSocketStreamHandle* handle, |
43 webkit_glue::WebSocketStreamHandleDelegate* delegate) { | 47 webkit_glue::WebSocketStreamHandleDelegate* delegate) { |
44 SocketStreamDispatcher* dispatcher = | 48 SocketStreamDispatcher* dispatcher = |
45 ChildThread::current()->socket_stream_dispatcher(); | 49 ChildThread::current()->socket_stream_dispatcher(); |
46 return dispatcher->CreateBridge(handle, delegate); | 50 return dispatcher->CreateBridge(handle, delegate); |
47 } | 51 } |
48 | 52 |
| 53 WebKit::WebGraphicsContext3D* |
| 54 WebKitPlatformSupportImpl::createOffscreenGraphicsContext3D( |
| 55 const WebGraphicsContext3D::Attributes& attributes) { |
| 56 // The WebGraphicsContext3DInProcessImpl code path is used for |
| 57 // layout tests (though not through this code) as well as for |
| 58 // debugging and bringing up new ports. |
| 59 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { |
| 60 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( |
| 61 attributes, false); |
| 62 } else { |
| 63 base::WeakPtr<WebGraphicsContext3DSwapBuffersClient> null_client; |
| 64 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( |
| 65 new WebGraphicsContext3DCommandBufferImpl(0, GURL(), null_client)); |
| 66 if (!context->Initialize(attributes)) |
| 67 return NULL; |
| 68 return context.release(); |
| 69 } |
| 70 } |
| 71 |
49 } // namespace content | 72 } // namespace content |
OLD | NEW |