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 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 gfx::kNullPluginWindow, NULL); | 574 gfx::kNullPluginWindow, NULL); |
575 } else { | 575 } else { |
576 #if defined(ENABLE_GPU) | 576 #if defined(ENABLE_GPU) |
577 return new WebGraphicsContext3DCommandBufferImpl(); | 577 return new WebGraphicsContext3DCommandBufferImpl(); |
578 #else | 578 #else |
579 return NULL; | 579 return NULL; |
580 #endif | 580 #endif |
581 } | 581 } |
582 } | 582 } |
583 | 583 |
| 584 WebKit::WebGraphicsContext3D* |
| 585 RendererWebKitPlatformSupportImpl::createOffscreenGraphicsContext3D( |
| 586 const WebGraphicsContext3D::Attributes& attributes) { |
| 587 // The WebGraphicsContext3DInProcessImpl code path is used for |
| 588 // layout tests (though not through this code) as well as for |
| 589 // debugging and bringing up new ports. |
| 590 scoped_ptr<WebGraphicsContext3D> context; |
| 591 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { |
| 592 context.reset(new webkit::gpu::WebGraphicsContext3DInProcessImpl( |
| 593 gfx::kNullPluginWindow, NULL)); |
| 594 } else { |
| 595 #if defined(ENABLE_GPU) |
| 596 context.reset(new WebGraphicsContext3DCommandBufferImpl()); |
| 597 #else |
| 598 return NULL; |
| 599 #endif |
| 600 } |
| 601 if (!context->initialize(attributes, NULL, false)) |
| 602 return NULL; |
| 603 return context.release(); |
| 604 } |
| 605 |
584 double RendererWebKitPlatformSupportImpl::audioHardwareSampleRate() { | 606 double RendererWebKitPlatformSupportImpl::audioHardwareSampleRate() { |
585 return audio_hardware::GetOutputSampleRate(); | 607 return audio_hardware::GetOutputSampleRate(); |
586 } | 608 } |
587 | 609 |
588 size_t RendererWebKitPlatformSupportImpl::audioHardwareBufferSize() { | 610 size_t RendererWebKitPlatformSupportImpl::audioHardwareBufferSize() { |
589 return audio_hardware::GetOutputBufferSize(); | 611 return audio_hardware::GetOutputBufferSize(); |
590 } | 612 } |
591 | 613 |
592 WebAudioDevice* | 614 WebAudioDevice* |
593 RendererWebKitPlatformSupportImpl::createAudioDevice( | 615 RendererWebKitPlatformSupportImpl::createAudioDevice( |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 RendererWebKitPlatformSupportImpl::createPeerConnectionHandler( | 676 RendererWebKitPlatformSupportImpl::createPeerConnectionHandler( |
655 WebKit::WebPeerConnectionHandlerClient* client) { | 677 WebKit::WebPeerConnectionHandlerClient* client) { |
656 WebFrame* web_frame = WebFrame::frameForCurrentContext(); | 678 WebFrame* web_frame = WebFrame::frameForCurrentContext(); |
657 if (!web_frame) | 679 if (!web_frame) |
658 return NULL; | 680 return NULL; |
659 RenderViewImpl* render_view = RenderViewImpl::FromWebView(web_frame->view()); | 681 RenderViewImpl* render_view = RenderViewImpl::FromWebView(web_frame->view()); |
660 if (!render_view) | 682 if (!render_view) |
661 return NULL; | 683 return NULL; |
662 return render_view->CreatePeerConnectionHandler(client); | 684 return render_view->CreatePeerConnectionHandler(client); |
663 } | 685 } |
OLD | NEW |