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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #include "ui/base/keycodes/keyboard_code_conversion_gtk.h" | 43 #include "ui/base/keycodes/keyboard_code_conversion_gtk.h" |
44 #endif | 44 #endif |
45 #include "ui/gfx/gl/gl_context.h" | 45 #include "ui/gfx/gl/gl_context.h" |
46 #include "ui/gfx/gl/gl_implementation.h" | 46 #include "ui/gfx/gl/gl_implementation.h" |
47 #include "ui/gfx/gl/gl_surface.h" | 47 #include "ui/gfx/gl/gl_surface.h" |
48 #include "webkit/appcache/web_application_cache_host_impl.h" | 48 #include "webkit/appcache/web_application_cache_host_impl.h" |
49 #include "webkit/glue/user_agent.h" | 49 #include "webkit/glue/user_agent.h" |
50 #include "webkit/glue/webkit_constants.h" | 50 #include "webkit/glue/webkit_constants.h" |
51 #include "webkit/glue/webkit_glue.h" | 51 #include "webkit/glue/webkit_glue.h" |
52 #include "webkit/glue/webkitplatformsupport_impl.h" | 52 #include "webkit/glue/webkitplatformsupport_impl.h" |
| 53 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" |
| 54 #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" |
53 #include "webkit/media/webmediaplayer_impl.h" | 55 #include "webkit/media/webmediaplayer_impl.h" |
54 #include "webkit/plugins/npapi/plugin_list.h" | 56 #include "webkit/plugins/npapi/plugin_list.h" |
55 #include "webkit/plugins/npapi/webplugin_impl.h" | 57 #include "webkit/plugins/npapi/webplugin_impl.h" |
56 #include "webkit/plugins/npapi/webplugin_page_delegate.h" | 58 #include "webkit/plugins/npapi/webplugin_page_delegate.h" |
57 #include "webkit/plugins/webplugininfo.h" | 59 #include "webkit/plugins/webplugininfo.h" |
58 #include "webkit/support/platform_support.h" | 60 #include "webkit/support/platform_support.h" |
59 #include "webkit/support/simple_database_system.h" | 61 #include "webkit/support/simple_database_system.h" |
60 #include "webkit/support/test_webkit_platform_support.h" | 62 #include "webkit/support/test_webkit_platform_support.h" |
61 #include "webkit/support/test_webplugin_page_delegate.h" | 63 #include "webkit/support/test_webplugin_page_delegate.h" |
62 #include "webkit/tools/test_shell/simple_file_system.h" | 64 #include "webkit/tools/test_shell/simple_file_system.h" |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 } | 361 } |
360 | 362 |
361 void SetGraphicsContext3DImplementation(GraphicsContext3DImplementation impl) { | 363 void SetGraphicsContext3DImplementation(GraphicsContext3DImplementation impl) { |
362 g_graphics_context_3d_implementation = impl; | 364 g_graphics_context_3d_implementation = impl; |
363 } | 365 } |
364 | 366 |
365 GraphicsContext3DImplementation GetGraphicsContext3DImplementation() { | 367 GraphicsContext3DImplementation GetGraphicsContext3DImplementation() { |
366 return g_graphics_context_3d_implementation; | 368 return g_graphics_context_3d_implementation; |
367 } | 369 } |
368 | 370 |
| 371 WebKit::WebGraphicsContext3D* CreateGraphicsContext3D( |
| 372 WebKit::WebGraphicsContext3D::Attributes attributes, |
| 373 WebKit::WebView* web_view, |
| 374 bool direct) { |
| 375 scoped_ptr<WebKit::WebGraphicsContext3D> context; |
| 376 switch (webkit_support::GetGraphicsContext3DImplementation()) { |
| 377 case webkit_support::IN_PROCESS: |
| 378 context.reset(new webkit::gpu::WebGraphicsContext3DInProcessImpl( |
| 379 gfx::kNullPluginWindow, NULL)); |
| 380 break; |
| 381 case webkit_support::IN_PROCESS_COMMAND_BUFFER: |
| 382 context.reset( |
| 383 new webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl()); |
| 384 break; |
| 385 } |
| 386 if (!context->initialize(attributes, web_view, direct)) |
| 387 return NULL; |
| 388 return context.release(); |
| 389 } |
| 390 |
369 void RegisterMockedURL(const WebKit::WebURL& url, | 391 void RegisterMockedURL(const WebKit::WebURL& url, |
370 const WebKit::WebURLResponse& response, | 392 const WebKit::WebURLResponse& response, |
371 const WebKit::WebString& file_path) { | 393 const WebKit::WebString& file_path) { |
372 test_environment->webkit_platform_support()->url_loader_factory()-> | 394 test_environment->webkit_platform_support()->url_loader_factory()-> |
373 RegisterURL(url, response, file_path); | 395 RegisterURL(url, response, file_path); |
374 } | 396 } |
375 | 397 |
376 void UnregisterMockedURL(const WebKit::WebURL& url) { | 398 void UnregisterMockedURL(const WebKit::WebURL& url) { |
377 test_environment->webkit_platform_support()->url_loader_factory()-> | 399 test_environment->webkit_platform_support()->url_loader_factory()-> |
378 UnregisterURL(url); | 400 UnregisterURL(url); |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 // Logging | 668 // Logging |
647 void EnableWebCoreLogChannels(const std::string& channels) { | 669 void EnableWebCoreLogChannels(const std::string& channels) { |
648 webkit_glue::EnableWebCoreLogChannels(channels); | 670 webkit_glue::EnableWebCoreLogChannels(channels); |
649 } | 671 } |
650 | 672 |
651 void SetGamepadData(const WebKit::WebGamepads& pads) { | 673 void SetGamepadData(const WebKit::WebGamepads& pads) { |
652 test_environment->webkit_platform_support()->setGamepadData(pads); | 674 test_environment->webkit_platform_support()->setGamepadData(pads); |
653 } | 675 } |
654 | 676 |
655 } // namespace webkit_support | 677 } // namespace webkit_support |
OLD | NEW |