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 20 matching lines...) Expand all Loading... |
31 #include "media/base/filter_collection.h" | 31 #include "media/base/filter_collection.h" |
32 #include "media/base/media_log.h" | 32 #include "media/base/media_log.h" |
33 #include "media/base/message_loop_factory_impl.h" | 33 #include "media/base/message_loop_factory_impl.h" |
34 #include "net/base/escape.h" | 34 #include "net/base/escape.h" |
35 #include "net/base/net_errors.h" | 35 #include "net/base/net_errors.h" |
36 #include "net/base/net_util.h" | 36 #include "net/base/net_util.h" |
37 #include "testing/gtest/include/gtest/gtest.h" | 37 #include "testing/gtest/include/gtest/gtest.h" |
38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallback
s.h" | 38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallback
s.h" |
39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" | 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" |
| 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
41 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLError.
h" | 42 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLError.
h" |
42 #if defined(TOOLKIT_USES_GTK) | 43 #if defined(TOOLKIT_USES_GTK) |
43 #include "ui/base/keycodes/keyboard_code_conversion_gtk.h" | 44 #include "ui/base/keycodes/keyboard_code_conversion_gtk.h" |
44 #endif | 45 #endif |
45 #include "ui/gfx/gl/gl_context.h" | 46 #include "ui/gfx/gl/gl_context.h" |
46 #include "ui/gfx/gl/gl_implementation.h" | 47 #include "ui/gfx/gl/gl_implementation.h" |
47 #include "ui/gfx/gl/gl_surface.h" | 48 #include "ui/gfx/gl/gl_surface.h" |
48 #include "webkit/appcache/web_application_cache_host_impl.h" | 49 #include "webkit/appcache/web_application_cache_host_impl.h" |
49 #include "webkit/glue/user_agent.h" | 50 #include "webkit/glue/user_agent.h" |
50 #include "webkit/glue/webkit_constants.h" | 51 #include "webkit/glue/webkit_constants.h" |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 return g_graphics_context_3d_implementation; | 378 return g_graphics_context_3d_implementation; |
378 } | 379 } |
379 | 380 |
380 WebKit::WebGraphicsContext3D* CreateGraphicsContext3D( | 381 WebKit::WebGraphicsContext3D* CreateGraphicsContext3D( |
381 const WebKit::WebGraphicsContext3D::Attributes& attributes, | 382 const WebKit::WebGraphicsContext3D::Attributes& attributes, |
382 WebKit::WebView* web_view, | 383 WebKit::WebView* web_view, |
383 bool direct) { | 384 bool direct) { |
384 switch (webkit_support::GetGraphicsContext3DImplementation()) { | 385 switch (webkit_support::GetGraphicsContext3DImplementation()) { |
385 case webkit_support::IN_PROCESS: | 386 case webkit_support::IN_PROCESS: |
386 return WebGraphicsContext3DInProcessImpl::CreateForWebView( | 387 return WebGraphicsContext3DInProcessImpl::CreateForWebView( |
387 attributes, web_view, direct); | 388 attributes, direct); |
388 case webkit_support::IN_PROCESS_COMMAND_BUFFER: { | 389 case webkit_support::IN_PROCESS_COMMAND_BUFFER: { |
| 390 WebKit::WebGraphicsContext3D* view_context = 0; |
| 391 if (!direct) |
| 392 view_context = web_view->graphicsContext3D(); |
389 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context( | 393 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context( |
390 new WebGraphicsContext3DInProcessCommandBufferImpl()); | 394 new WebGraphicsContext3DInProcessCommandBufferImpl()); |
391 if (!context->initialize(attributes, web_view, direct)) | 395 if (!context->Initialize(attributes, view_context)) |
392 return NULL; | 396 return NULL; |
393 return context.release(); | 397 return context.release(); |
394 } | 398 } |
395 } | 399 } |
396 NOTREACHED(); | 400 NOTREACHED(); |
397 return NULL; | 401 return NULL; |
398 } | 402 } |
399 | 403 |
400 void RegisterMockedURL(const WebKit::WebURL& url, | 404 void RegisterMockedURL(const WebKit::WebURL& url, |
401 const WebKit::WebURLResponse& response, | 405 const WebKit::WebURLResponse& response, |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 // Logging | 683 // Logging |
680 void EnableWebCoreLogChannels(const std::string& channels) { | 684 void EnableWebCoreLogChannels(const std::string& channels) { |
681 webkit_glue::EnableWebCoreLogChannels(channels); | 685 webkit_glue::EnableWebCoreLogChannels(channels); |
682 } | 686 } |
683 | 687 |
684 void SetGamepadData(const WebKit::WebGamepads& pads) { | 688 void SetGamepadData(const WebKit::WebGamepads& pads) { |
685 test_environment->webkit_platform_support()->setGamepadData(pads); | 689 test_environment->webkit_platform_support()->setGamepadData(pads); |
686 } | 690 } |
687 | 691 |
688 } // namespace webkit_support | 692 } // namespace webkit_support |
OLD | NEW |