OLD | NEW |
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" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 WebKitPlatformSupportImpl::createOffscreenGraphicsContext3D( | 54 WebKitPlatformSupportImpl::createOffscreenGraphicsContext3D( |
55 const WebGraphicsContext3D::Attributes& attributes) { | 55 const WebGraphicsContext3D::Attributes& attributes) { |
56 // The WebGraphicsContext3DInProcessImpl code path is used for | 56 // The WebGraphicsContext3DInProcessImpl code path is used for |
57 // layout tests (though not through this code) as well as for | 57 // layout tests (though not through this code) as well as for |
58 // debugging and bringing up new ports. | 58 // debugging and bringing up new ports. |
59 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { | 59 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { |
60 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( | 60 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( |
61 attributes, false); | 61 attributes, false); |
62 } else { | 62 } else { |
63 base::WeakPtr<WebGraphicsContext3DSwapBuffersClient> null_client; | 63 base::WeakPtr<WebGraphicsContext3DSwapBuffersClient> null_client; |
| 64 GpuChannelHostFactory* factory = GetGpuChannelHostFactory(); |
| 65 if (!factory) |
| 66 return NULL; |
64 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( | 67 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( |
65 new WebGraphicsContext3DCommandBufferImpl(0, GURL(), null_client)); | 68 new WebGraphicsContext3DCommandBufferImpl( |
| 69 0, GURL(), factory, null_client)); |
66 if (!context->Initialize(attributes)) | 70 if (!context->Initialize(attributes)) |
67 return NULL; | 71 return NULL; |
68 return context.release(); | 72 return context.release(); |
69 } | 73 } |
70 } | 74 } |
71 | 75 |
| 76 GpuChannelHostFactory* WebKitPlatformSupportImpl::GetGpuChannelHostFactory() { |
| 77 NOTREACHED(); |
| 78 return NULL; |
| 79 } |
| 80 |
72 } // namespace content | 81 } // namespace content |
OLD | NEW |