Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Side by Side Diff: content/renderer/pepper/pepper_plugin_delegate_impl.cc

Issue 16290005: Move Pepper to using mailboxes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 PepperPluginDelegateImpl::GetGraphics2D( 802 PepperPluginDelegateImpl::GetGraphics2D(
803 webkit::ppapi::PluginInstance* instance, 803 webkit::ppapi::PluginInstance* instance,
804 PP_Resource resource) { 804 PP_Resource resource) {
805 RendererPpapiHostImpl* host_impl = static_cast<RendererPpapiHostImpl*>( 805 RendererPpapiHostImpl* host_impl = static_cast<RendererPpapiHostImpl*>(
806 instance->module()->GetEmbedderState()); 806 instance->module()->GetEmbedderState());
807 return host_impl->GetPlatformGraphics2D(resource); 807 return host_impl->GetPlatformGraphics2D(resource);
808 } 808 }
809 809
810 webkit::ppapi::PluginDelegate::PlatformContext3D* 810 webkit::ppapi::PluginDelegate::PlatformContext3D*
811 PepperPluginDelegateImpl::CreateContext3D() { 811 PepperPluginDelegateImpl::CreateContext3D() {
812 #ifdef ENABLE_GPU
813 // If accelerated compositing of plugins is disabled, fail to create a 3D 812 // If accelerated compositing of plugins is disabled, fail to create a 3D
814 // context, because it won't be visible. This allows graceful fallback in the 813 // context, because it won't be visible. This allows graceful fallback in the
815 // modules. 814 // modules.
816 const WebPreferences& prefs = render_view_->webkit_preferences(); 815 const WebPreferences& prefs = render_view_->webkit_preferences();
817 if (!prefs.accelerated_compositing_for_plugins_enabled) 816 if (!prefs.accelerated_compositing_for_plugins_enabled)
818 return NULL; 817 return NULL;
819 return new PlatformContext3DImpl; 818 return new PlatformContext3DImpl;
820 #else
821 return NULL;
822 #endif
823 }
824
825 void PepperPluginDelegateImpl::ReparentContext(
826 webkit::ppapi::PluginDelegate::PlatformContext3D* context) {
827 static_cast<PlatformContext3DImpl*>(context)->
828 SetParentAndCreateBackingTextureIfNeeded();
829 } 819 }
830 820
831 webkit::ppapi::PluginDelegate::PlatformVideoCapture* 821 webkit::ppapi::PluginDelegate::PlatformVideoCapture*
832 PepperPluginDelegateImpl::CreateVideoCapture( 822 PepperPluginDelegateImpl::CreateVideoCapture(
833 const std::string& device_id, 823 const std::string& device_id,
834 PlatformVideoCaptureEventHandler* handler) { 824 PlatformVideoCaptureEventHandler* handler) {
835 return new PepperPlatformVideoCaptureImpl(AsWeakPtr(), device_id, handler); 825 return new PepperPlatformVideoCaptureImpl(AsWeakPtr(), device_id, handler);
836 } 826 }
837 827
838 webkit::ppapi::PluginDelegate::PlatformVideoDecoder* 828 webkit::ppapi::PluginDelegate::PlatformVideoDecoder*
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after
1686 should_close_source); 1676 should_close_source);
1687 } 1677 }
1688 1678
1689 bool PepperPluginDelegateImpl::IsRunningInProcess(PP_Instance instance) const { 1679 bool PepperPluginDelegateImpl::IsRunningInProcess(PP_Instance instance) const {
1690 RendererPpapiHostImpl* host = 1680 RendererPpapiHostImpl* host =
1691 RendererPpapiHostImpl::GetForPPInstance(instance); 1681 RendererPpapiHostImpl::GetForPPInstance(instance);
1692 return host && host->IsRunningInProcess(); 1682 return host && host->IsRunningInProcess();
1693 } 1683 }
1694 1684
1695 } // namespace content 1685 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_plugin_delegate_impl.h ('k') | content/renderer/render_widget_fullscreen_pepper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698