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

Side by Side Diff: webkit/support/test_webkit_platform_support.cc

Issue 9226036: Refactor WebGraphicsContext3DInProcess and TestWebGraphicsContext3D (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix windows build Created 8 years, 10 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
« no previous file with comments | « webkit/support/test_webkit_platform_support.h ('k') | webkit/support/webkit_support.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 return active_theme_engine_; 367 return active_theme_engine_;
368 } 368 }
369 #endif 369 #endif
370 370
371 WebKit::WebSharedWorkerRepository* 371 WebKit::WebSharedWorkerRepository*
372 TestWebKitPlatformSupport::sharedWorkerRepository() { 372 TestWebKitPlatformSupport::sharedWorkerRepository() {
373 return NULL; 373 return NULL;
374 } 374 }
375 375
376 WebKit::WebGraphicsContext3D* 376 WebKit::WebGraphicsContext3D*
377 TestWebKitPlatformSupport::createGraphicsContext3D() {
378 switch (webkit_support::GetGraphicsContext3DImplementation()) {
379 case webkit_support::IN_PROCESS:
380 return new webkit::gpu::WebGraphicsContext3DInProcessImpl(
381 gfx::kNullPluginWindow, NULL);
382 case webkit_support::IN_PROCESS_COMMAND_BUFFER:
383 return new webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl();
384 default:
385 CHECK(false) << "Unknown GraphicsContext3D Implementation";
386 return NULL;
387 }
388 }
389
390 WebKit::WebGraphicsContext3D*
391 TestWebKitPlatformSupport::createOffscreenGraphicsContext3D( 377 TestWebKitPlatformSupport::createOffscreenGraphicsContext3D(
392 const WebKit::WebGraphicsContext3D::Attributes& attributes) { 378 const WebKit::WebGraphicsContext3D::Attributes& attributes) {
393 scoped_ptr<WebKit::WebGraphicsContext3D> context;
394 switch (webkit_support::GetGraphicsContext3DImplementation()) { 379 switch (webkit_support::GetGraphicsContext3DImplementation()) {
395 case webkit_support::IN_PROCESS: 380 case webkit_support::IN_PROCESS:
396 context.reset(new webkit::gpu::WebGraphicsContext3DInProcessImpl( 381 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView(
397 gfx::kNullPluginWindow, NULL)); 382 attributes, NULL, false);
398 break; 383 case webkit_support::IN_PROCESS_COMMAND_BUFFER: {
399 case webkit_support::IN_PROCESS_COMMAND_BUFFER: 384 scoped_ptr<WebKit::WebGraphicsContext3D> context(
400 context.reset(
401 new webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl()); 385 new webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl());
402 break; 386 if (!context->initialize(attributes, NULL, false))
387 return NULL;
388 return context.release();
389 }
403 } 390 }
404 if (!context->initialize(attributes, NULL, false)) 391 NOTREACHED();
405 return NULL; 392 return NULL;
406 return context.release();
407 } 393 }
408 394
409 double TestWebKitPlatformSupport::audioHardwareSampleRate() { 395 double TestWebKitPlatformSupport::audioHardwareSampleRate() {
410 return 44100.0; 396 return 44100.0;
411 } 397 }
412 398
413 size_t TestWebKitPlatformSupport::audioHardwareBufferSize() { 399 size_t TestWebKitPlatformSupport::audioHardwareBufferSize() {
414 return 128; 400 return 128;
415 } 401 }
416 402
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { 442 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) {
457 return SimpleResourceLoaderBridge::Create(request_info); 443 return SimpleResourceLoaderBridge::Create(request_info);
458 } 444 }
459 445
460 webkit_glue::WebSocketStreamHandleBridge* 446 webkit_glue::WebSocketStreamHandleBridge*
461 TestWebKitPlatformSupport::CreateWebSocketBridge( 447 TestWebKitPlatformSupport::CreateWebSocketBridge(
462 WebKit::WebSocketStreamHandle* handle, 448 WebKit::WebSocketStreamHandle* handle,
463 webkit_glue::WebSocketStreamHandleDelegate* delegate) { 449 webkit_glue::WebSocketStreamHandleDelegate* delegate) {
464 return SimpleSocketStreamBridge::Create(handle, delegate); 450 return SimpleSocketStreamBridge::Create(handle, delegate);
465 } 451 }
OLDNEW
« no previous file with comments | « webkit/support/test_webkit_platform_support.h ('k') | webkit/support/webkit_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698