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 "content/renderer/pepper/pepper_plugin_delegate_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <cstddef> | 8 #include <cstddef> |
9 #include <map> | 9 #include <map> |
10 #include <queue> | 10 #include <queue> |
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 const FilePath& file_path) { | 764 const FilePath& file_path) { |
765 return GetContentClient()->renderer()->CreatePluginReplacement( | 765 return GetContentClient()->renderer()->CreatePluginReplacement( |
766 render_view_, file_path); | 766 render_view_, file_path); |
767 } | 767 } |
768 | 768 |
769 webkit::ppapi::PluginDelegate::PlatformImage2D* | 769 webkit::ppapi::PluginDelegate::PlatformImage2D* |
770 PepperPluginDelegateImpl::CreateImage2D(int width, int height) { | 770 PepperPluginDelegateImpl::CreateImage2D(int width, int height) { |
771 return PepperPlatformImage2DImpl::Create(width, height); | 771 return PepperPlatformImage2DImpl::Create(width, height); |
772 } | 772 } |
773 | 773 |
| 774 webkit::ppapi::PluginDelegate::PlatformGraphics2D* |
| 775 PepperPluginDelegateImpl::GetGraphics2D( |
| 776 webkit::ppapi::PluginInstance* instance, |
| 777 PP_Resource resource) { |
| 778 RendererPpapiHostImpl* host_impl = static_cast<RendererPpapiHostImpl*>( |
| 779 instance->module()->GetEmbedderState()); |
| 780 return host_impl->GetPlatformGraphics2D(resource); |
| 781 } |
| 782 |
774 webkit::ppapi::PluginDelegate::PlatformContext3D* | 783 webkit::ppapi::PluginDelegate::PlatformContext3D* |
775 PepperPluginDelegateImpl::CreateContext3D() { | 784 PepperPluginDelegateImpl::CreateContext3D() { |
776 #ifdef ENABLE_GPU | 785 #ifdef ENABLE_GPU |
777 // If accelerated compositing of plugins is disabled, fail to create a 3D | 786 // If accelerated compositing of plugins is disabled, fail to create a 3D |
778 // context, because it won't be visible. This allows graceful fallback in the | 787 // context, because it won't be visible. This allows graceful fallback in the |
779 // modules. | 788 // modules. |
780 const webkit_glue::WebPreferences& prefs = render_view_->webkit_preferences(); | 789 const webkit_glue::WebPreferences& prefs = render_view_->webkit_preferences(); |
781 if (!prefs.accelerated_compositing_for_plugins_enabled) | 790 if (!prefs.accelerated_compositing_for_plugins_enabled) |
782 return NULL; | 791 return NULL; |
783 return new PlatformContext3DImpl(this); | 792 return new PlatformContext3DImpl(this); |
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1804 RenderWidgetFullscreenPepper* container = | 1813 RenderWidgetFullscreenPepper* container = |
1805 static_cast<RenderWidgetFullscreenPepper*>( | 1814 static_cast<RenderWidgetFullscreenPepper*>( |
1806 instance->fullscreen_container()); | 1815 instance->fullscreen_container()); |
1807 return container->mouse_lock_dispatcher(); | 1816 return container->mouse_lock_dispatcher(); |
1808 } else { | 1817 } else { |
1809 return render_view_->mouse_lock_dispatcher(); | 1818 return render_view_->mouse_lock_dispatcher(); |
1810 } | 1819 } |
1811 } | 1820 } |
1812 | 1821 |
1813 } // namespace content | 1822 } // namespace content |
OLD | NEW |