Chromium Code Reviews| 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 17 matching lines...) Expand all Loading... | |
| 28 #include "content/renderer/pepper/common.h" | 28 #include "content/renderer/pepper/common.h" |
| 29 #include "content/renderer/pepper/content_decryptor_delegate.h" | 29 #include "content/renderer/pepper/content_decryptor_delegate.h" |
| 30 #include "content/renderer/pepper/event_conversion.h" | 30 #include "content/renderer/pepper/event_conversion.h" |
| 31 #include "content/renderer/pepper/fullscreen_container.h" | 31 #include "content/renderer/pepper/fullscreen_container.h" |
| 32 #include "content/renderer/pepper/gfx_conversion.h" | 32 #include "content/renderer/pepper/gfx_conversion.h" |
| 33 #include "content/renderer/pepper/host_dispatcher_wrapper.h" | 33 #include "content/renderer/pepper/host_dispatcher_wrapper.h" |
| 34 #include "content/renderer/pepper/host_globals.h" | 34 #include "content/renderer/pepper/host_globals.h" |
| 35 #include "content/renderer/pepper/message_channel.h" | 35 #include "content/renderer/pepper/message_channel.h" |
| 36 #include "content/renderer/pepper/npapi_glue.h" | 36 #include "content/renderer/pepper/npapi_glue.h" |
| 37 #include "content/renderer/pepper/pepper_browser_connection.h" | 37 #include "content/renderer/pepper/pepper_browser_connection.h" |
| 38 #include "content/renderer/pepper/pepper_compositor_host.h" | |
| 38 #include "content/renderer/pepper/pepper_file_ref_renderer_host.h" | 39 #include "content/renderer/pepper/pepper_file_ref_renderer_host.h" |
| 39 #include "content/renderer/pepper/pepper_graphics_2d_host.h" | 40 #include "content/renderer/pepper/pepper_graphics_2d_host.h" |
| 40 #include "content/renderer/pepper/pepper_in_process_router.h" | 41 #include "content/renderer/pepper/pepper_in_process_router.h" |
| 41 #include "content/renderer/pepper/pepper_url_loader_host.h" | 42 #include "content/renderer/pepper/pepper_url_loader_host.h" |
| 42 #include "content/renderer/pepper/plugin_module.h" | 43 #include "content/renderer/pepper/plugin_module.h" |
| 43 #include "content/renderer/pepper/plugin_object.h" | 44 #include "content/renderer/pepper/plugin_object.h" |
| 44 #include "content/renderer/pepper/ppb_buffer_impl.h" | 45 #include "content/renderer/pepper/ppb_buffer_impl.h" |
| 45 #include "content/renderer/pepper/ppb_graphics_3d_impl.h" | 46 #include "content/renderer/pepper/ppb_graphics_3d_impl.h" |
| 46 #include "content/renderer/pepper/ppb_image_data_impl.h" | 47 #include "content/renderer/pepper/ppb_image_data_impl.h" |
| 47 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" | 48 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 515 : RenderFrameObserver(render_frame), | 516 : RenderFrameObserver(render_frame), |
| 516 render_frame_(render_frame), | 517 render_frame_(render_frame), |
| 517 module_(module), | 518 module_(module), |
| 518 instance_interface_(instance_interface), | 519 instance_interface_(instance_interface), |
| 519 pp_instance_(0), | 520 pp_instance_(0), |
| 520 container_(container), | 521 container_(container), |
| 521 layer_bound_to_fullscreen_(false), | 522 layer_bound_to_fullscreen_(false), |
| 522 plugin_url_(plugin_url), | 523 plugin_url_(plugin_url), |
| 523 full_frame_(false), | 524 full_frame_(false), |
| 524 sent_initial_did_change_view_(false), | 525 sent_initial_did_change_view_(false), |
| 526 bound_graphics_3d_(NULL), | |
|
piman
2014/06/04 13:19:43
nit: it's a scoped_refptr, no need to initialize e
Peng
2014/06/05 00:50:38
Done.
| |
| 525 bound_graphics_2d_platform_(NULL), | 527 bound_graphics_2d_platform_(NULL), |
| 528 bound_compositor_(NULL), | |
| 526 has_webkit_focus_(false), | 529 has_webkit_focus_(false), |
| 527 has_content_area_focus_(false), | 530 has_content_area_focus_(false), |
| 528 find_identifier_(-1), | 531 find_identifier_(-1), |
| 529 plugin_find_interface_(NULL), | 532 plugin_find_interface_(NULL), |
| 530 plugin_input_event_interface_(NULL), | 533 plugin_input_event_interface_(NULL), |
| 531 plugin_mouse_lock_interface_(NULL), | 534 plugin_mouse_lock_interface_(NULL), |
| 532 plugin_pdf_interface_(NULL), | 535 plugin_pdf_interface_(NULL), |
| 533 plugin_private_interface_(NULL), | 536 plugin_private_interface_(NULL), |
| 534 plugin_selection_interface_(NULL), | 537 plugin_selection_interface_(NULL), |
| 535 plugin_textinput_interface_(NULL), | 538 plugin_textinput_interface_(NULL), |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 723 fullscreen_container_->InvalidateRect(rect); | 726 fullscreen_container_->InvalidateRect(rect); |
| 724 } else { | 727 } else { |
| 725 if (!container_ || view_data_.rect.size.width == 0 || | 728 if (!container_ || view_data_.rect.size.width == 0 || |
| 726 view_data_.rect.size.height == 0) | 729 view_data_.rect.size.height == 0) |
| 727 return; // Nothing to do. | 730 return; // Nothing to do. |
| 728 if (rect.IsEmpty()) | 731 if (rect.IsEmpty()) |
| 729 container_->invalidate(); | 732 container_->invalidate(); |
| 730 else | 733 else |
| 731 container_->invalidateRect(rect); | 734 container_->invalidateRect(rect); |
| 732 } | 735 } |
| 733 if (texture_layer_) { | 736 scoped_refptr<cc::Layer> layer = texture_layer_ ? |
| 737 static_cast<scoped_refptr<cc::Layer> >(texture_layer_) : | |
| 738 static_cast<scoped_refptr<cc::Layer> >(compositor_layer_); | |
|
piman
2014/06/04 13:19:43
no need for static_cast in either case.
cc::Layer*
Peng
2014/06/05 00:50:38
Done.
| |
| 739 if (layer) { | |
| 734 if (rect.IsEmpty()) { | 740 if (rect.IsEmpty()) { |
| 735 texture_layer_->SetNeedsDisplay(); | 741 layer->SetNeedsDisplay(); |
| 736 } else { | 742 } else { |
| 737 texture_layer_->SetNeedsDisplayRect(rect); | 743 layer->SetNeedsDisplayRect(rect); |
| 738 } | 744 } |
| 739 } | 745 } |
| 740 } | 746 } |
| 741 | 747 |
| 742 void PepperPluginInstanceImpl::ScrollRect(int dx, | 748 void PepperPluginInstanceImpl::ScrollRect(int dx, |
| 743 int dy, | 749 int dy, |
| 744 const gfx::Rect& rect) { | 750 const gfx::Rect& rect) { |
| 745 if (texture_layer_) { | 751 scoped_refptr<cc::Layer> layer = texture_layer_ ? |
| 752 static_cast<scoped_refptr<cc::Layer> >(texture_layer_) : | |
| 753 static_cast<scoped_refptr<cc::Layer> >(compositor_layer_); | |
|
piman
2014/06/04 13:19:43
ditto
Peng
2014/06/05 00:50:38
Done.
| |
| 754 if (layer) { | |
| 746 InvalidateRect(rect); | 755 InvalidateRect(rect); |
| 747 } else if (fullscreen_container_) { | 756 } else if (fullscreen_container_) { |
| 748 fullscreen_container_->ScrollRect(dx, dy, rect); | 757 fullscreen_container_->ScrollRect(dx, dy, rect); |
| 749 } else { | 758 } else { |
| 750 if (full_frame_ && !IsViewAccelerated()) { | 759 if (full_frame_ && !IsViewAccelerated()) { |
| 751 container_->scrollRect(dx, dy, rect); | 760 container_->scrollRect(dx, dy, rect); |
| 752 } else { | 761 } else { |
| 753 // Can't do optimized scrolling since there could be other elements on top | 762 // Can't do optimized scrolling since there could be other elements on top |
| 754 // of us or the view renders via the accelerated compositor which is | 763 // of us or the view renders via the accelerated compositor which is |
| 755 // incompatible with the move and backfill scrolling model. | 764 // incompatible with the move and backfill scrolling model. |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1269 // |view_data_| haven't been properly initialized. | 1278 // |view_data_| haven't been properly initialized. |
| 1270 if (sent_initial_did_change_view_) | 1279 if (sent_initial_did_change_view_) |
| 1271 SendDidChangeView(); | 1280 SendDidChangeView(); |
| 1272 } | 1281 } |
| 1273 | 1282 |
| 1274 void PepperPluginInstanceImpl::ViewInitiatedPaint() { | 1283 void PepperPluginInstanceImpl::ViewInitiatedPaint() { |
| 1275 if (bound_graphics_2d_platform_) | 1284 if (bound_graphics_2d_platform_) |
| 1276 bound_graphics_2d_platform_->ViewInitiatedPaint(); | 1285 bound_graphics_2d_platform_->ViewInitiatedPaint(); |
| 1277 else if (bound_graphics_3d_.get()) | 1286 else if (bound_graphics_3d_.get()) |
| 1278 bound_graphics_3d_->ViewInitiatedPaint(); | 1287 bound_graphics_3d_->ViewInitiatedPaint(); |
| 1288 else if (bound_compositor_) | |
| 1289 bound_compositor_->ViewInitiatedPaint(); | |
| 1279 } | 1290 } |
| 1280 | 1291 |
| 1281 void PepperPluginInstanceImpl::ViewFlushedPaint() { | 1292 void PepperPluginInstanceImpl::ViewFlushedPaint() { |
| 1282 // Keep a reference on the stack. See NOTE above. | 1293 // Keep a reference on the stack. See NOTE above. |
| 1283 scoped_refptr<PepperPluginInstanceImpl> ref(this); | 1294 scoped_refptr<PepperPluginInstanceImpl> ref(this); |
| 1284 if (bound_graphics_2d_platform_) | 1295 if (bound_graphics_2d_platform_) |
| 1285 bound_graphics_2d_platform_->ViewFlushedPaint(); | 1296 bound_graphics_2d_platform_->ViewFlushedPaint(); |
| 1286 else if (bound_graphics_3d_.get()) | 1297 else if (bound_graphics_3d_.get()) |
| 1287 bound_graphics_3d_->ViewFlushedPaint(); | 1298 bound_graphics_3d_->ViewFlushedPaint(); |
| 1299 else if (bound_compositor_) | |
| 1300 bound_compositor_->ViewFlushedPaint(); | |
| 1288 } | 1301 } |
| 1289 | 1302 |
| 1290 void PepperPluginInstanceImpl::SetSelectedText( | 1303 void PepperPluginInstanceImpl::SetSelectedText( |
| 1291 const base::string16& selected_text) { | 1304 const base::string16& selected_text) { |
| 1292 selected_text_ = selected_text; | 1305 selected_text_ = selected_text; |
| 1293 } | 1306 } |
| 1294 | 1307 |
| 1295 void PepperPluginInstanceImpl::SetLinkUnderCursor(const std::string& url) { | 1308 void PepperPluginInstanceImpl::SetLinkUnderCursor(const std::string& url) { |
| 1296 link_under_cursor_ = base::UTF8ToUTF16(url); | 1309 link_under_cursor_ = base::UTF8ToUTF16(url); |
| 1297 } | 1310 } |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1963 return; | 1976 return; |
| 1964 | 1977 |
| 1965 gpu::Mailbox mailbox; | 1978 gpu::Mailbox mailbox; |
| 1966 uint32 sync_point = 0; | 1979 uint32 sync_point = 0; |
| 1967 if (bound_graphics_3d_.get()) { | 1980 if (bound_graphics_3d_.get()) { |
| 1968 bound_graphics_3d_->GetBackingMailbox(&mailbox, &sync_point); | 1981 bound_graphics_3d_->GetBackingMailbox(&mailbox, &sync_point); |
| 1969 DCHECK_EQ(mailbox.IsZero(), sync_point == 0); | 1982 DCHECK_EQ(mailbox.IsZero(), sync_point == 0); |
| 1970 } | 1983 } |
| 1971 bool want_3d_layer = !mailbox.IsZero(); | 1984 bool want_3d_layer = !mailbox.IsZero(); |
| 1972 bool want_2d_layer = !!bound_graphics_2d_platform_; | 1985 bool want_2d_layer = !!bound_graphics_2d_platform_; |
| 1973 bool want_layer = want_3d_layer || want_2d_layer; | 1986 bool want_texture_layer = want_3d_layer || want_2d_layer; |
| 1987 bool want_compositor_layer = !!bound_compositor_; | |
| 1974 | 1988 |
| 1975 if ((want_layer == !!texture_layer_.get()) && | 1989 if ((want_texture_layer == !!texture_layer_.get()) && |
| 1976 (want_3d_layer == layer_is_hardware_) && | 1990 (want_3d_layer == layer_is_hardware_) && |
|
piman
2014/06/04 13:19:43
you want another early out for want_compositor_lay
Peng
2014/06/05 00:50:38
Done.
| |
| 1977 layer_bound_to_fullscreen_ == !!fullscreen_container_) { | 1991 layer_bound_to_fullscreen_ == !!fullscreen_container_) { |
| 1978 UpdateLayerTransform(); | 1992 UpdateLayerTransform(); |
| 1979 return; | 1993 return; |
| 1980 } | 1994 } |
| 1981 | 1995 |
| 1982 if (texture_layer_) { | 1996 if (texture_layer_ || compositor_layer_) { |
| 1983 if (!layer_bound_to_fullscreen_) | 1997 if (!layer_bound_to_fullscreen_) |
| 1984 container_->setWebLayer(NULL); | 1998 container_->setWebLayer(NULL); |
| 1985 else if (fullscreen_container_) | 1999 else if (fullscreen_container_) |
| 1986 fullscreen_container_->SetLayer(NULL); | 2000 fullscreen_container_->SetLayer(NULL); |
| 1987 web_layer_.reset(); | 2001 web_layer_.reset(); |
| 1988 texture_layer_ = NULL; | 2002 texture_layer_ = NULL; |
| 2003 compositor_layer_ = NULL; | |
| 1989 } | 2004 } |
| 1990 if (want_layer) { | 2005 |
| 2006 if (want_texture_layer) { | |
| 1991 bool opaque = false; | 2007 bool opaque = false; |
| 1992 if (want_3d_layer) { | 2008 if (want_3d_layer) { |
| 1993 DCHECK(bound_graphics_3d_.get()); | 2009 DCHECK(bound_graphics_3d_.get()); |
| 1994 texture_layer_ = cc::TextureLayer::CreateForMailbox(NULL); | 2010 texture_layer_ = cc::TextureLayer::CreateForMailbox(NULL); |
| 1995 opaque = bound_graphics_3d_->IsOpaque(); | 2011 opaque = bound_graphics_3d_->IsOpaque(); |
| 1996 texture_layer_->SetTextureMailboxWithoutReleaseCallback( | 2012 texture_layer_->SetTextureMailboxWithoutReleaseCallback( |
| 1997 cc::TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point)); | 2013 cc::TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point)); |
| 1998 } else { | 2014 } else { |
| 1999 DCHECK(bound_graphics_2d_platform_); | 2015 DCHECK(bound_graphics_2d_platform_); |
| 2000 texture_layer_ = cc::TextureLayer::CreateForMailbox(this); | 2016 texture_layer_ = cc::TextureLayer::CreateForMailbox(this); |
| 2001 bound_graphics_2d_platform_->AttachedToNewLayer(); | 2017 bound_graphics_2d_platform_->AttachedToNewLayer(); |
| 2002 opaque = bound_graphics_2d_platform_->IsAlwaysOpaque(); | 2018 opaque = bound_graphics_2d_platform_->IsAlwaysOpaque(); |
| 2003 texture_layer_->SetFlipped(false); | 2019 texture_layer_->SetFlipped(false); |
| 2004 } | 2020 } |
| 2021 | |
| 2022 // Ignore transparency in fullscreen, since that's what Flash always | |
| 2023 // wants to do, and that lets it not recreate a context if | |
| 2024 // wmode=transparent was specified. | |
| 2025 opaque = opaque || fullscreen_container_; | |
| 2026 texture_layer_->SetContentsOpaque(opaque); | |
| 2005 web_layer_.reset(new webkit::WebLayerImpl(texture_layer_)); | 2027 web_layer_.reset(new webkit::WebLayerImpl(texture_layer_)); |
| 2028 } else if (want_compositor_layer) { | |
| 2029 compositor_layer_ = bound_compositor_->layer(); | |
| 2030 web_layer_.reset(new webkit::WebLayerImpl(compositor_layer_)); | |
| 2031 } | |
| 2032 | |
| 2033 if (web_layer_) { | |
| 2006 if (fullscreen_container_) { | 2034 if (fullscreen_container_) { |
| 2007 fullscreen_container_->SetLayer(web_layer_.get()); | 2035 fullscreen_container_->SetLayer(web_layer_.get()); |
| 2008 // Ignore transparency in fullscreen, since that's what Flash always | |
| 2009 // wants to do, and that lets it not recreate a context if | |
| 2010 // wmode=transparent was specified. | |
| 2011 texture_layer_->SetContentsOpaque(true); | |
| 2012 } else { | 2036 } else { |
| 2013 container_->setWebLayer(web_layer_.get()); | 2037 container_->setWebLayer(web_layer_.get()); |
| 2014 texture_layer_->SetContentsOpaque(opaque); | |
| 2015 } | 2038 } |
| 2016 } | 2039 } |
| 2040 | |
| 2017 layer_bound_to_fullscreen_ = !!fullscreen_container_; | 2041 layer_bound_to_fullscreen_ = !!fullscreen_container_; |
| 2018 layer_is_hardware_ = want_3d_layer; | 2042 layer_is_hardware_ = want_3d_layer; |
| 2019 UpdateLayerTransform(); | 2043 UpdateLayerTransform(); |
| 2020 } | 2044 } |
| 2021 | 2045 |
| 2022 bool PepperPluginInstanceImpl::PrepareTextureMailbox( | 2046 bool PepperPluginInstanceImpl::PrepareTextureMailbox( |
| 2023 cc::TextureMailbox* mailbox, | 2047 cc::TextureMailbox* mailbox, |
| 2024 scoped_ptr<cc::SingleReleaseCallback>* release_callback, | 2048 scoped_ptr<cc::SingleReleaseCallback>* release_callback, |
| 2025 bool use_shared_memory) { | 2049 bool use_shared_memory) { |
| 2026 if (!bound_graphics_2d_platform_) | 2050 if (!bound_graphics_2d_platform_) |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2188 // UpdateLayer(). | 2212 // UpdateLayer(). |
| 2189 scoped_refptr<ppapi::Resource> old_graphics = bound_graphics_3d_.get(); | 2213 scoped_refptr<ppapi::Resource> old_graphics = bound_graphics_3d_.get(); |
| 2190 if (bound_graphics_3d_.get()) { | 2214 if (bound_graphics_3d_.get()) { |
| 2191 bound_graphics_3d_->BindToInstance(false); | 2215 bound_graphics_3d_->BindToInstance(false); |
| 2192 bound_graphics_3d_ = NULL; | 2216 bound_graphics_3d_ = NULL; |
| 2193 } | 2217 } |
| 2194 if (bound_graphics_2d_platform_) { | 2218 if (bound_graphics_2d_platform_) { |
| 2195 bound_graphics_2d_platform_->BindToInstance(NULL); | 2219 bound_graphics_2d_platform_->BindToInstance(NULL); |
| 2196 bound_graphics_2d_platform_ = NULL; | 2220 bound_graphics_2d_platform_ = NULL; |
| 2197 } | 2221 } |
| 2222 if (bound_compositor_) { | |
| 2223 bound_compositor_->BindToInstance(NULL); | |
| 2224 bound_compositor_ = NULL; | |
| 2225 } | |
| 2198 | 2226 |
| 2199 // Special-case clearing the current device. | 2227 // Special-case clearing the current device. |
| 2200 if (!device) { | 2228 if (!device) { |
| 2201 UpdateLayer(); | 2229 UpdateLayer(); |
| 2202 InvalidateRect(gfx::Rect()); | 2230 InvalidateRect(gfx::Rect()); |
| 2203 return PP_TRUE; | 2231 return PP_TRUE; |
| 2204 } | 2232 } |
| 2205 | 2233 |
| 2206 // Refuse to bind if in transition to fullscreen with PPB_FlashFullscreen or | 2234 // Refuse to bind if in transition to fullscreen with PPB_FlashFullscreen or |
| 2207 // to/from fullscreen with PPB_Fullscreen. | 2235 // to/from fullscreen with PPB_Fullscreen. |
| 2208 if ((fullscreen_container_ && !flash_fullscreen_) || | 2236 if ((fullscreen_container_ && !flash_fullscreen_) || |
| 2209 desired_fullscreen_state_ != view_data_.is_fullscreen) | 2237 desired_fullscreen_state_ != view_data_.is_fullscreen) |
| 2210 return PP_FALSE; | 2238 return PP_FALSE; |
| 2211 | 2239 |
| 2212 const ppapi::host::PpapiHost* ppapi_host = | 2240 const ppapi::host::PpapiHost* ppapi_host = |
| 2213 RendererPpapiHost::GetForPPInstance(instance)->GetPpapiHost(); | 2241 RendererPpapiHost::GetForPPInstance(instance)->GetPpapiHost(); |
| 2214 ppapi::host::ResourceHost* host = ppapi_host->GetResourceHost(device); | 2242 ppapi::host::ResourceHost* host = ppapi_host->GetResourceHost(device); |
| 2215 PepperGraphics2DHost* graphics_2d = NULL; | 2243 PepperGraphics2DHost* graphics_2d = NULL; |
| 2244 PepperCompositorHost* compositor = NULL; | |
| 2216 if (host) { | 2245 if (host) { |
| 2217 if (host->IsGraphics2DHost()) | 2246 if (host->IsGraphics2DHost()) { |
| 2218 graphics_2d = static_cast<PepperGraphics2DHost*>(host); | 2247 graphics_2d = static_cast<PepperGraphics2DHost*>(host); |
| 2219 DLOG_IF(ERROR, !graphics_2d) << "Resource is not PepperGraphics2DHost."; | 2248 } else if (host->IsCompositorHost()) { |
| 2249 compositor = static_cast <PepperCompositorHost*>(host); | |
|
piman
2014/06/04 13:19:43
nit: no space after static_cast
Peng
2014/06/05 00:50:38
Done.
| |
| 2250 } else { | |
| 2251 DLOG(ERROR) << | |
| 2252 "Resource is not PepperCompositorHost or PepperGraphics2DHost."; | |
| 2253 } | |
| 2220 } | 2254 } |
| 2221 | 2255 |
| 2222 EnterResourceNoLock<PPB_Graphics3D_API> enter_3d(device, false); | 2256 EnterResourceNoLock<PPB_Graphics3D_API> enter_3d(device, false); |
| 2223 PPB_Graphics3D_Impl* graphics_3d = | 2257 PPB_Graphics3D_Impl* graphics_3d = |
| 2224 enter_3d.succeeded() | 2258 enter_3d.succeeded() |
| 2225 ? static_cast<PPB_Graphics3D_Impl*>(enter_3d.object()) | 2259 ? static_cast<PPB_Graphics3D_Impl*>(enter_3d.object()) |
| 2226 : NULL; | 2260 : NULL; |
| 2227 | 2261 |
| 2228 if (graphics_2d) { | 2262 if (compositor) { |
| 2263 if (compositor->BindToInstance(this)) { | |
| 2264 bound_compositor_ = compositor; | |
| 2265 UpdateLayer(); | |
| 2266 return PP_TRUE; | |
| 2267 } | |
| 2268 } else if (graphics_2d) { | |
| 2229 if (graphics_2d->BindToInstance(this)) { | 2269 if (graphics_2d->BindToInstance(this)) { |
| 2230 bound_graphics_2d_platform_ = graphics_2d; | 2270 bound_graphics_2d_platform_ = graphics_2d; |
| 2231 UpdateLayer(); | 2271 UpdateLayer(); |
| 2232 return PP_TRUE; | 2272 return PP_TRUE; |
| 2233 } | 2273 } |
| 2234 } else if (graphics_3d) { | 2274 } else if (graphics_3d) { |
| 2235 // Make sure graphics can only be bound to the instance it is | 2275 // Make sure graphics can only be bound to the instance it is |
| 2236 // associated with. | 2276 // associated with. |
| 2237 if (graphics_3d->pp_instance() == pp_instance() && | 2277 if (graphics_3d->pp_instance() == pp_instance() && |
| 2238 graphics_3d->BindToInstance(true)) { | 2278 graphics_3d->BindToInstance(true)) { |
| (...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3199 // Running out-of-process. Initiate an IPC call to notify the plugin | 3239 // Running out-of-process. Initiate an IPC call to notify the plugin |
| 3200 // process. | 3240 // process. |
| 3201 ppapi::proxy::HostDispatcher* dispatcher = | 3241 ppapi::proxy::HostDispatcher* dispatcher = |
| 3202 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); | 3242 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); |
| 3203 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( | 3243 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( |
| 3204 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); | 3244 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); |
| 3205 } | 3245 } |
| 3206 } | 3246 } |
| 3207 | 3247 |
| 3208 } // namespace content | 3248 } // namespace content |
| OLD | NEW |