diff options
author | piman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-09 01:08:18 +0000 |
---|---|---|
committer | piman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-09 01:08:18 +0000 |
commit | 3a95d11692d594cedaa312ee420189b13621038f (patch) | |
tree | 0e3f848fa56f0c0871749867d3cda2c52aeac9d8 /webkit/plugins/ppapi/ppb_context_3d_impl.cc | |
parent | bba32084c5b9914310b8f74359512f5729f179a9 (diff) | |
download | chromium_src-3a95d11692d594cedaa312ee420189b13621038f.zip chromium_src-3a95d11692d594cedaa312ee420189b13621038f.tar.gz chromium_src-3a95d11692d594cedaa312ee420189b13621038f.tar.bz2 |
Fix surface destruction, broken by r90096
Also, initialize parameter passed to GetShaderiv/GetProgramiv that trigger asserts in debug.
BUG=chromium-os:17082
TEST=youtube with pepper flash, go fullscreen and back.
Review URL: http://codereview.chromium.org/7328012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91934 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins/ppapi/ppb_context_3d_impl.cc')
-rw-r--r-- | webkit/plugins/ppapi/ppb_context_3d_impl.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/webkit/plugins/ppapi/ppb_context_3d_impl.cc b/webkit/plugins/ppapi/ppb_context_3d_impl.cc index e680217..e4384b4 100644 --- a/webkit/plugins/ppapi/ppb_context_3d_impl.cc +++ b/webkit/plugins/ppapi/ppb_context_3d_impl.cc @@ -144,7 +144,11 @@ int32_t PPB_Context3D_Impl::BindSurfaces(PP_Resource draw, PP_Resource read) { return PP_ERROR_BADRESOURCE; PPB_Surface3D_Impl* new_read = static_cast<PPB_Surface3D_Impl*>(enter_read.object()); + return BindSurfacesImpl(new_draw, new_read); +} +int32_t PPB_Context3D_Impl::BindSurfacesImpl(PPB_Surface3D_Impl* new_draw, + PPB_Surface3D_Impl* new_read) { // TODO(alokp): Support separate draw-read surfaces. DCHECK_EQ(new_draw, new_read); if (new_draw != new_read) @@ -153,12 +157,12 @@ int32_t PPB_Context3D_Impl::BindSurfaces(PP_Resource draw, PP_Resource read) { if (new_draw == draw_surface_) return PP_OK; - if (new_draw->context()) + if (new_draw && new_draw->context()) return PP_GRAPHICS3DERROR_BAD_ACCESS; // Already bound. if (draw_surface_) draw_surface_->BindToContext(NULL); - if (!new_draw->BindToContext(this)) + if (new_draw && !new_draw->BindToContext(this)) return PP_ERROR_NOMEMORY; draw_surface_ = new_draw; |