| 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 "content/renderer/renderer_webkitplatformsupport_impl.h" | 5 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 WebKit::WebGraphicsContext3D* | 566 WebKit::WebGraphicsContext3D* |
| 567 RendererWebKitPlatformSupportImpl::createOffscreenGraphicsContext3D( | 567 RendererWebKitPlatformSupportImpl::createOffscreenGraphicsContext3D( |
| 568 const WebGraphicsContext3D::Attributes& attributes) { | 568 const WebGraphicsContext3D::Attributes& attributes) { |
| 569 // The WebGraphicsContext3DInProcessImpl code path is used for | 569 // The WebGraphicsContext3DInProcessImpl code path is used for |
| 570 // layout tests (though not through this code) as well as for | 570 // layout tests (though not through this code) as well as for |
| 571 // debugging and bringing up new ports. | 571 // debugging and bringing up new ports. |
| 572 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { | 572 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { |
| 573 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( | 573 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( |
| 574 attributes, NULL, false); | 574 attributes, NULL, false); |
| 575 } else { | 575 } else { |
| 576 scoped_ptr<WebGraphicsContext3D> context; | 576 base::WeakPtr<WebGraphicsContext3DSwapBuffersClient> null_client; |
| 577 context.reset(new WebGraphicsContext3DCommandBufferImpl()); | 577 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( |
| 578 if (!context->initialize(attributes, NULL, false)) | 578 new WebGraphicsContext3DCommandBufferImpl(0, GURL(), null_client)); |
| 579 if (!context->Initialize(attributes)) |
| 579 return NULL; | 580 return NULL; |
| 580 return context.release(); | 581 return context.release(); |
| 581 } | 582 } |
| 582 } | 583 } |
| 583 | 584 |
| 584 double RendererWebKitPlatformSupportImpl::audioHardwareSampleRate() { | 585 double RendererWebKitPlatformSupportImpl::audioHardwareSampleRate() { |
| 585 return audio_hardware::GetOutputSampleRate(); | 586 return audio_hardware::GetOutputSampleRate(); |
| 586 } | 587 } |
| 587 | 588 |
| 588 size_t RendererWebKitPlatformSupportImpl::audioHardwareBufferSize() { | 589 size_t RendererWebKitPlatformSupportImpl::audioHardwareBufferSize() { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 RendererWebKitPlatformSupportImpl::createPeerConnectionHandler( | 655 RendererWebKitPlatformSupportImpl::createPeerConnectionHandler( |
| 655 WebKit::WebPeerConnectionHandlerClient* client) { | 656 WebKit::WebPeerConnectionHandlerClient* client) { |
| 656 WebFrame* web_frame = WebFrame::frameForCurrentContext(); | 657 WebFrame* web_frame = WebFrame::frameForCurrentContext(); |
| 657 if (!web_frame) | 658 if (!web_frame) |
| 658 return NULL; | 659 return NULL; |
| 659 RenderViewImpl* render_view = RenderViewImpl::FromWebView(web_frame->view()); | 660 RenderViewImpl* render_view = RenderViewImpl::FromWebView(web_frame->view()); |
| 660 if (!render_view) | 661 if (!render_view) |
| 661 return NULL; | 662 return NULL; |
| 662 return render_view->CreatePeerConnectionHandler(client); | 663 return render_view->CreatePeerConnectionHandler(client); |
| 663 } | 664 } |
| OLD | NEW |