am 682f9143: am e6c1178e: Merge "use Translator\'s glTexImage2D in doCompressedTexImage2D"

* commit '682f914304e270824ebf050993d376ddb06613a4':
  use Translator's glTexImage2D in doCompressedTexImage2D
This commit is contained in:
David Turner
2011-07-14 16:03:52 -07:00
committed by Android Git Automerger
4 changed files with 12 additions and 6 deletions

View File

@@ -430,7 +430,7 @@ GL_API void GL_APIENTRY glCompressedTexImage2D( GLenum target, GLint level, GLe
doCompressedTexImage2D(ctx, target, level, internalformat,
width, height, border,
imageSize, data);
imageSize, data, (void*)glTexImage2D);
}
GL_API void GL_APIENTRY glCompressedTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) {

View File

@@ -293,7 +293,7 @@ GL_APICALL void GL_APIENTRY glCompressedTexImage2D(GLenum target, GLint level,
doCompressedTexImage2D(ctx, target, level, internalformat,
width, height, border,
imageSize, data);
imageSize, data, (void*)glTexImage2D);
}
GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data){

View File

@@ -15,6 +15,7 @@
*/
#include <GLcommon/TextureUtils.h>
#include <GLcommon/GLESmacros.h>
#include <GLcommon/GLDispatch.h>
#include <GLcommon/GLESvalidate.h>
#include <stdio.h>
#include <cmath>
@@ -41,8 +42,13 @@ int getCompressedFormats(int* formats){
void doCompressedTexImage2D(GLEScontext * ctx, GLenum target, GLint level,
GLenum internalformat, GLsizei width,
GLsizei height, GLint border,
GLsizei imageSize, const GLvoid* data)
GLsizei imageSize, const GLvoid* data, void * funcPtr)
{
/* XXX: This is just a hack to fix the resolve of glTexImage2D problem
It will be removed when we'll no longer link against ligGL */
typedef void (GLAPIENTRY *glTexImage2DPtr_t ) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
glTexImage2DPtr_t glTexImage2DPtr;
glTexImage2DPtr = (glTexImage2DPtr_t)funcPtr;
switch (internalformat) {
case GL_ETC1_RGB8_OES:
@@ -60,7 +66,7 @@ void doCompressedTexImage2D(GLEScontext * ctx, GLenum target, GLint level,
etc1_byte* pOut = new etc1_byte[size];
int res = etc1_decode_image((const etc1_byte*)data, pOut, width, height, 3, bpr);
SET_ERROR_IF(res!=0, GL_INVALID_VALUE);
ctx->dispatcher().glTexImage2D(target,level,format,width,height,border,format,type,pOut);
glTexImage2DPtr(target,level,format,width,height,border,format,type,pOut);
delete [] pOut;
}
break;
@@ -88,7 +94,7 @@ void doCompressedTexImage2D(GLEScontext * ctx, GLenum target, GLint level,
{
GLenum uncompressedFrmt;
unsigned char* uncompressed = uncompressTexture(internalformat,uncompressedFrmt,width,height,imageSize,data,i);
ctx->dispatcher().glTexImage2D(target,i,uncompressedFrmt,tmpWidth,tmpHeight,border,uncompressedFrmt,GL_UNSIGNED_BYTE,uncompressed);
glTexImage2DPtr(target,i,uncompressedFrmt,tmpWidth,tmpHeight,border,uncompressedFrmt,GL_UNSIGNED_BYTE,uncompressed);
tmpWidth/=2;
tmpHeight/=2;
delete uncompressed;

View File

@@ -26,6 +26,6 @@ int getCompressedFormats(int* formats);
void doCompressedTexImage2D(GLEScontext * ctx, GLenum target, GLint level,
GLenum internalformat, GLsizei width,
GLsizei height, GLint border,
GLsizei imageSize, const GLvoid* data);
GLsizei imageSize, const GLvoid* data, void * funcPtr);
#endif