| 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 "webkit/support/webkit_support.h" | 5 #include "webkit/support/webkit_support.h" |
| 6 | 6 |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/base64.h" | 8 #include "base/base64.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 g_graphics_context_3d_implementation = impl; | 436 g_graphics_context_3d_implementation = impl; |
| 437 } | 437 } |
| 438 | 438 |
| 439 GraphicsContext3DImplementation GetGraphicsContext3DImplementation() { | 439 GraphicsContext3DImplementation GetGraphicsContext3DImplementation() { |
| 440 return g_graphics_context_3d_implementation; | 440 return g_graphics_context_3d_implementation; |
| 441 } | 441 } |
| 442 | 442 |
| 443 WebKit::WebGraphicsContext3D* CreateGraphicsContext3D( | 443 WebKit::WebGraphicsContext3D* CreateGraphicsContext3D( |
| 444 const WebKit::WebGraphicsContext3D::Attributes& attributes, | 444 const WebKit::WebGraphicsContext3D::Attributes& attributes, |
| 445 WebKit::WebView* web_view) { | 445 WebKit::WebView* web_view) { |
| 446 return CreateGraphicsContext3D(attributes, web_view, true); | |
| 447 } | |
| 448 | |
| 449 WebKit::WebGraphicsContext3D* CreateGraphicsContext3D( | |
| 450 const WebKit::WebGraphicsContext3D::Attributes& attributes, | |
| 451 WebKit::WebView* web_view, | |
| 452 bool direct) { | |
| 453 switch (webkit_support::GetGraphicsContext3DImplementation()) { | 446 switch (webkit_support::GetGraphicsContext3DImplementation()) { |
| 454 case webkit_support::IN_PROCESS: | 447 case webkit_support::IN_PROCESS: |
| 455 return WebGraphicsContext3DInProcessImpl::CreateForWebView( | 448 return WebGraphicsContext3DInProcessImpl::CreateForWebView( |
| 456 attributes, direct); | 449 attributes, true /* direct */); |
| 457 case webkit_support::IN_PROCESS_COMMAND_BUFFER: { | 450 case webkit_support::IN_PROCESS_COMMAND_BUFFER: { |
| 458 WebKit::WebGraphicsContext3D* view_context = 0; | |
| 459 if (!direct) | |
| 460 view_context = web_view->graphicsContext3D(); | |
| 461 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context( | 451 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context( |
| 462 new WebGraphicsContext3DInProcessCommandBufferImpl()); | 452 new WebGraphicsContext3DInProcessCommandBufferImpl()); |
| 463 if (!context->Initialize(attributes, view_context)) | 453 if (!context->Initialize(attributes, NULL)) |
| 464 return NULL; | 454 return NULL; |
| 465 return context.release(); | 455 return context.release(); |
| 466 } | 456 } |
| 467 } | 457 } |
| 468 NOTREACHED(); | 458 NOTREACHED(); |
| 469 return NULL; | 459 return NULL; |
| 470 } | 460 } |
| 471 | 461 |
| 472 void RegisterMockedURL(const WebKit::WebURL& url, | 462 void RegisterMockedURL(const WebKit::WebURL& url, |
| 473 const WebKit::WebURLResponse& response, | 463 const WebKit::WebURLResponse& response, |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 // Logging | 797 // Logging |
| 808 void EnableWebCoreLogChannels(const std::string& channels) { | 798 void EnableWebCoreLogChannels(const std::string& channels) { |
| 809 webkit_glue::EnableWebCoreLogChannels(channels); | 799 webkit_glue::EnableWebCoreLogChannels(channels); |
| 810 } | 800 } |
| 811 | 801 |
| 812 void SetGamepadData(const WebKit::WebGamepads& pads) { | 802 void SetGamepadData(const WebKit::WebGamepads& pads) { |
| 813 test_environment->webkit_platform_support()->setGamepadData(pads); | 803 test_environment->webkit_platform_support()->setGamepadData(pads); |
| 814 } | 804 } |
| 815 | 805 |
| 816 } // namespace webkit_support | 806 } // namespace webkit_support |
| OLD | NEW |