Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: content/common/webkitplatformsupport_impl.cc

Issue 9568042: Allow browser compositor to create an offscreen context3D. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« no previous file with comments | « content/common/webkitplatformsupport_impl.h ('k') | content/renderer/renderer_webkitplatformsupport_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698