Chromium Code Reviews| Index: webkit/plugins/ppapi/ppapi_plugin_instance.cc |
| diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc |
| index b80f0ff3c80f8462805384809375d8916ea126f1..223a67017a0a63a60f0cd5e28a6153ac88acb64d 100644 |
| --- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc |
| +++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc |
| @@ -1599,6 +1599,7 @@ bool PluginInstance::SetFullscreen(bool fullscreen) { |
| } |
| void PluginInstance::FlashSetFullscreen(bool fullscreen, bool delay_report) { |
| + TRACE_EVENT0("ppapi", "PluginInstance::FlashSetFullscreen"); |
| // Keep a reference on the stack. See NOTE above. |
| scoped_refptr<PluginInstance> ref(this); |
| @@ -1609,10 +1610,10 @@ void PluginInstance::FlashSetFullscreen(bool fullscreen, bool delay_report) { |
| return; |
| // Unbind current 2D or 3D graphics context. |
| - BindGraphics(pp_instance(), 0); |
| VLOG(1) << "Setting fullscreen to " << (fullscreen ? "on" : "off"); |
| if (fullscreen) { |
| DCHECK(!fullscreen_container_); |
| + setBackingTextureId(0, false); |
| fullscreen_container_ = delegate_->CreateFullscreenContainer(this); |
| } else { |
| DCHECK(fullscreen_container_); |
| @@ -1638,6 +1639,19 @@ void PluginInstance::UpdateFlashFullscreenState(bool flash_fullscreen) { |
| return; |
| } |
| + if (flash_fullscreen != flash_fullscreen_) { |
|
piman
2012/09/13 18:57:20
That test is always true (see early return above).
|
| + PPB_Graphics3D_Impl* graphics_3d = GetBoundGraphics3D(); |
| + if (graphics_3d) { |
| + if (flash_fullscreen) |
| + fullscreen_container_->ReparentContext(graphics_3d->platform_context()); |
| + else { |
| + delegate_->ReparentContext(graphics_3d->platform_context()); |
| + setBackingTextureId(graphics_3d->GetBackingTextureId(), |
| + graphics_3d->IsOpaque()); |
| + } |
| + } |
| + } |
| + |
| bool old_plugin_focus = PluginHasFocus(); |
| flash_fullscreen_ = flash_fullscreen; |
| if (is_mouselock_pending && !delegate()->IsMouseLocked(this)) { |
| @@ -1998,6 +2012,7 @@ void PluginInstance::ClosePendingUserGesture(PP_Instance instance, |
| PP_Bool PluginInstance::BindGraphics(PP_Instance instance, |
| PP_Resource device) { |
| + TRACE_EVENT0("ppapi", "PluginInstance::BindGraphics"); |
| // The Graphics3D instance can't be destroyed until we call |
| // setBackingTextureId. |
| scoped_refptr< ::ppapi::Resource> old_graphics = bound_graphics_; |