| 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_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 Loading... |
| 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 1730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1852 skia::EndPlatformPaint(canvas); | 1853 skia::EndPlatformPaint(canvas); |
| 1853 } | 1854 } |
| 1854 #endif // defined(OS_WIN) | 1855 #endif // defined(OS_WIN) |
| 1855 | 1856 |
| 1856 return ret; | 1857 return ret; |
| 1857 #else // defined(ENABLE_FULL_PRINTING) | 1858 #else // defined(ENABLE_FULL_PRINTING) |
| 1858 return false; | 1859 return false; |
| 1859 #endif | 1860 #endif |
| 1860 } | 1861 } |
| 1861 | 1862 |
| 1862 static void IgnoreCallback(unsigned, bool) {} | 1863 static void IgnoreCallback(uint32, bool) {} |
| 1863 | 1864 |
| 1864 void PepperPluginInstanceImpl::UpdateLayer() { | 1865 void PepperPluginInstanceImpl::UpdateLayer() { |
| 1865 if (!container_) | 1866 if (!container_) |
| 1866 return; | 1867 return; |
| 1867 | 1868 |
| 1868 gpu::Mailbox mailbox; | 1869 gpu::Mailbox mailbox; |
| 1869 if (bound_graphics_3d_.get()) { | 1870 if (bound_graphics_3d_.get()) { |
| 1870 PlatformContext3D* context = bound_graphics_3d_->platform_context(); | 1871 PlatformContext3D* context = bound_graphics_3d_->platform_context(); |
| 1871 context->GetBackingMailbox(&mailbox); | 1872 context->GetBackingMailbox(&mailbox); |
| 1872 } | 1873 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1890 texture_layer_ = NULL; | 1891 texture_layer_ = NULL; |
| 1891 } | 1892 } |
| 1892 if (want_layer) { | 1893 if (want_layer) { |
| 1893 bool opaque = false; | 1894 bool opaque = false; |
| 1894 scoped_refptr<cc::Layer> plugin_layer; | 1895 scoped_refptr<cc::Layer> plugin_layer; |
| 1895 if (want_3d_layer) { | 1896 if (want_3d_layer) { |
| 1896 DCHECK(bound_graphics_3d_.get()); | 1897 DCHECK(bound_graphics_3d_.get()); |
| 1897 texture_layer_ = cc::TextureLayer::CreateForMailbox(NULL); | 1898 texture_layer_ = cc::TextureLayer::CreateForMailbox(NULL); |
| 1898 opaque = bound_graphics_3d_->IsOpaque(); | 1899 opaque = bound_graphics_3d_->IsOpaque(); |
| 1899 texture_layer_->SetTextureMailbox( | 1900 texture_layer_->SetTextureMailbox( |
| 1900 cc::TextureMailbox(mailbox, 0), | 1901 cc::TextureMailbox(mailbox, GL_TEXTURE_2D, 0), |
| 1901 cc::SingleReleaseCallback::Create(base::Bind(&IgnoreCallback))); | 1902 cc::SingleReleaseCallback::Create(base::Bind(&IgnoreCallback))); |
| 1902 plugin_layer = texture_layer_; | 1903 plugin_layer = texture_layer_; |
| 1903 } else { | 1904 } else { |
| 1904 DCHECK(bound_graphics_2d_platform_); | 1905 DCHECK(bound_graphics_2d_platform_); |
| 1905 texture_layer_ = cc::TextureLayer::CreateForMailbox(this); | 1906 texture_layer_ = cc::TextureLayer::CreateForMailbox(this); |
| 1906 bound_graphics_2d_platform_->AttachedToNewLayer(); | 1907 bound_graphics_2d_platform_->AttachedToNewLayer(); |
| 1907 opaque = bound_graphics_2d_platform_->IsAlwaysOpaque(); | 1908 opaque = bound_graphics_2d_platform_->IsAlwaysOpaque(); |
| 1908 texture_layer_->SetFlipped(false); | 1909 texture_layer_->SetFlipped(false); |
| 1909 texture_layer_->SetBounds(bound_graphics_2d_platform_->Size()); | 1910 texture_layer_->SetBounds(bound_graphics_2d_platform_->Size()); |
| 1910 texture_layer_->SetIsDrawable(true); | 1911 texture_layer_->SetIsDrawable(true); |
| (...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3075 // Running out-of-process. Initiate an IPC call to notify the plugin | 3076 // Running out-of-process. Initiate an IPC call to notify the plugin |
| 3076 // process. | 3077 // process. |
| 3077 ppapi::proxy::HostDispatcher* dispatcher = | 3078 ppapi::proxy::HostDispatcher* dispatcher = |
| 3078 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); | 3079 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); |
| 3079 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( | 3080 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( |
| 3080 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); | 3081 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); |
| 3081 } | 3082 } |
| 3082 } | 3083 } |
| 3083 | 3084 |
| 3084 } // namespace content | 3085 } // namespace content |
| OLD | NEW |