Bug 774059 - Fix up references to glEGLImageTargetTexture2D - r=bjacob

This commit is contained in:
Jeff Gilbert 2012-07-19 21:14:14 -07:00
parent cd755fc432
commit be44ef0388
7 changed files with 25 additions and 32 deletions

View File

@ -79,6 +79,7 @@ static const char *sExtensionNames[] = {
"GL_ARB_sync",
"GL_OES_EGL_image",
"GL_OES_EGL_sync",
"GL_OES_EGL_image_external",
nsnull
};
@ -470,7 +471,7 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl)
if (IsExtensionSupported(OES_EGL_image)) {
SymLoadStruct imageSymbols[] = {
{ (PRFuncPtr*) &mSymbols.fImageTargetTexture2D, { "EGLImageTargetTexture2DOES", nsnull } },
{ (PRFuncPtr*) &mSymbols.fEGLImageTargetTexture2D, { "EGLImageTargetTexture2DOES", nsnull } },
{ nsnull, { nsnull } },
};
@ -478,7 +479,7 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl)
NS_ERROR("GL supports OES_EGL_image without supplying its functions.");
MarkExtensionUnsupported(OES_EGL_image);
mSymbols.fImageTargetTexture2D = nsnull;
mSymbols.fEGLImageTargetTexture2D = nsnull;
}
}

View File

@ -1535,6 +1535,7 @@ public:
ARB_sync,
OES_EGL_image,
OES_EGL_sync,
OES_EGL_image_external,
Extensions_Max
};
@ -3083,10 +3084,10 @@ public:
}
// OES_EGL_image (GLES)
void fImageTargetTexture2D(GLenum target, GLeglImage image)
void fEGLImageTargetTexture2D(GLenum target, GLeglImage image)
{
BEFORE_GL_CALL;
mSymbols.fImageTargetTexture2D(target, image);
mSymbols.fEGLImageTargetTexture2D(target, image);
AFTER_GL_CALL;
}

View File

