diff options
-rw-r--r-- | content/renderer/render_widget_fullscreen_pepper.cc | 4 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_context_3d_impl.cc | 8 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_context_3d_impl.h | 2 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_surface_3d_impl.cc | 2 |
4 files changed, 11 insertions, 5 deletions
diff --git a/content/renderer/render_widget_fullscreen_pepper.cc b/content/renderer/render_widget_fullscreen_pepper.cc index b9d3e21..04f9c1c 100644 --- a/content/renderer/render_widget_fullscreen_pepper.cc +++ b/content/renderer/render_widget_fullscreen_pepper.cc @@ -390,7 +390,7 @@ GLuint CreateShaderFromSource(gpu::gles2::GLES2Implementation* gl, GLuint shader = gl->CreateShader(type); gl->ShaderSource(shader, 1, &source, NULL); gl->CompileShader(shader); - int status; + int status = GL_FALSE; gl->GetShaderiv(shader, GL_COMPILE_STATUS, &status); if (!status) { int size = 0; @@ -432,7 +432,7 @@ bool RenderWidgetFullscreenPepper::InitContext() { gl->BindAttribLocation(program_, 0, "in_tex_coord"); gl->LinkProgram(program_); - int status; + int status = GL_FALSE; gl->GetProgramiv(program_, GL_LINK_STATUS, &status); if (!status) { int size = 0; 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; diff --git a/webkit/plugins/ppapi/ppb_context_3d_impl.h b/webkit/plugins/ppapi/ppb_context_3d_impl.h index f4660dd..c64a7d6 100644 --- a/webkit/plugins/ppapi/ppb_context_3d_impl.h +++ b/webkit/plugins/ppapi/ppb_context_3d_impl.h @@ -73,6 +73,8 @@ class PPB_Context3D_Impl : public Resource, GLenum access) OVERRIDE; virtual void UnmapTexSubImage2DCHROMIUM(const void* mem) OVERRIDE; + int32_t BindSurfacesImpl(PPB_Surface3D_Impl* draw, PPB_Surface3D_Impl* read); + gpu::gles2::GLES2Implementation* gles2_impl() { return gles2_impl_.get(); } diff --git a/webkit/plugins/ppapi/ppb_surface_3d_impl.cc b/webkit/plugins/ppapi/ppb_surface_3d_impl.cc index 40c40cd..5cab3f6d0 100644 --- a/webkit/plugins/ppapi/ppb_surface_3d_impl.cc +++ b/webkit/plugins/ppapi/ppb_surface_3d_impl.cc @@ -29,7 +29,7 @@ PPB_Surface3D_Impl::PPB_Surface3D_Impl(PluginInstance* instance) PPB_Surface3D_Impl::~PPB_Surface3D_Impl() { if (context_) - context_->BindSurfaces(0, 0); + context_->BindSurfacesImpl(NULL, NULL); } // static |