am 25902c05: am f37a7ed6: GLES translator: don\'t delete EGLImage textures

* commit '25902c05406daaaa1605e13a30b1323e14a3acf2':
  GLES translator: don't delete EGLImage textures
This commit is contained in:
Jesse Hall
2011-11-22 15:39:44 -08:00
committed by Android Git Automerger

View File

@@ -1664,9 +1664,12 @@ GL_API void GL_APIENTRY glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOE
if (ctx->shareGroup().Ptr()) { if (ctx->shareGroup().Ptr()) {
ObjectLocalName tex = TextureLocalName(target,ctx->getBindedTexture(target)); ObjectLocalName tex = TextureLocalName(target,ctx->getBindedTexture(target));
unsigned int oldGlobal = ctx->shareGroup()->getGlobalName(TEXTURE, tex); unsigned int oldGlobal = ctx->shareGroup()->getGlobalName(TEXTURE, tex);
// Delete old texture object // Delete old texture object but only if it is not a target of a EGLImage
if (oldGlobal) { if (oldGlobal) {
ctx->dispatcher().glDeleteTextures(1, &oldGlobal); TextureData* oldTexData = getTextureData(tex);
if (!oldTexData || oldTexData->sourceEGLImage == 0) {
ctx->dispatcher().glDeleteTextures(1, &oldGlobal);
}
} }
// replace mapping and bind the new global object // replace mapping and bind the new global object
ctx->shareGroup()->replaceGlobalName(TEXTURE, tex,img->globalTexName); ctx->shareGroup()->replaceGlobalName(TEXTURE, tex,img->globalTexName);