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

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

Issue 105743004: Add gpu::MailboxHolder to hold state for a gpu::Mailbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: bfbc08f8 Android clang fixes. Created 6 years, 11 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_instance_impl.h" 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 #include "third_party/WebKit/public/web/WebElement.h" 102 #include "third_party/WebKit/public/web/WebElement.h"
103 #include "third_party/WebKit/public/web/WebFrame.h" 103 #include "third_party/WebKit/public/web/WebFrame.h"
104 #include "third_party/WebKit/public/web/WebInputEvent.h" 104 #include "third_party/WebKit/public/web/WebInputEvent.h"
105 #include "third_party/WebKit/public/web/WebPluginContainer.h" 105 #include "third_party/WebKit/public/web/WebPluginContainer.h"
106 #include "third_party/WebKit/public/web/WebPrintParams.h" 106 #include "third_party/WebKit/public/web/WebPrintParams.h"
107 #include "third_party/WebKit/public/web/WebPrintScalingOption.h" 107 #include "third_party/WebKit/public/web/WebPrintScalingOption.h"
108 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" 108 #include "third_party/WebKit/public/web/WebScopedUserGesture.h"
109 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" 109 #include "third_party/WebKit/public/web/WebSecurityOrigin.h"
110 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" 110 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h"
111 #include "third_party/WebKit/public/web/WebView.h" 111 #include "third_party/WebKit/public/web/WebView.h"
112 #include "third_party/khronos/GLES2/gl2.h"
112 #include "third_party/skia/include/core/SkCanvas.h" 113 #include "third_party/skia/include/core/SkCanvas.h"
113 #include "third_party/skia/include/core/SkRect.h" 114 #include "third_party/skia/include/core/SkRect.h"
114 #include "ui/gfx/image/image_skia.h" 115 #include "ui/gfx/image/image_skia.h"
115 #include "ui/gfx/image/image_skia_rep.h" 116 #include "ui/gfx/image/image_skia_rep.h"
116 #include "ui/gfx/point_conversions.h" 117 #include "ui/gfx/point_conversions.h"
117 #include "ui/gfx/range/range.h" 118 #include "ui/gfx/range/range.h"
118 #include "ui/gfx/rect_conversions.h" 119 #include "ui/gfx/rect_conversions.h"
119 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" 120 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
120 #include "ui/gfx/size_conversions.h" 121 #include "ui/gfx/size_conversions.h"
121 #include "v8/include/v8.h" 122 #include "v8/include/v8.h"
(...skipping 1740 matching lines...) Expand 10 before | Expand all | Expand 10 after
1862 skia::EndPlatformPaint(canvas); 1863 skia::EndPlatformPaint(canvas);
1863 } 1864 }
1864 #endif // defined(OS_WIN) 1865 #endif // defined(OS_WIN)
1865 1866
1866 return ret; 1867 return ret;
1867 #else // defined(ENABLE_FULL_PRINTING) 1868 #else // defined(ENABLE_FULL_PRINTING)
1868 return false; 1869 return false;
1869 #endif 1870 #endif
1870 } 1871 }
1871 1872
1872 static void IgnoreCallback(unsigned, bool) {} 1873 static void IgnoreCallback(uint32, bool) {}
1873 1874
1874 void PepperPluginInstanceImpl::UpdateLayer() { 1875 void PepperPluginInstanceImpl::UpdateLayer() {
1875 if (!container_) 1876 if (!container_)
1876 return; 1877 return;
1877 1878
1878 gpu::Mailbox mailbox; 1879 gpu::Mailbox mailbox;
1879 if (bound_graphics_3d_.get()) { 1880 if (bound_graphics_3d_.get()) {
1880 PlatformContext3D* context = bound_graphics_3d_->platform_context(); 1881 PlatformContext3D* context = bound_graphics_3d_->platform_context();
1881 context->GetBackingMailbox(&mailbox); 1882 context->GetBackingMailbox(&mailbox);
1882 } 1883 }
(...skipping 17 matching lines...) Expand all
1900 texture_layer_ = NULL; 1901 texture_layer_ = NULL;
1901 } 1902 }
1902 if (want_layer) { 1903 if (want_layer) {
1903 bool opaque = false; 1904 bool opaque = false;
1904 scoped_refptr<cc::Layer> plugin_layer; 1905 scoped_refptr<cc::Layer> plugin_layer;
1905 if (want_3d_layer) { 1906 if (want_3d_layer) {
1906 DCHECK(bound_graphics_3d_.get()); 1907 DCHECK(bound_graphics_3d_.get());
1907 texture_layer_ = cc::TextureLayer::CreateForMailbox(NULL); 1908 texture_layer_ = cc::TextureLayer::CreateForMailbox(NULL);
1908 opaque = bound_graphics_3d_->IsOpaque(); 1909 opaque = bound_graphics_3d_->IsOpaque();
1909 texture_layer_->SetTextureMailbox( 1910 texture_layer_->SetTextureMailbox(
1910 cc::TextureMailbox(mailbox, 0), 1911 cc::TextureMailbox(mailbox, GL_TEXTURE_2D, 0),
1911 cc::SingleReleaseCallback::Create(base::Bind(&IgnoreCallback))); 1912 cc::SingleReleaseCallback::Create(base::Bind(&IgnoreCallback)));
1912 plugin_layer = texture_layer_; 1913 plugin_layer = texture_layer_;
1913 } else { 1914 } else {
1914 DCHECK(bound_graphics_2d_platform_); 1915 DCHECK(bound_graphics_2d_platform_);
1915 texture_layer_ = cc::TextureLayer::CreateForMailbox(this); 1916 texture_layer_ = cc::TextureLayer::CreateForMailbox(this);
1916 bound_graphics_2d_platform_->AttachedToNewLayer(); 1917 bound_graphics_2d_platform_->AttachedToNewLayer();
1917 opaque = bound_graphics_2d_platform_->IsAlwaysOpaque(); 1918 opaque = bound_graphics_2d_platform_->IsAlwaysOpaque();
1918 texture_layer_->SetFlipped(false); 1919 texture_layer_->SetFlipped(false);
1919 texture_layer_->SetBounds(bound_graphics_2d_platform_->Size()); 1920 texture_layer_->SetBounds(bound_graphics_2d_platform_->Size());
1920 texture_layer_->SetIsDrawable(true); 1921 texture_layer_->SetIsDrawable(true);
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after
3087 // Running out-of-process. Initiate an IPC call to notify the plugin 3088 // Running out-of-process. Initiate an IPC call to notify the plugin
3088 // process. 3089 // process.
3089 ppapi::proxy::HostDispatcher* dispatcher = 3090 ppapi::proxy::HostDispatcher* dispatcher =
3090 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); 3091 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance());
3091 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( 3092 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad(
3092 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); 3093 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data));
3093 } 3094 }
3094 } 3095 }
3095 3096
3096 } // namespace content 3097 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_graphics_2d_host.cc ('k') | gpu/command_buffer/common/mailbox_holder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698