summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreveman@google.com <reveman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-19 19:02:37 +0000
committerreveman@google.com <reveman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-19 19:02:37 +0000
commit58c6137cf9c280a6cb0ea76b584ef15db9eb20d4 (patch)
treee5829cc2313486898afe979ee6c6fdc564a9f040
parent9fbb5d81032bc77813ad2c490e7ad8efb588b3c6 (diff)
downloadchromium_src-58c6137cf9c280a6cb0ea76b584ef15db9eb20d4.zip
chromium_src-58c6137cf9c280a6cb0ea76b584ef15db9eb20d4.tar.gz
chromium_src-58c6137cf9c280a6cb0ea76b584ef15db9eb20d4.tar.bz2
Merge 93068 - Unbind currently bound surface before binding new surface.
BUG=chrome-os-partner:4967 TEST=manual Review URL: http://codereview.chromium.org/7446008 TBR=reveman@google.com Review URL: http://codereview.chromium.org/7446013 git-svn-id: svn://svn.chromium.org/chrome/branches/782/src@93072 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/plugins/ppapi/ppapi_plugin_instance.cc20
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 e73cf09..7d30d3b 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
@@ -510,20 +510,22 @@ PP_Var PluginInstance::GetOwnerElementObject() {
}
bool PluginInstance::BindGraphics(PP_Resource graphics_id) {
- if (!graphics_id) {
+ 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 (!graphics_id) {
setBackingTextureId(0);
InvalidateRect(gfx::Rect());
}
- bound_graphics_ = NULL;
- return true;
}
+ bound_graphics_ = NULL;
+
+ if (!graphics_id)
+ return true;
scoped_refptr<PPB_Graphics2D_Impl> graphics_2d =
Resource::GetAs<PPB_Graphics2D_Impl>(graphics_id);