diff options
author | reveman@google.com <reveman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-19 18:37:57 +0000 |
---|---|---|
committer | reveman@google.com <reveman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-19 18:37:57 +0000 |
commit | 737402392b58715c71ed52b210ee62124f06b18c (patch) | |
tree | 288ca0527adc0fc7db2a48caa44fc372b58ac59a /webkit/plugins | |
parent | 85a6aab738a98be3b473dfe117053251a3865734 (diff) | |
download | chromium_src-737402392b58715c71ed52b210ee62124f06b18c.zip chromium_src-737402392b58715c71ed52b210ee62124f06b18c.tar.gz chromium_src-737402392b58715c71ed52b210ee62124f06b18c.tar.bz2 |
Unbind currently bound surface before binding new surface.
BUG=chrome-os-partner:4967
TEST=manual
Review URL: http://codereview.chromium.org/7446008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93068 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins')
-rw-r--r-- | webkit/plugins/ppapi/ppapi_plugin_instance.cc | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc index fc06da4..3261ec2 100644 --- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc +++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc @@ -1344,20 +1344,22 @@ PPB_Instance_FunctionAPI* PluginInstance::AsPPB_Instance_FunctionAPI() { PP_Bool PluginInstance::BindGraphics(PP_Instance instance, PP_Resource device) { - if (!device) { + if (bound_graphics_.get()) { + if (bound_graphics_2d()) { + bound_graphics_2d()->BindToInstance(NULL); + } else if (bound_graphics_.get()) { + bound_graphics_3d()->BindToInstance(false); + } // Special-case clearing the current device. - if (bound_graphics_.get()) { - if (bound_graphics_2d()) { - bound_graphics_2d()->BindToInstance(NULL); - } else if (bound_graphics_.get()) { - bound_graphics_3d()->BindToInstance(false); - } + if (!device) { setBackingTextureId(0); InvalidateRect(gfx::Rect()); } - bound_graphics_ = NULL; - return PP_TRUE; } + bound_graphics_ = NULL; + + if (!device) + return PP_TRUE; EnterResourceNoLock<PPB_Graphics2D_API> enter_2d(device, false); PPB_Graphics2D_Impl* graphics_2d = enter_2d.succeeded() ? |