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

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

Issue 132233041: Add gpu::MailboxHolder to hold state for a gpu::Mailbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ff7262fa Rebase. Created 6 years, 10 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 #include "third_party/WebKit/public/web/WebElement.h" 103 #include "third_party/WebKit/public/web/WebElement.h"
104 #include "third_party/WebKit/public/web/WebFrame.h" 104 #include "third_party/WebKit/public/web/WebFrame.h"
105 #include "third_party/WebKit/public/web/WebInputEvent.h" 105 #include "third_party/WebKit/public/web/WebInputEvent.h"
106 #include "third_party/WebKit/public/web/WebPluginContainer.h" 106 #include "third_party/WebKit/public/web/WebPluginContainer.h"
107 #include "third_party/WebKit/public/web/WebPrintParams.h" 107 #include "third_party/WebKit/public/web/WebPrintParams.h"
108 #include "third_party/WebKit/public/web/WebPrintScalingOption.h" 108 #include "third_party/WebKit/public/web/WebPrintScalingOption.h"
109 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" 109 #include "third_party/WebKit/public/web/WebScopedUserGesture.h"
110 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" 110 #include "third_party/WebKit/public/web/WebSecurityOrigin.h"
111 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" 111 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h"
112 #include "third_party/WebKit/public/web/WebView.h" 112 #include "third_party/WebKit/public/web/WebView.h"
113 #include "third_party/khronos/GLES2/gl2.h"
113 #include "third_party/skia/include/core/SkCanvas.h" 114 #include "third_party/skia/include/core/SkCanvas.h"
114 #include "third_party/skia/include/core/SkRect.h" 115 #include "third_party/skia/include/core/SkRect.h"
115 #include "ui/gfx/image/image_skia.h" 116 #include "ui/gfx/image/image_skia.h"
116 #include "ui/gfx/image/image_skia_rep.h" 117 #include "ui/gfx/image/image_skia_rep.h"
117 #include "ui/gfx/point_conversions.h" 118 #include "ui/gfx/point_conversions.h"
118 #include "ui/gfx/range/range.h" 119 #include "ui/gfx/range/range.h"
119 #include "ui/gfx/rect_conversions.h" 120 #include "ui/gfx/rect_conversions.h"
120 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" 121 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
121 #include "ui/gfx/size_conversions.h" 122 #include "ui/gfx/size_conversions.h"
122 #include "v8/include/v8.h" 123 #include "v8/include/v8.h"
(...skipping 1754 matching lines...) Expand 10 before | Expand all | Expand 10 after
1877 skia::EndPlatformPaint(canvas); 1878 skia::EndPlatformPaint(canvas);
1878 } 1879 }
1879 #endif // defined(OS_WIN) 1880 #endif // defined(OS_WIN)
1880 1881
1881 return ret; 1882 return ret;
1882 #else // defined(ENABLE_FULL_PRINTING) 1883 #else // defined(ENABLE_FULL_PRINTING)
1883 return false; 1884 return false;
1884 #endif 1885 #endif
1885 } 1886 }
1886 1887
1887 static void IgnoreCallback(unsigned, bool) {} 1888 static void IgnoreCallback(uint32, bool) {}
1888 1889
1889 void PepperPluginInstanceImpl::UpdateLayer() { 1890 void PepperPluginInstanceImpl::UpdateLayer() {
1890 if (!container_) 1891 if (!container_)
1891 return; 1892 return;
1892 1893
1893 gpu::Mailbox mailbox; 1894 gpu::Mailbox mailbox;
1894 if (bound_graphics_3d_.get()) { 1895 if (bound_graphics_3d_.get()) {
1895 PlatformContext3D* context = bound_graphics_3d_->platform_context(); 1896 PlatformContext3D* context = bound_graphics_3d_->platform_context();
1896 context->GetBackingMailbox(&mailbox); 1897 context->GetBackingMailbox(&mailbox);
1897 } 1898 }
(...skipping 19 matching lines...) Expand all
1917 texture_layer_ = NULL; 1918 texture_layer_ = NULL;
1918 } 1919 }
1919 if (want_layer) { 1920 if (want_layer) {
1920 bool opaque = false; 1921 bool opaque = false;
1921 scoped_refptr<cc::Layer> plugin_layer; 1922 scoped_refptr<cc::Layer> plugin_layer;
1922 if (want_3d_layer) { 1923 if (want_3d_layer) {
1923 DCHECK(bound_graphics_3d_.get()); 1924 DCHECK(bound_graphics_3d_.get());
1924 texture_layer_ = cc::TextureLayer::CreateForMailbox(NULL); 1925 texture_layer_ = cc::TextureLayer::CreateForMailbox(NULL);
1925 opaque = bound_graphics_3d_->IsOpaque(); 1926 opaque = bound_graphics_3d_->IsOpaque();
1926 texture_layer_->SetTextureMailbox( 1927 texture_layer_->SetTextureMailbox(
1927 cc::TextureMailbox(mailbox, 0), 1928 cc::TextureMailbox(mailbox, GL_TEXTURE_2D, 0),
1928 cc::SingleReleaseCallback::Create(base::Bind(&IgnoreCallback))); 1929 cc::SingleReleaseCallback::Create(base::Bind(&IgnoreCallback)));
1929 plugin_layer = texture_layer_; 1930 plugin_layer = texture_layer_;
1930 } else { 1931 } else {
1931 DCHECK(bound_graphics_2d_platform_); 1932 DCHECK(bound_graphics_2d_platform_);
1932 texture_layer_ = cc::TextureLayer::CreateForMailbox(this); 1933 texture_layer_ = cc::TextureLayer::CreateForMailbox(this);
1933 bound_graphics_2d_platform_->AttachedToNewLayer(); 1934 bound_graphics_2d_platform_->AttachedToNewLayer();
1934 opaque = bound_graphics_2d_platform_->IsAlwaysOpaque(); 1935 opaque = bound_graphics_2d_platform_->IsAlwaysOpaque();
1935 texture_layer_->SetFlipped(false); 1936 texture_layer_->SetFlipped(false);
1936 texture_layer_->SetBounds(bound_graphics_2d_platform_->Size()); 1937 texture_layer_->SetBounds(bound_graphics_2d_platform_->Size());
1937 texture_layer_->SetIsDrawable(true); 1938 texture_layer_->SetIsDrawable(true);
(...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after
3120 // Running out-of-process. Initiate an IPC call to notify the plugin 3121 // Running out-of-process. Initiate an IPC call to notify the plugin
3121 // process. 3122 // process.
3122 ppapi::proxy::HostDispatcher* dispatcher = 3123 ppapi::proxy::HostDispatcher* dispatcher =
3123 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); 3124 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance());
3124 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( 3125 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad(
3125 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); 3126 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data));
3126 } 3127 }
3127 } 3128 }
3128 3129
3129 } // namespace content 3130 } // 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