зеркало из https://github.com/mozilla/gecko-dev.git
Bug 959171 - Fix how to bind EGLImage in GrallocTextureHostOGL. r=nical
This commit is contained in:
Родитель
0683b9ca72
Коммит
49020f300b
|
@ -122,6 +122,10 @@ void GrallocTextureSourceOGL::BindTexture(GLenum aTextureUnit)
|
|||
|
||||
gl()->fActiveTexture(aTextureUnit);
|
||||
gl()->fBindTexture(textureTarget, tex);
|
||||
if (!mEGLImage) {
|
||||
mEGLImage = EGLImageCreateFromNativeBuffer(gl(), mGraphicBuffer->getNativeBuffer());
|
||||
}
|
||||
gl()->fEGLImageTargetTexture2D(textureTarget, mEGLImage);
|
||||
gl()->fActiveTexture(LOCAL_GL_TEXTURE0);
|
||||
}
|
||||
|
||||
|
@ -173,6 +177,13 @@ GrallocTextureSourceOGL::SetCompositableBackendSpecificData(CompositableBackendS
|
|||
}
|
||||
|
||||
if (!mNeedsReset) {
|
||||
// Update binding to the EGLImage
|
||||
gl()->MakeCurrent();
|
||||
GLuint tex = GetGLTexture();
|
||||
GLuint textureTarget = GetTextureTarget();
|
||||
gl()->fActiveTexture(LOCAL_GL_TEXTURE0);
|
||||
gl()->fBindTexture(textureTarget, tex);
|
||||
gl()->fEGLImageTargetTexture2D(textureTarget, mEGLImage);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -225,6 +225,7 @@ CompositableDataGonkOGL::DeleteTextureIfPresent()
|
|||
if (gl()->MakeCurrent()) {
|
||||
gl()->fDeleteTextures(1, &mTexture);
|
||||
}
|
||||
mTexture = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче