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 default: | |
tony
2012/01/19 21:09:53
Nit: Remove the default. If the enum changes, you
piman
2012/01/19 21:25:20
Done.
| |
386 CHECK(false) << "Unknown GraphicsContext3D Implementation"; | |
387 return NULL; | |
388 } | |
389 if (!context->initialize(attributes, web_view, direct)) | |
390 return NULL; | |
391 return context.release(); | |
392 } | |
393 | |
369 void RegisterMockedURL(const WebKit::WebURL& url, | 394 void RegisterMockedURL(const WebKit::WebURL& url, |
370 const WebKit::WebURLResponse& response, | 395 const WebKit::WebURLResponse& response, |
371 const WebKit::WebString& file_path) { | 396 const WebKit::WebString& file_path) { |
372 test_environment->webkit_platform_support()->url_loader_factory()-> | 397 test_environment->webkit_platform_support()->url_loader_factory()-> |
373 RegisterURL(url, response, file_path); | 398 RegisterURL(url, response, file_path); |
374 } | 399 } |
375 | 400 |
376 void UnregisterMockedURL(const WebKit::WebURL& url) { | 401 void UnregisterMockedURL(const WebKit::WebURL& url) { |
377 test_environment->webkit_platform_support()->url_loader_factory()-> | 402 test_environment->webkit_platform_support()->url_loader_factory()-> |
378 UnregisterURL(url); | 403 UnregisterURL(url); |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
646 // Logging | 671 // Logging |
647 void EnableWebCoreLogChannels(const std::string& channels) { | 672 void EnableWebCoreLogChannels(const std::string& channels) { |
648 webkit_glue::EnableWebCoreLogChannels(channels); | 673 webkit_glue::EnableWebCoreLogChannels(channels); |
649 } | 674 } |
650 | 675 |
651 void SetGamepadData(const WebKit::WebGamepads& pads) { | 676 void SetGamepadData(const WebKit::WebGamepads& pads) { |
652 test_environment->webkit_platform_support()->setGamepadData(pads); | 677 test_environment->webkit_platform_support()->setGamepadData(pads); |
653 } | 678 } |
654 | 679 |
655 } // namespace webkit_support | 680 } // namespace webkit_support |
OLD | NEW |