OLD | NEW |
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 "webkit/support/test_webkit_platform_support.h" | 5 #include "webkit/support/test_webkit_platform_support.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/metrics/stats_counters.h" | 8 #include "base/metrics/stats_counters.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 return new webkit::gpu::WebGraphicsContext3DInProcessImpl( | 380 return new webkit::gpu::WebGraphicsContext3DInProcessImpl( |
381 gfx::kNullPluginWindow, NULL); | 381 gfx::kNullPluginWindow, NULL); |
382 case webkit_support::IN_PROCESS_COMMAND_BUFFER: | 382 case webkit_support::IN_PROCESS_COMMAND_BUFFER: |
383 return new webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl(); | 383 return new webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl(); |
384 default: | 384 default: |
385 CHECK(false) << "Unknown GraphicsContext3D Implementation"; | 385 CHECK(false) << "Unknown GraphicsContext3D Implementation"; |
386 return NULL; | 386 return NULL; |
387 } | 387 } |
388 } | 388 } |
389 | 389 |
| 390 WebKit::WebGraphicsContext3D* |
| 391 TestWebKitPlatformSupport::createOffscreenGraphicsContext3D( |
| 392 const WebKit::WebGraphicsContext3D::Attributes& attributes) { |
| 393 scoped_ptr<WebKit::WebGraphicsContext3D> context; |
| 394 switch (webkit_support::GetGraphicsContext3DImplementation()) { |
| 395 case webkit_support::IN_PROCESS: |
| 396 context.reset(new webkit::gpu::WebGraphicsContext3DInProcessImpl( |
| 397 gfx::kNullPluginWindow, NULL)); |
| 398 break; |
| 399 case webkit_support::IN_PROCESS_COMMAND_BUFFER: |
| 400 context.reset( |
| 401 new webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl()); |
| 402 break; |
| 403 } |
| 404 if (!context->initialize(attributes, NULL, false)) |
| 405 return NULL; |
| 406 return context.release(); |
| 407 } |
| 408 |
390 double TestWebKitPlatformSupport::audioHardwareSampleRate() { | 409 double TestWebKitPlatformSupport::audioHardwareSampleRate() { |
391 return 44100.0; | 410 return 44100.0; |
392 } | 411 } |
393 | 412 |
394 size_t TestWebKitPlatformSupport::audioHardwareBufferSize() { | 413 size_t TestWebKitPlatformSupport::audioHardwareBufferSize() { |
395 return 128; | 414 return 128; |
396 } | 415 } |
397 | 416 |
398 WebKit::WebAudioDevice* TestWebKitPlatformSupport::createAudioDevice( | 417 WebKit::WebAudioDevice* TestWebKitPlatformSupport::createAudioDevice( |
399 size_t bufferSize, unsigned numberOfChannels, double sampleRate, | 418 size_t bufferSize, unsigned numberOfChannels, double sampleRate, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { | 456 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { |
438 return SimpleResourceLoaderBridge::Create(request_info); | 457 return SimpleResourceLoaderBridge::Create(request_info); |
439 } | 458 } |
440 | 459 |
441 webkit_glue::WebSocketStreamHandleBridge* | 460 webkit_glue::WebSocketStreamHandleBridge* |
442 TestWebKitPlatformSupport::CreateWebSocketBridge( | 461 TestWebKitPlatformSupport::CreateWebSocketBridge( |
443 WebKit::WebSocketStreamHandle* handle, | 462 WebKit::WebSocketStreamHandle* handle, |
444 webkit_glue::WebSocketStreamHandleDelegate* delegate) { | 463 webkit_glue::WebSocketStreamHandleDelegate* delegate) { |
445 return SimpleSocketStreamBridge::Create(handle, delegate); | 464 return SimpleSocketStreamBridge::Create(handle, delegate); |
446 } | 465 } |
OLD | NEW |