GLESv2 translator: don't delete EGLImage textures
Copy changesfaaf1553cfandf37a7ed6c5from the GLESv1 translator to the GLESv2 translator. After this, both translators use the same logic for glEGLImageTargetTexture2DOES(). Change-Id: I0a95bf2301df7b7428abc593f38170edf4cbda30
This commit is contained in:
@@ -1682,6 +1682,7 @@ GL_API void GL_APIENTRY glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOE
|
||||
texData->internalFormat = img->internalFormat;
|
||||
texData->sourceEGLImage = (unsigned int)image;
|
||||
texData->eglImageDetach = s_eglIface->eglDetachEGLImage;
|
||||
texData->oldGlobal = oldGlobal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright(C) 2011 The Android Open Source Project
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0(the "License"){ GET_CTX();}
|
||||
* Licensed under the Apache License, Version 2.0 (the "License")
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
@@ -2017,15 +2017,22 @@ GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES(GLenum target, GLeglIma
|
||||
if (ctx->shareGroup().Ptr()) {
|
||||
ObjectLocalName tex = TextureLocalName(target,ctx->getBindedTexture(target));
|
||||
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) {
|
||||
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
|
||||
ctx->shareGroup()->replaceGlobalName(TEXTURE, tex,img->globalTexName);
|
||||
ctx->dispatcher().glBindTexture(GL_TEXTURE_2D, img->globalTexName);
|
||||
TextureData *texData = getTextureTargetData(target);
|
||||
SET_ERROR_IF(texData==NULL,GL_INVALID_OPERATION);
|
||||
texData->width = img->width;
|
||||
texData->height = img->height;
|
||||
texData->border = img->border;
|
||||
texData->internalFormat = img->internalFormat;
|
||||
texData->sourceEGLImage = (unsigned int)image;
|
||||
texData->eglImageDetach = s_eglIface->eglDetachEGLImage;
|
||||
texData->oldGlobal = oldGlobal;
|
||||
|
||||
Reference in New Issue
Block a user