Bug 786747 - Fix the BindTexture order and re-bind textures correctly. r=jgilbert

--HG--
extra : rebase_source : 87c790e359ca64d1b7dcc34920281e9861d16db9
This commit is contained in:
Kan-Ru Chen (陳侃如) 2012-08-29 18:20:30 -03:00
parent 6de4eae610
commit 3c509a0dcc
2 changed files with 6 additions and 1 deletions

View File

@ -424,8 +424,8 @@ public:
EGL_NO_CONTEXT, EGL_NO_CONTEXT,
EGL_NATIVE_BUFFER_ANDROID, EGL_NATIVE_BUFFER_ANDROID,
buffer, attrs); buffer, attrs);
fEGLImageTargetTexture2D(LOCAL_GL_TEXTURE_EXTERNAL, image);
fBindTexture(LOCAL_GL_TEXTURE_EXTERNAL, texture); fBindTexture(LOCAL_GL_TEXTURE_EXTERNAL, texture);
fEGLImageTargetTexture2D(LOCAL_GL_TEXTURE_EXTERNAL, image);
sEGLLibrary.fDestroyImage(EGL_DISPLAY(), image); sEGLLibrary.fDestroyImage(EGL_DISPLAY(), image);
return true; return true;
#else #else

View File

@ -953,6 +953,10 @@ ShadowImageLayerOGL::RenderLayer(int aPreviousFrameBuffer,
} }
#ifdef MOZ_WIDGET_GONK #ifdef MOZ_WIDGET_GONK
} else if (mExternalBufferTexture.IsAllocated()) { } else if (mExternalBufferTexture.IsAllocated()) {
gl()->MakeCurrent();
gl()->fActiveTexture(LOCAL_GL_TEXTURE0);
gl()->fBindTexture(LOCAL_GL_TEXTURE_EXTERNAL, mExternalBufferTexture.GetTextureID());
ShaderProgramOGL *program = mOGLManager->GetProgram(RGBAExternalLayerProgramType, GetMaskLayer()); ShaderProgramOGL *program = mOGLManager->GetProgram(RGBAExternalLayerProgramType, GetMaskLayer());
gl()->ApplyFilterToBoundTexture(mFilter); gl()->ApplyFilterToBoundTexture(mFilter);
@ -969,6 +973,7 @@ ShadowImageLayerOGL::RenderLayer(int aPreviousFrameBuffer,
mOGLManager->BindAndDrawQuadWithTextureRect(program, mOGLManager->BindAndDrawQuadWithTextureRect(program,
GetVisibleRegion().GetBounds(), GetVisibleRegion().GetBounds(),
nsIntSize(mSize.width, mSize.height)); nsIntSize(mSize.width, mSize.height));
gl()->fBindTexture(LOCAL_GL_TEXTURE_EXTERNAL, 0);
#endif #endif
} else if (mSharedHandle) { } else if (mSharedHandle) {
GLContext::SharedHandleDetails handleDetails; GLContext::SharedHandleDetails handleDetails;