| 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 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 const FilePath& file_path) { | 795 const FilePath& file_path) { |
| 796 return GetContentClient()->renderer()->CreatePluginReplacement( | 796 return GetContentClient()->renderer()->CreatePluginReplacement( |
| 797 render_view_, file_path); | 797 render_view_, file_path); |
| 798 } | 798 } |
| 799 | 799 |
| 800 webkit::ppapi::PluginDelegate::PlatformImage2D* | 800 webkit::ppapi::PluginDelegate::PlatformImage2D* |
| 801 PepperPluginDelegateImpl::CreateImage2D(int width, int height) { | 801 PepperPluginDelegateImpl::CreateImage2D(int width, int height) { |
| 802 return PepperPlatformImage2DImpl::Create(width, height); | 802 return PepperPlatformImage2DImpl::Create(width, height); |
| 803 } | 803 } |
| 804 | 804 |
| 805 webkit::ppapi::PluginDelegate::PlatformGraphics2D* |
| 806 PepperPluginDelegateImpl::GetGraphics2D( |
| 807 webkit::ppapi::PluginInstance* instance, |
| 808 PP_Resource resource) { |
| 809 RendererPpapiHostImpl* host_impl = static_cast<RendererPpapiHostImpl*>( |
| 810 instance->module()->GetEmbedderState()); |
| 811 return host_impl->GetPlatformGraphics2D(resource); |
| 812 } |
| 813 |
| 805 webkit::ppapi::PluginDelegate::PlatformContext3D* | 814 webkit::ppapi::PluginDelegate::PlatformContext3D* |
| 806 PepperPluginDelegateImpl::CreateContext3D() { | 815 PepperPluginDelegateImpl::CreateContext3D() { |
| 807 #ifdef ENABLE_GPU | 816 #ifdef ENABLE_GPU |
| 808 // If accelerated compositing of plugins is disabled, fail to create a 3D | 817 // If accelerated compositing of plugins is disabled, fail to create a 3D |
| 809 // context, because it won't be visible. This allows graceful fallback in the | 818 // context, because it won't be visible. This allows graceful fallback in the |
| 810 // modules. | 819 // modules. |
| 811 if (!render_view_->webkit_preferences().accelerated_plugins_enabled) | 820 if (!render_view_->webkit_preferences().accelerated_plugins_enabled) |
| 812 return NULL; | 821 return NULL; |
| 813 return new PlatformContext3DImpl(this); | 822 return new PlatformContext3DImpl(this); |
| 814 #else | 823 #else |
| (...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1871 RenderWidgetFullscreenPepper* container = | 1880 RenderWidgetFullscreenPepper* container = |
| 1872 static_cast<RenderWidgetFullscreenPepper*>( | 1881 static_cast<RenderWidgetFullscreenPepper*>( |
| 1873 instance->fullscreen_container()); | 1882 instance->fullscreen_container()); |
| 1874 return container->mouse_lock_dispatcher(); | 1883 return container->mouse_lock_dispatcher(); |
| 1875 } else { | 1884 } else { |
| 1876 return render_view_->mouse_lock_dispatcher(); | 1885 return render_view_->mouse_lock_dispatcher(); |
| 1877 } | 1886 } |
| 1878 } | 1887 } |
| 1879 | 1888 |
| 1880 } // namespace content | 1889 } // namespace content |
| OLD | NEW |