OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/renderer/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 #include "chrome/renderer/render_widget_fullscreen.h" | 79 #include "chrome/renderer/render_widget_fullscreen.h" |
80 #include "chrome/renderer/render_widget_fullscreen_pepper.h" | 80 #include "chrome/renderer/render_widget_fullscreen_pepper.h" |
81 #include "chrome/renderer/renderer_webapplicationcachehost_impl.h" | 81 #include "chrome/renderer/renderer_webapplicationcachehost_impl.h" |
82 #include "chrome/renderer/renderer_webstoragenamespace_impl.h" | 82 #include "chrome/renderer/renderer_webstoragenamespace_impl.h" |
83 #include "chrome/renderer/searchbox_extension.h" | 83 #include "chrome/renderer/searchbox_extension.h" |
84 #include "chrome/renderer/speech_input_dispatcher.h" | 84 #include "chrome/renderer/speech_input_dispatcher.h" |
85 #include "chrome/renderer/spellchecker/spellcheck.h" | 85 #include "chrome/renderer/spellchecker/spellcheck.h" |
86 #include "chrome/renderer/user_script_idle_scheduler.h" | 86 #include "chrome/renderer/user_script_idle_scheduler.h" |
87 #include "chrome/renderer/user_script_slave.h" | 87 #include "chrome/renderer/user_script_slave.h" |
88 #include "chrome/renderer/visitedlink_slave.h" | 88 #include "chrome/renderer/visitedlink_slave.h" |
| 89 #include "chrome/renderer/webgraphicscontext3d_command_buffer_impl.h" |
89 #include "chrome/renderer/webplugin_delegate_pepper.h" | 90 #include "chrome/renderer/webplugin_delegate_pepper.h" |
90 #include "chrome/renderer/webplugin_delegate_proxy.h" | 91 #include "chrome/renderer/webplugin_delegate_proxy.h" |
91 #include "chrome/renderer/websharedworker_proxy.h" | 92 #include "chrome/renderer/websharedworker_proxy.h" |
92 #include "chrome/renderer/webworker_proxy.h" | 93 #include "chrome/renderer/webworker_proxy.h" |
93 #include "gfx/color_utils.h" | 94 #include "gfx/color_utils.h" |
94 #include "gfx/favicon_size.h" | 95 #include "gfx/favicon_size.h" |
95 #include "gfx/native_widget_types.h" | 96 #include "gfx/native_widget_types.h" |
96 #include "gfx/point.h" | 97 #include "gfx/point.h" |
97 #include "gfx/rect.h" | 98 #include "gfx/rect.h" |
98 #include "grit/generated_resources.h" | 99 #include "grit/generated_resources.h" |
(...skipping 2514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2613 | 2614 |
2614 // Add in any custom filter factories first. | 2615 // Add in any custom filter factories first. |
2615 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 2616 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
2616 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { | 2617 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { |
2617 // Add the chrome specific audio renderer. | 2618 // Add the chrome specific audio renderer. |
2618 collection->AddFilter(new AudioRendererImpl(audio_message_filter())); | 2619 collection->AddFilter(new AudioRendererImpl(audio_message_filter())); |
2619 } | 2620 } |
2620 | 2621 |
2621 if (cmd_line->HasSwitch(switches::kEnableAcceleratedDecoding) && | 2622 if (cmd_line->HasSwitch(switches::kEnableAcceleratedDecoding) && |
2622 !cmd_line->HasSwitch(switches::kDisableAcceleratedCompositing)) { | 2623 !cmd_line->HasSwitch(switches::kDisableAcceleratedCompositing)) { |
| 2624 WebGraphicsContext3DCommandBufferImpl* context = |
| 2625 static_cast<WebGraphicsContext3DCommandBufferImpl*>( |
| 2626 frame->view()->graphicsContext3D()); |
| 2627 if (!context) |
| 2628 return NULL; |
| 2629 |
2623 // Add the hardware video decoder factory. | 2630 // Add the hardware video decoder factory. |
2624 // TODO(hclam): This assumes that ggl::Context is set to current | 2631 // TODO(hclam): This will cause the renderer process to crash on context |
2625 // internally. I need to make it more explicit to get the context. | 2632 // lost. |
2626 bool ret = frame->view()->graphicsContext3D()->makeContextCurrent(); | 2633 bool ret = context->makeContextCurrent(); |
2627 CHECK(ret) << "Failed to switch context"; | 2634 CHECK(ret) << "Failed to switch context"; |
2628 | |
2629 collection->AddFilter(new IpcVideoDecoder( | 2635 collection->AddFilter(new IpcVideoDecoder( |
2630 MessageLoop::current(), ggl::GetCurrentContext())); | 2636 MessageLoop::current(), context->context())); |
2631 } | 2637 } |
2632 | 2638 |
2633 WebApplicationCacheHostImpl* appcache_host = | 2639 WebApplicationCacheHostImpl* appcache_host = |
2634 WebApplicationCacheHostImpl::FromFrame(frame); | 2640 WebApplicationCacheHostImpl::FromFrame(frame); |
2635 | 2641 |
2636 // TODO(hclam): obtain the following parameters from |client|. | 2642 // TODO(hclam): obtain the following parameters from |client|. |
2637 // Create two bridge factory for two data sources. | 2643 // Create two bridge factory for two data sources. |
2638 webkit_glue::MediaResourceLoaderBridgeFactory* bridge_factory_simple = | 2644 webkit_glue::MediaResourceLoaderBridgeFactory* bridge_factory_simple = |
2639 new webkit_glue::MediaResourceLoaderBridgeFactory( | 2645 new webkit_glue::MediaResourceLoaderBridgeFactory( |
2640 GURL(frame->url()), // referrer | 2646 GURL(frame->url()), // referrer |
(...skipping 3528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6169 IPC::PlatformFileForTransitToPlatformFile(file_for_transit), | 6175 IPC::PlatformFileForTransitToPlatformFile(file_for_transit), |
6170 message_id); | 6176 message_id); |
6171 } | 6177 } |
6172 | 6178 |
6173 #if defined(OS_MACOSX) | 6179 #if defined(OS_MACOSX) |
6174 void RenderView::OnSelectPopupMenuItem(int selected_index) { | 6180 void RenderView::OnSelectPopupMenuItem(int selected_index) { |
6175 external_popup_menu_->DidSelectItem(selected_index); | 6181 external_popup_menu_->DidSelectItem(selected_index); |
6176 external_popup_menu_.reset(); | 6182 external_popup_menu_.reset(); |
6177 } | 6183 } |
6178 #endif | 6184 #endif |
OLD | NEW |