Bug 762259 - Drop vendor suffixes from EGLImage for internal uses - r=bjacob
authorJeff Gilbert <jgilbert@mozilla.com>
Tue, 12 Jun 2012 14:36:10 -0700
changeset 96525 50356ba76bbf53a6a67fa693e3007e7802cb52c6
parent 96524 d4820f5ac8255d9084ea8f7a19e38d4c0dd67c3e
child 96526 27d0a3ecfe952b3513acc45d187da44c280a58ed
push id22911
push useremorley@mozilla.com
push dateWed, 13 Jun 2012 12:49:30 +0000
treeherdermozilla-central@efbb6480e98e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbjacob
bugs762259
milestone16.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 762259 - Drop vendor suffixes from EGLImage for internal uses - r=bjacob
gfx/gl/GLContext.cpp
gfx/gl/GLContext.h
gfx/gl/GLContextProviderEGL.cpp
gfx/gl/GLContextSymbols.h
gfx/gl/GLDefs.h
gfx/gl/GLLibraryEGL.cpp
gfx/gl/GLLibraryEGL.h
--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -69,16 +69,17 @@ static const char *sExtensionNames[] = {
     "GL_EXT_framebuffer_blit",
     "GL_ANGLE_framebuffer_blit",
     "GL_EXT_framebuffer_multisample",
     "GL_ANGLE_framebuffer_multisample",
     "GL_OES_rgb8_rgba8",
     "GL_ARB_robustness",
     "GL_EXT_robustness",
     "GL_ARB_sync",
+    "GL_OES_EGL_image",
     NULL
 };
 
 /*
  * XXX - we should really know the ARB/EXT variants of these
  * instead of only handling the symbol if it's exposed directly.
  */
 
@@ -456,16 +457,30 @@ GLContext::InitWithPrefix(const char *pr
                 mSymbols.fIsSync = nsnull;
                 mSymbols.fDeleteSync = nsnull;
                 mSymbols.fClientWaitSync = nsnull;
                 mSymbols.fWaitSync = nsnull;
                 mSymbols.fGetInteger64v = nsnull;
                 mSymbols.fGetSynciv = nsnull;
             }
         }
+
+        if (IsExtensionSupported(OES_EGL_image)) {
+            SymLoadStruct imageSymbols[] = {
+                { (PRFuncPtr*) &mSymbols.fImageTargetTexture2D, { "glEGLImageTargetTexture2DOES", nsnull } },
+                { nsnull, { nsnull } },
+            };
+
+            if (!LoadSymbols(&imageSymbols[0], trygl, prefix)) {
+                NS_ERROR("GL supports ARB_sync without supplying its functions.");
+
+                MarkExtensionUnsupported(OES_EGL_image);
+                mSymbols.fImageTargetTexture2D = nsnull;
+            }
+        }
        
         // Load developer symbols, don't fail if we can't find them.
         SymLoadStruct auxSymbols[] = {
                 { (PRFuncPtr*) &mSymbols.fGetTexImage, { "GetTexImage", nsnull } },
                 { (PRFuncPtr*) &mSymbols.fGetTexLevelParameteriv, { "GetTexLevelParameteriv", nsnull } },
                 { nsnull, { nsnull } },
         };
         LoadSymbols(&auxSymbols[0], trygl, prefix);
--- a/gfx/gl/GLContext.h
+++ b/gfx/gl/GLContext.h
@@ -1498,16 +1498,17 @@ public:
         EXT_framebuffer_blit,
         ANGLE_framebuffer_blit,
         EXT_framebuffer_multisample,
         ANGLE_framebuffer_multisample,
         OES_rgb8_rgba8,
         ARB_robustness,
         EXT_robustness,
         ARB_sync,
+        OES_EGL_image,
         Extensions_Max
     };
 
     bool IsExtensionSupported(GLExtensions aKnownExtension) {
         return mAvailableExtensions[aKnownExtension];
     }
 
     void MarkExtensionUnsupported(GLExtensions aKnownExtension) {
@@ -3002,16 +3003,24 @@ public:
      }
 
      void GLAPIENTRY fGetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values) {
          BEFORE_GL_CALL;
          mSymbols.fGetSynciv(sync, pname, bufSize, length, values);
          AFTER_GL_CALL;
      }
 
+     // OES_EGL_image (GLES)
+     void fImageTargetTexture2D(GLenum target, GLeglImage image)
+     {
+         BEFORE_GL_CALL;
+         mSymbols.fImageTargetTexture2D(target, image);
+         AFTER_GL_CALL;
+     }
+
 #ifdef DEBUG
     void THEBES_API CreatedProgram(GLContext *aOrigin, GLuint aName);
     void THEBES_API CreatedShader(GLContext *aOrigin, GLuint aName);
     void THEBES_API CreatedBuffers(GLContext *aOrigin, GLsizei aCount, GLuint *aNames);
     void THEBES_API CreatedTextures(GLContext *aOrigin, GLsizei aCount, GLuint *aNames);
     void THEBES_API CreatedFramebuffers(GLContext *aOrigin, GLsizei aCount, GLuint *aNames);
     void THEBES_API CreatedRenderbuffers(GLContext *aOrigin, GLsizei aCount, GLuint *aNames);
     void THEBES_API DeletedProgram(GLContext *aOrigin, GLuint aName);
--- a/gfx/gl/GLContextProviderEGL.cpp
+++ b/gfx/gl/GLContextProviderEGL.cpp
@@ -771,17 +771,17 @@ public:
                     GLContext* aContext,
                     TextureImage::Flags aFlags = TextureImage::NoFlags)
         : TextureImage(aSize, aWrapMode, aContentType, aFlags)
         , mGLContext(aContext)
         , mUpdateFormat(gfxASurface::ImageFormatUnknown)
         , mSurface(nsnull)
         , mConfig(nsnull)
         , mTexture(aTexture)
-        , mImageKHR(nsnull)
+        , mEGLImage(nsnull)
         , mTextureState(Created)
         , mBound(false)
         , mIsLocked(false)
     {
         mUpdateFormat = gfxPlatform::GetPlatform()->OptimalFormatForContent(GetContentType());
 
         if (gUseBackingSurface) {
             if (mUpdateFormat != gfxASurface::ImageFormatARGB32) {
@@ -1099,17 +1099,17 @@ public:
         }
 
         static EGLint lock_attribs[] = {
             LOCAL_EGL_MAP_PRESERVE_PIXELS_KHR, LOCAL_EGL_TRUE,
             LOCAL_EGL_LOCK_USAGE_HINT_KHR, LOCAL_EGL_READ_SURFACE_BIT_KHR | LOCAL_EGL_WRITE_SURFACE_BIT_KHR,
             LOCAL_EGL_NONE
         };
 
-        sEGLLibrary.fLockSurfaceKHR(EGL_DISPLAY(), mSurface, lock_attribs);
+        sEGLLibrary.fLockSurface(EGL_DISPLAY(), mSurface, lock_attribs);
 
         mIsLocked = true;
 
         unsigned char *data = nsnull;
         int pitch = 0;
         int pixsize = 0;
 
         sEGLLibrary.fQuerySurface(EGL_DISPLAY(), mSurface, LOCAL_EGL_BITMAP_POINTER_KHR, (EGLint*)&data);
@@ -1127,17 +1127,17 @@ public:
 
     virtual void UnlockSurface()
     {
         if (!mIsLocked) {
             NS_WARNING("UnlockSurface called, surface not locked!");
             return;
         }
 
-        sEGLLibrary.fUnlockSurfaceKHR(EGL_DISPLAY(), mSurface);
+        sEGLLibrary.fUnlockSurface(EGL_DISPLAY(), mSurface);
         mIsLocked = false;
     }
 
     virtual already_AddRefed<gfxASurface> GetBackingSurface()
     {
         nsRefPtr<gfxASurface> copy = mBackingSurface;
         return copy.forget();
     }
@@ -1197,31 +1197,31 @@ public:
             gfxXlibSurface::Create(DefaultScreenOfDisplay(dpy),
                                    renderFMT,
                                    gfxIntSize(aSize.width, aSize.height));
 
         XSync(dpy, False);
         mConfig = nsnull;
 
         if (sEGLLibrary.HasKHRImagePixmap() && sEGLLibrary.HasKHRImageTexture2D()) {
-            mImageKHR =
-                sEGLLibrary.fCreateImageKHR(EGL_DISPLAY(),
-                                            EGL_NO_CONTEXT,
-                                            LOCAL_EGL_NATIVE_PIXMAP_KHR,
-                                            (EGLClientBuffer)xsurface->XDrawable(),
-                                            NULL);
+            mEGLImage =
+                sEGLLibrary.fCreateImage(EGL_DISPLAY(),
+                                         EGL_NO_CONTEXT,
+                                         LOCAL_EGL_NATIVE_PIXMAP_KHR,
+                                         (EGLClientBuffer)xsurface->XDrawable(),
+                                         nsnull);
 
-            if (!mImageKHR) {
+            if (!mEGLImage) {
                 printf_stderr("couldn't create EGL image: ERROR (0x%04x)\n", sEGLLibrary.fGetError());
                 return false;
             }
             mGLContext->fBindTexture(LOCAL_GL_TEXTURE_2D, mTexture);
-            sEGLLibrary.fImageTargetTexture2DOES(LOCAL_GL_TEXTURE_2D, mImageKHR);
-            sEGLLibrary.fDestroyImageKHR(EGL_DISPLAY(), mImageKHR);
-            mImageKHR = NULL;
+            mGLContext->fImageTargetTexture2D(LOCAL_GL_TEXTURE_2D, mEGLImage);
+            sEGLLibrary.fDestroyImage(EGL_DISPLAY(), mEGLImage);
+            mEGLImage = nsnull;
         } else {
             if (!CreateEGLSurface(xsurface)) {
                 printf_stderr("ProviderEGL Failed create EGL surface: ERROR (0x%04x)\n", sEGLLibrary.fGetError());
                 return false;
             }
 
             if (!BindTexImage()) {
                 printf_stderr("ProviderEGL Failed to bind teximage: ERROR (0x%04x)\n", sEGLLibrary.fGetError());
@@ -1242,17 +1242,17 @@ protected:
 
     nsIntRect mUpdateRect;
     ImageFormat mUpdateFormat;
     nsRefPtr<gfxASurface> mBackingSurface;
     nsRefPtr<gfxASurface> mUpdateSurface;
     EGLSurface mSurface;
     EGLConfig mConfig;
     GLuint mTexture;
-    EGLImageKHR mImageKHR;
+    EGLImage mEGLImage;
     TextureState mTextureState;
 
     bool mBound;
     bool mIsLocked;
 
     virtual void ApplyFilter()
     {
         mGLContext->ApplyFilterToBoundTexture(mFilter);
--- a/gfx/gl/GLContextSymbols.h
+++ b/gfx/gl/GLContextSymbols.h
@@ -349,31 +349,33 @@ struct GLContextSymbols
     typedef void* (GLAPIENTRY * PFNGLMAPBUFFER) (GLenum target, GLenum access);
     PFNGLMAPBUFFER fMapBuffer;
     typedef realGLboolean (GLAPIENTRY * PFNGLUNMAPBUFFER) (GLenum target);
     PFNGLUNMAPBUFFER fUnmapBuffer;
 
     typedef GLenum (GLAPIENTRY * PFNGLGETGRAPHICSRESETSTATUS) (void);
     PFNGLGETGRAPHICSRESETSTATUS fGetGraphicsResetStatus;
 
-    /*
-     * ARB_sync extension
-     */
+    // ARB_sync
     typedef GLsync (GLAPIENTRY * PFNGLFENCESYNC) (GLenum condition, GLbitfield flags);
     PFNGLFENCESYNC fFenceSync;
     typedef realGLboolean (GLAPIENTRY * PFNGLISSYNC) (GLsync sync);
     PFNGLISSYNC fIsSync;
     typedef void (GLAPIENTRY * PFNGLDELETESYNC) (GLsync sync);
     PFNGLDELETESYNC fDeleteSync;
     typedef GLenum (GLAPIENTRY * PFNGLCLIENTWAITSYNC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
     PFNGLCLIENTWAITSYNC fClientWaitSync;
     typedef void (GLAPIENTRY * PFNGLWAITSYNC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
     PFNGLWAITSYNC fWaitSync;
     typedef void (GLAPIENTRY * PFNGLGETINTEGER64V) (GLenum pname, GLint64 *params);
     PFNGLGETINTEGER64V fGetInteger64v;
     typedef void (GLAPIENTRY * PFNGLGETSYNCIV) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
     PFNGLGETSYNCIV fGetSynciv;
+
+    // OES_egl_image
+    typedef void (GLAPIENTRY * PFNGLIMAGETARGETTEXTURE2D)(GLenum target, GLeglImage image);
+    PFNGLIMAGETARGETTEXTURE2D fImageTargetTexture2D;
 };
 
 }
 }
 
 #endif /* GLCONTEXTSYMBOLS_H_ */
--- a/gfx/gl/GLDefs.h
+++ b/gfx/gl/GLDefs.h
@@ -35,20 +35,22 @@ typedef ptrdiff_t GLsizeiptr;
 typedef ptrdiff_t GLintptr;
 #endif
 
 #endif /* #if !defined(__gltypes_h_) && !defined(__gl_h_) */
 
 #include "mozilla/StandardInteger.h"
 
 // ARB_sync
-typedef struct __GLsync *GLsync;
+typedef struct __GLsync* GLsync;
 typedef int64_t GLint64;
 typedef uint64_t GLuint64;
 
+// OES_EGL_image (GLES)
+typedef void* GLeglImage;
 
 #ifndef GLAPIENTRY
 # ifdef WIN32
 #  define GLAPIENTRY APIENTRY
 #  define GLAPI
 # else
 #  define GLAPIENTRY
 #  define GLAPI
--- a/gfx/gl/GLLibraryEGL.cpp
+++ b/gfx/gl/GLLibraryEGL.cpp
@@ -196,51 +196,46 @@ GLLibraryEGL::EnsureInitialized()
         mHave_EGL_KHR_gl_texture_2D_image = true;
     }
 
     if (strstr(extensions, "EGL_KHR_lock_surface")) {
         mHave_EGL_KHR_lock_surface = true;
     }
 
     if (hasKHRImage) {
-        GLLibraryLoader::SymLoadStruct khrSymbols[] = {
-            { (PRFuncPtr*) &mSymbols.fCreateImageKHR, { "eglCreateImageKHR", NULL } },
-            { (PRFuncPtr*) &mSymbols.fDestroyImageKHR, { "eglDestroyImageKHR", NULL } },
-            { (PRFuncPtr*) &mSymbols.fImageTargetTexture2DOES, { "glEGLImageTargetTexture2DOES", NULL } },
+        GLLibraryLoader::SymLoadStruct imageSymbols[] = {
+            { (PRFuncPtr*) &mSymbols.fCreateImage, { "eglCreateImageKHR", NULL } },
+            { (PRFuncPtr*) &mSymbols.fDestroyImage, { "eglDestroyImageKHR", NULL } },
             { NULL, { NULL } }
         };
 
-        GLLibraryLoader::LoadSymbols(mEGLLibrary, &khrSymbols[0],
-                                         (GLLibraryLoader::PlatformLookupFunction)mSymbols.fGetProcAddress);
+        GLLibraryLoader::LoadSymbols(mEGLLibrary, &imageSymbols[0],
+                                     (GLLibraryLoader::PlatformLookupFunction)mSymbols.fGetProcAddress);
     }
 
     if (mHave_EGL_KHR_lock_surface) {
         GLLibraryLoader::SymLoadStruct lockSymbols[] = {
-            { (PRFuncPtr*) &mSymbols.fLockSurfaceKHR, { "eglLockSurfaceKHR", NULL } },
-            { (PRFuncPtr*) &mSymbols.fUnlockSurfaceKHR, { "eglUnlockSurfaceKHR", NULL } },
+            { (PRFuncPtr*) &mSymbols.fLockSurface, { "eglLockSurfaceKHR", NULL } },
+            { (PRFuncPtr*) &mSymbols.fUnlockSurface, { "eglUnlockSurfaceKHR", NULL } },
             { NULL, { NULL } }
         };
 
         GLLibraryLoader::LoadSymbols(mEGLLibrary, &lockSymbols[0],
-                                         (GLLibraryLoader::PlatformLookupFunction)mSymbols.fGetProcAddress);
-        if (!mSymbols.fLockSurfaceKHR) {
+                                     (GLLibraryLoader::PlatformLookupFunction)mSymbols.fGetProcAddress);
+        if (!mSymbols.fLockSurface) {
             mHave_EGL_KHR_lock_surface = false;
         }
     }
 
-    if (!mSymbols.fCreateImageKHR) {
+    if (!mSymbols.fCreateImage) {
         mHave_EGL_KHR_image_base = false;
         mHave_EGL_KHR_image_pixmap = false;
         mHave_EGL_KHR_gl_texture_2D_image = false;
     }
 
-    if (!mSymbols.fImageTargetTexture2DOES) {
-        mHave_EGL_KHR_gl_texture_2D_image = false;
-    }
-
     if (strstr(extensions, "EGL_ANGLE_surface_d3d_texture_2d_share_handle")) {
         GLLibraryLoader::SymLoadStruct d3dSymbols[] = {
             { (PRFuncPtr*) &mSymbols.fQuerySurfacePointerANGLE, { "eglQuerySurfacePointerANGLE", NULL } },
             { NULL, { NULL } }
         };
 
         GLLibraryLoader::LoadSymbols(mEGLLibrary, &d3dSymbols[0],
                                          (GLLibraryLoader::PlatformLookupFunction)mSymbols.fGetProcAddress);
--- a/gfx/gl/GLLibraryEGL.h
+++ b/gfx/gl/GLLibraryEGL.h
@@ -18,18 +18,17 @@ typedef int EGLint;
 typedef unsigned int EGLBoolean;
 typedef unsigned int EGLenum;
 typedef void *EGLConfig;
 typedef void *EGLContext;
 typedef void *EGLDisplay;
 typedef void *EGLSurface;
 typedef void *EGLClientBuffer;
 typedef void *EGLCastToRelevantPtr;
-typedef void *EGLImageKHR;
-typedef void *GLeglImageOES;
+typedef void *EGLImage;
 
 #if defined(XP_WIN)
 
 #ifndef WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN 1
 #endif
 
 #include <windows.h>
@@ -305,45 +304,45 @@ public:
     EGLBoolean fReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer)
     {
         BEFORE_GL_CALL;
         EGLBoolean b = mSymbols.fReleaseTexImage(dpy, surface, buffer);
         AFTER_GL_CALL;
         return b;
     }
 
-    EGLImageKHR fCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list)
+    EGLImage fCreateImage(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list)
     {
          BEFORE_GL_CALL;
-         EGLImageKHR i = mSymbols.fCreateImageKHR(dpy, ctx, target, buffer, attrib_list);
+         EGLImage i = mSymbols.fCreateImage(dpy, ctx, target, buffer, attrib_list);
          AFTER_GL_CALL;
          return i;
     }
 
-    EGLBoolean fDestroyImageKHR(EGLDisplay dpy, EGLImageKHR image)
+    EGLBoolean fDestroyImage(EGLDisplay dpy, EGLImage image)
     {
         BEFORE_GL_CALL;
-        EGLBoolean b = mSymbols.fDestroyImageKHR(dpy, image);
+        EGLBoolean b = mSymbols.fDestroyImage(dpy, image);
         AFTER_GL_CALL;
         return b;
     }
 
     // New extension which allow us to lock texture and get raw image pointer
-    EGLBoolean fLockSurfaceKHR(EGLDisplay dpy, EGLSurface surface, const EGLint *attrib_list)
+    EGLBoolean fLockSurface(EGLDisplay dpy, EGLSurface surface, const EGLint *attrib_list)
     {
         BEFORE_GL_CALL;
-        EGLBoolean b = mSymbols.fLockSurfaceKHR(dpy, surface, attrib_list);
+        EGLBoolean b = mSymbols.fLockSurface(dpy, surface, attrib_list);
         AFTER_GL_CALL;
         return b;
     }
 
-    EGLBoolean fUnlockSurfaceKHR(EGLDisplay dpy, EGLSurface surface)
+    EGLBoolean fUnlockSurface(EGLDisplay dpy, EGLSurface surface)
     {
         BEFORE_GL_CALL;
-        EGLBoolean b = mSymbols.fUnlockSurfaceKHR(dpy, surface);
+        EGLBoolean b = mSymbols.fUnlockSurface(dpy, surface);
         AFTER_GL_CALL;
         return b;
     }
 
     EGLBoolean fQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value)
     {
         BEFORE_GL_CALL;
         EGLBoolean b = mSymbols.fQuerySurface(dpy, surface, attribute, value);
@@ -354,25 +353,16 @@ public:
     EGLBoolean fQuerySurfacePointerANGLE(EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value)
     {
         BEFORE_GL_CALL;
         EGLBoolean b = mSymbols.fQuerySurfacePointerANGLE(dpy, surface, attribute, value);
         AFTER_GL_CALL;
         return b;
     }
 
-    // This is EGL specific GL ext symbol "glEGLImageTargetTexture2DOES"
-    // Lets keep it here for now.
-    void fImageTargetTexture2DOES(GLenum target, GLeglImageOES image)
-    {
-        BEFORE_GL_CALL;
-        mSymbols.fImageTargetTexture2DOES(target, image);
-        AFTER_GL_CALL;
-    }
-
     EGLDisplay Display() {
         return mEGLDisplay;
     }
 
     bool IsANGLE() {
         return mIsANGLE;
     }
 
@@ -451,36 +441,31 @@ public:
         pfnQueryString fQueryString;
         typedef EGLBoolean (GLAPIENTRY * pfnQueryContext)(EGLDisplay dpy, EGLContext ctx,
                                                           EGLint attribute, EGLint *value);
         pfnQueryContext fQueryContext;
         typedef EGLBoolean (GLAPIENTRY * pfnBindTexImage)(EGLDisplay, EGLSurface surface, EGLint buffer);
         pfnBindTexImage fBindTexImage;
         typedef EGLBoolean (GLAPIENTRY * pfnReleaseTexImage)(EGLDisplay, EGLSurface surface, EGLint buffer);
         pfnReleaseTexImage fReleaseTexImage;
-        typedef EGLImageKHR (GLAPIENTRY * pfnCreateImageKHR)(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
-        pfnCreateImageKHR fCreateImageKHR;
-        typedef EGLBoolean (GLAPIENTRY * pfnDestroyImageKHR)(EGLDisplay dpy, EGLImageKHR image);
-        pfnDestroyImageKHR fDestroyImageKHR;
+        typedef EGLImage (GLAPIENTRY * pfnCreateImage)(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
+        pfnCreateImage fCreateImage;
+        typedef EGLBoolean (GLAPIENTRY * pfnDestroyImage)(EGLDisplay dpy, EGLImage image);
+        pfnDestroyImage fDestroyImage;
 
         // New extension which allow us to lock texture and get raw image pointer
-        typedef EGLBoolean (GLAPIENTRY * pfnLockSurfaceKHR)(EGLDisplay dpy, EGLSurface surface, const EGLint *attrib_list);
-        pfnLockSurfaceKHR fLockSurfaceKHR;
-        typedef EGLBoolean (GLAPIENTRY * pfnUnlockSurfaceKHR)(EGLDisplay dpy, EGLSurface surface);
-        pfnUnlockSurfaceKHR fUnlockSurfaceKHR;
+        typedef EGLBoolean (GLAPIENTRY * pfnLockSurface)(EGLDisplay dpy, EGLSurface surface, const EGLint *attrib_list);
+        pfnLockSurface fLockSurface;
+        typedef EGLBoolean (GLAPIENTRY * pfnUnlockSurface)(EGLDisplay dpy, EGLSurface surface);
+        pfnUnlockSurface fUnlockSurface;
         typedef EGLBoolean (GLAPIENTRY * pfnQuerySurface)(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
         pfnQuerySurface fQuerySurface;
 
         typedef EGLBoolean (GLAPIENTRY * pfnQuerySurfacePointerANGLE)(EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value);
         pfnQuerySurfacePointerANGLE fQuerySurfacePointerANGLE;
-
-        // This is EGL specific GL ext symbol "glEGLImageTargetTexture2DOES"
-        // Lets keep it here for now.
-        typedef void (GLAPIENTRY * pfnImageTargetTexture2DOES)(GLenum target, GLeglImageOES image);
-        pfnImageTargetTexture2DOES fImageTargetTexture2DOES;
     } mSymbols;
 
 private:
     bool mInitialized;
     PRLibrary* mEGLLibrary;
     EGLDisplay mEGLDisplay;
 
     bool mIsANGLE;