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

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

Issue 10828088: aura: use TestWebGraphicsContext3D for the shared contexts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win fix Created 8 years, 4 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/command_line.h"
6 #include "content/common/child_thread.h" 6 #include "content/common/child_thread.h"
7 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" 7 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
8 #include "content/common/socket_stream_dispatcher.h" 8 #include "content/common/socket_stream_dispatcher.h"
9 #include "content/common/webkitplatformsupport_impl.h" 9 #include "content/common/webkitplatformsupport_impl.h"
10 #include "content/public/common/content_client.h" 10 #include "content/public/common/content_client.h"
11 #include "content/public/common/content_switches.h" 11 #include "content/public/common/content_switches.h"
12 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" 12 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 namespace {
17 WebKitPlatformSupportImpl::OffscreenContextFactory* g_context_factory = NULL;
18 }
19
16 WebKitPlatformSupportImpl::WebKitPlatformSupportImpl() { 20 WebKitPlatformSupportImpl::WebKitPlatformSupportImpl() {
17 } 21 }
18 22
19 WebKitPlatformSupportImpl::~WebKitPlatformSupportImpl() { 23 WebKitPlatformSupportImpl::~WebKitPlatformSupportImpl() {
20 } 24 }
21 25
22 string16 WebKitPlatformSupportImpl::GetLocalizedString(int message_id) { 26 string16 WebKitPlatformSupportImpl::GetLocalizedString(int message_id) {
23 return content::GetContentClient()->GetLocalizedString(message_id); 27 return content::GetContentClient()->GetLocalizedString(message_id);
24 } 28 }
25 29
(...skipping 22 matching lines...) Expand all
48 WebKit::WebSocketStreamHandle* handle, 52 WebKit::WebSocketStreamHandle* handle,
49 webkit_glue::WebSocketStreamHandleDelegate* delegate) { 53 webkit_glue::WebSocketStreamHandleDelegate* delegate) {
50 SocketStreamDispatcher* dispatcher = 54 SocketStreamDispatcher* dispatcher =
51 ChildThread::current()->socket_stream_dispatcher(); 55 ChildThread::current()->socket_stream_dispatcher();
52 return dispatcher->CreateBridge(handle, delegate); 56 return dispatcher->CreateBridge(handle, delegate);
53 } 57 }
54 58
55 WebKit::WebGraphicsContext3D* 59 WebKit::WebGraphicsContext3D*
56 WebKitPlatformSupportImpl::createOffscreenGraphicsContext3D( 60 WebKitPlatformSupportImpl::createOffscreenGraphicsContext3D(
57 const WebGraphicsContext3D::Attributes& attributes) { 61 const WebGraphicsContext3D::Attributes& attributes) {
62 if (g_context_factory)
63 return g_context_factory();
58 // The WebGraphicsContext3DInProcessImpl code path is used for 64 // The WebGraphicsContext3DInProcessImpl code path is used for
59 // layout tests (though not through this code) as well as for 65 // layout tests (though not through this code) as well as for
60 // debugging and bringing up new ports. 66 // debugging and bringing up new ports.
61 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { 67 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) {
62 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( 68 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView(
63 attributes, false); 69 attributes, false);
64 } else { 70 } else {
65 // Intentionally blank URL provided for offscreen contexts -- blank URLs are 71 // Intentionally blank URL provided for offscreen contexts -- blank URLs are
66 // ignored in the GPU process for crash reporting. 72 // ignored in the GPU process for crash reporting.
67 return WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( 73 return WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext(
68 GetGpuChannelHostFactory(), attributes, GURL()); 74 GetGpuChannelHostFactory(), attributes, GURL());
69 } 75 }
70 } 76 }
71 77
78 // static
79 void WebKitPlatformSupportImpl::SetOffscreenContextFactoryForTest(
80 OffscreenContextFactory factory) {
81 g_context_factory = factory;
82 }
83
72 GpuChannelHostFactory* WebKitPlatformSupportImpl::GetGpuChannelHostFactory() { 84 GpuChannelHostFactory* WebKitPlatformSupportImpl::GetGpuChannelHostFactory() {
73 NOTREACHED(); 85 NOTREACHED();
74 return NULL; 86 return NULL;
75 } 87 }
76 88
77 } // namespace content 89 } // namespace content
OLDNEW
« no previous file with comments | « content/common/webkitplatformsupport_impl.h ('k') | ui/compositor/test_web_graphics_context_3d.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698