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..d1f6cee06e2c6f9c768e1e0124e638eae3543d41 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_); |
| @@ -1637,6 +1638,21 @@ void PluginInstance::UpdateFlashFullscreenState(bool flash_fullscreen) { |
| TrackedCallback::ClearAndRun(&lock_mouse_callback_, PP_ERROR_FAILED); |
| return; |
| } |
| + if (flash_fullscreen && !flash_fullscreen_) { |
| + PPB_Graphics3D_Impl* graphics_3d = GetBoundGraphics3D(); |
| + if (graphics_3d) { |
| + fullscreen_container_->ReparentContext(graphics_3d->platform_context()); |
| + } |
| + } |
| + |
| + if (!flash_fullscreen && flash_fullscreen_) { |
| + PPB_Graphics3D_Impl* graphics_3d = GetBoundGraphics3D(); |
| + if (graphics_3d) { |
| + delegate_->ReparentContext(graphics_3d->platform_context()); |
| + setBackingTextureId(graphics_3d->GetBackingTextureId(), |
| + graphics_3d->IsOpaque()); |
| + } |
| + } |
|
piman
2012/09/13 00:04:33
I think you can write the 2 blocks above in a slig
|
| bool old_plugin_focus = PluginHasFocus(); |
| flash_fullscreen_ = flash_fullscreen; |
| @@ -1998,6 +2014,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_; |