@ -43,8 +43,6 @@
using namespace android;
# define EGL_NATIVE_BUFFER_ANDROID 0x3140
# define EGL_IMAGE_PRESERVED_KHR 0x30D2
# define GL_TEXTURE_EXTERNAL_OES 0x8D65
# endif
@ -408,15 +406,15 @@ public:
{
#if defined(MOZ_WIDGET_GONK)
EGLint attrs[] = {
EGL_IMAGE_PRESERVED_KHR, LOCAL_EGL_TRUE,
LOCAL_EGL_IMAGE_PRESERVED, LOCAL_EGL_TRUE,
LOCAL_EGL_NONE, LOCAL_EGL_NONE
};
EGLImage image = sEGLLibrary.fCreateImage(EGL_DISPLAY(),
EGL_NO_CONTEXT,
EGL_NATIVE_BUFFER_ANDROID,
buffer, attrs);
sEGLLibrary.fImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, image);
fBindTexture(GL_TEXTURE_EXTERNAL_OES, texture);
fEGLImageTargetTexture2D(LOCAL_GL_TEXTURE_EXTERNAL, image);
fBindTexture(LOCAL_GL_TEXTURE_EXTERNAL, texture);
sEGLLibrary.fDestroyImage(EGL_DISPLAY(), image);
return true;
#else
@ -881,7 +879,7 @@ bool GLContextEGL::AttachSharedHandle(TextureImage::TextureShareType aType,
EGLTextureWrapper* wrap = (EGLTextureWrapper*)aSharedHandle;
wrap->WaitSync();
sEGLLibrary.fImageTargetTexture2DOES(LOCAL_GL_TEXTURE_2D, wrap->GetEGLImage());
fEGLImageTargetTexture2D(LOCAL_GL_TEXTURE_2D, wrap->GetEGLImage());
return true;
}
@ -1327,7 +1325,7 @@ public:
if (UsingDirectTexture()) {
mGLContext->fActiveTexture(aTextureUnit);
mGLContext->fBindTexture(LOCAL_GL_TEXTURE_2D, mTexture);
sEGLLibrary.fImageTargetTexture2DOES(LOCAL_GL_TEXTURE_2D, mEGLImage);
mGLContext->fEGLImageTargetTexture2D(LOCAL_GL_TEXTURE_2D, mEGLImage);
if (sEGLLibrary.fGetError() != LOCAL_EGL_SUCCESS) {
LOG("Could not set image target texture. ERROR (0x%04x)", sEGLLibrary.fGetError());
}
@ -1587,7 +1585,7 @@ public:
mEGLImage =
sEGLLibrary.fCreateImage(EGL_DISPLAY(),
EGL_NO_CONTEXT,
LOCAL_EGL_NATIVE_PIXMAP_KHR,
LOCAL_EGL_NATIVE_PIXMAP,
(EGLClientBuffer)xsurface->XDrawable(),
nsnull);
@ -1596,7 +1594,7 @@ public:
return false;
}
mGLContext->fBindTexture(LOCAL_GL_TEXTURE_2D, mTexture);
mGLContext->fImageTargetTexture2D(LOCAL_GL_TEXTURE_2D, mEGLImage);
mGLContext->fEGLImageTargetTexture2D(LOCAL_GL_TEXTURE_2D, mEGLImage);
sEGLLibrary.fDestroyImage(EGL_DISPLAY(), mEGLImage);
mEGLImage = nsnull;
} else {
@ -1625,7 +1623,7 @@ public:
GraphicBuffer::USAGE_SW_WRITE_OFTEN;
mGraphicBuffer = new GraphicBuffer(aSize.width, aSize.height, format, usage);
if (mGraphicBuffer->initCheck() == OK) {
const int eglImageAttributes[] = { EGL_IMAGE_PRESERVED_KHR, LOCAL_EGL_TRUE,
const int eglImageAttributes[] = { LOCAL_EGL_IMAGE_PRESERVED, LOCAL_EGL_TRUE,
LOCAL_EGL_NONE, LOCAL_EGL_NONE };
mEGLImage = sEGLLibrary.fCreateImage(EGL_DISPLAY(),
EGL_NO_CONTEXT,

View File

@ -373,8 +373,8 @@ struct GLContextSymbols
PFNGLGETSYNCIV fGetSynciv;
// OES_egl_image
typedef void (GLAPIENTRY * PFNGLIMAGETARGETTEXTURE2D)(GLenum target, GLeglImage image);
PFNGLIMAGETARGETTEXTURE2D fImageTargetTexture2D;
typedef void (GLAPIENTRY * PFNGLEGLIMAGETARGETTEXTURE2D)(GLenum target, GLeglImage image);
PFNGLEGLIMAGETARGETTEXTURE2D fEGLImageTargetTexture2D;
};
}

View File

@ -3024,6 +3024,9 @@ typedef void* GLeglImage;
#define LOCAL_GL_CONDITION_SATISFIED 0x911C
#define LOCAL_GL_WAIT_FAILED 0x911D
// OES_EGL_image_external
#define LOCAL_GL_TEXTURE_EXTERNAL 0x8D65
#define LOCAL_GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
#define LOCAL_GL_MAX_VARYING_VECTORS 0x8DFC
#define LOCAL_GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
@ -3236,8 +3239,6 @@ typedef void* GLeglImage;
#define LOCAL_EGL_TEXTURE_RGB 0x305D
#define LOCAL_EGL_TEXTURE_RGBA 0x305E
#define LOCAL_EGL_TEXTURE_2D 0x305F
#define LOCAL_EGL_NATIVE_PIXMAP_KHR 0x30B0
#define LOCAL_EGL_IMAGE_PRESERVED_KHR 0x30D2
#define LOCAL_EGL_FALSE 0
#define LOCAL_EGL_TRUE 1
#define LOCAL_EGL_BITMAP_POINTER_KHR 0x30C6
@ -3253,6 +3254,12 @@ typedef void* GLeglImage;
#define LOCAL_EGL_DRAW 0x3059
#define LOCAL_EGL_CONTEXT_LOST 0x300E
// EGL_KHR_image_base (not supplied by EGL_KHR_image!)
#define LOCAL_EGL_IMAGE_PRESERVED 0x30D2
// EGL_KHR_image_pixmap
#define LOCAL_EGL_NATIVE_PIXMAP 0x30B0
// EGL_KHR_gl_texture_2D_image
#define LOCAL_EGL_GL_TEXTURE_2D 0x30B1

View File

@ -309,7 +309,6 @@ GLLibraryEGL::LoadConfigSensitiveSymbols()
GLLibraryLoader::SymLoadStruct imageSymbols[] = {
{ (PRFuncPtr*) &mSymbols.fCreateImage, { "eglCreateImageKHR", nsnull } },
{ (PRFuncPtr*) &mSymbols.fDestroyImage, { "eglDestroyImageKHR", nsnull } },
{ (PRFuncPtr*) &mSymbols.fImageTargetTexture2DOES, { "glEGLImageTargetTexture2DOES", NULL } },
{ nsnull, { nsnull } }
};
@ -325,7 +324,6 @@ GLLibraryEGL::LoadConfigSensitiveSymbols()
mSymbols.fCreateImage = nsnull;
mSymbols.fDestroyImage = nsnull;
mSymbols.fImageTargetTexture2DOES = nsnull;
}
} else {
MarkExtensionUnsupported(KHR_image_pixmap);

View File

@ -421,13 +421,6 @@ public:
return b;
}
void fImageTargetTexture2DOES(GLenum target, EGLImage image)
{
BEFORE_GL_CALL;
mSymbols.fImageTargetTexture2DOES(target, image);
AFTER_GL_CALL;
}
EGLDisplay Display() {
return mEGLDisplay;
@ -542,11 +535,6 @@ public:
pfnClientWaitSync fClientWaitSync;
typedef EGLBoolean (GLAPIENTRY * pfnGetSyncAttrib)(EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLint *value);
pfnGetSyncAttrib fGetSyncAttrib;
// This is EGL specific GL ext symbol "glEGLImageTargetTexture2DOES"
// Lets keep it here for now.
typedef void (GLAPIENTRY * pfnImageTargetTexture2DOES)(GLenum target, EGLImage image);
pfnImageTargetTexture2DOES fImageTargetTexture2DOES;
} mSymbols;
private: