Bug 1328493 - Expose CreatePBufferFromClientBuffer and EGL_ANGLE_d3d_share_handle_client_buffer. r=jrmuizel
authorMorris Tseng <mtseng@mozilla.com>
Mon, 20 Feb 2017 09:44:50 +0800
changeset 372849 b0cbe51520865de381809966b309ecefeba78f22
parent 372848 356449a93a4c2f3262b982d3fd621d880c919ac9
child 372850 03531a4a9327fe350cc4a27c0c7799c106b8bfcc
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1328493
milestone54.0a1
Bug 1328493 - Expose CreatePBufferFromClientBuffer and EGL_ANGLE_d3d_share_handle_client_buffer. r=jrmuizel MozReview-Commit-ID: JhFdwkCvIsO
gfx/gl/GLLibraryEGL.cpp
gfx/gl/GLLibraryEGL.h
--- a/gfx/gl/GLLibraryEGL.cpp
+++ b/gfx/gl/GLLibraryEGL.cpp
@@ -46,17 +46,18 @@ static const char* sEGLExtensionNames[] 
     "EGL_KHR_lock_surface",
     "EGL_ANGLE_surface_d3d_texture_2d_share_handle",
     "EGL_EXT_create_context_robustness",
     "EGL_KHR_image",
     "EGL_KHR_fence_sync",
     "EGL_ANDROID_native_fence_sync",
     "EGL_ANDROID_image_crop",
     "EGL_ANGLE_platform_angle",
-    "EGL_ANGLE_platform_angle_d3d"
+    "EGL_ANGLE_platform_angle_d3d",
+    "EGL_ANGLE_d3d_share_handle_client_buffer"
 };
 
 #if defined(ANDROID)
 
 static PRLibrary* LoadApitraceLibrary()
 {
     // Initialization of gfx prefs here is only needed during the unit tests...
     gfxPrefs::GetSingleton();
@@ -409,16 +410,17 @@ GLLibraryEGL::EnsureInitialized(bool for
         SYMBOL(GetProcAddress),
         SYMBOL(SwapBuffers),
         SYMBOL(CopyBuffers),
         SYMBOL(QueryString),
         SYMBOL(QueryContext),
         SYMBOL(BindTexImage),
         SYMBOL(ReleaseTexImage),
         SYMBOL(QuerySurface),
+        SYMBOL(CreatePbufferFromClientBuffer),
         { nullptr, { nullptr } }
     };
 
     if (!GLLibraryLoader::LoadSymbols(mEGLLibrary, &earlySymbols[0])) {
         NS_WARNING("Couldn't find required entry points in EGL library (early init)");
         *out_failureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_EGL_SYM");
         return false;
     }
--- a/gfx/gl/GLLibraryEGL.h
+++ b/gfx/gl/GLLibraryEGL.h
@@ -128,16 +128,17 @@ public:
         mSymbols.fGetCurrentSurface = nullptr;
         mSymbols.fGetCurrentContext = nullptr;
         mSymbols.fMakeCurrent = nullptr;
         mSymbols.fDestroyContext = nullptr;
         mSymbols.fCreateContext = nullptr;
         mSymbols.fDestroySurface = nullptr;
         mSymbols.fCreateWindowSurface = nullptr;
         mSymbols.fCreatePbufferSurface = nullptr;
+        mSymbols.fCreatePbufferFromClientBuffer = nullptr;
         mSymbols.fCreatePixmapSurface = nullptr;
         mSymbols.fBindAPI = nullptr;
         mSymbols.fInitialize = nullptr;
         mSymbols.fChooseConfig = nullptr;
         mSymbols.fGetError = nullptr;
         mSymbols.fGetConfigAttrib = nullptr;
         mSymbols.fGetConfigs = nullptr;
         mSymbols.fWaitNative = nullptr;
@@ -180,16 +181,17 @@ public:
         ANGLE_surface_d3d_texture_2d_share_handle,
         EXT_create_context_robustness,
         KHR_image,
         KHR_fence_sync,
         ANDROID_native_fence_sync,
         EGL_ANDROID_image_crop,
         ANGLE_platform_angle,
         ANGLE_platform_angle_d3d,
+        ANGLE_d3d_share_handle_client_buffer,
         Extensions_Max
     };
 
     bool IsExtensionSupported(EGLExtensions aKnownExtension) const {
         return mAvailableExtensions[aKnownExtension];
     }
 
     void MarkExtensionUnsupported(EGLExtensions aKnownExtension) {
@@ -284,16 +286,24 @@ public:
     EGLSurface fCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint* attrib_list)
     {
         BEFORE_GL_CALL;
         EGLSurface surf = mSymbols.fCreatePbufferSurface(dpy, config, attrib_list);
         AFTER_GL_CALL;
         return surf;
     }
 
+    EGLSurface fCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list)
+    {
+        BEFORE_GL_CALL;
+        EGLSurface ret = mSymbols.fCreatePbufferFromClientBuffer(dpy, buftype, buffer, config, attrib_list);
+        AFTER_GL_CALL;
+        return ret;
+    }
+
     EGLSurface fCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint* attrib_list)
     {
         BEFORE_GL_CALL;
         EGLSurface surf = mSymbols.fCreatePixmapSurface(dpy, config, pixmap, attrib_list);
         AFTER_GL_CALL;
         return surf;
     }
 
@@ -580,16 +590,18 @@ public:
         typedef EGLContext (GLAPIENTRY * pfnCreateContext)(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint* attrib_list);
         pfnCreateContext fCreateContext;
         typedef EGLBoolean (GLAPIENTRY * pfnDestroySurface)(EGLDisplay dpy, EGLSurface surface);
         pfnDestroySurface fDestroySurface;
         typedef EGLSurface (GLAPIENTRY * pfnCreateWindowSurface)(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint* attrib_list);
         pfnCreateWindowSurface fCreateWindowSurface;
         typedef EGLSurface (GLAPIENTRY * pfnCreatePbufferSurface)(EGLDisplay dpy, EGLConfig config, const EGLint* attrib_list);
         pfnCreatePbufferSurface fCreatePbufferSurface;
+        typedef EGLSurface (GLAPIENTRY * pfnCreatePbufferFromClientBuffer)(EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
+        pfnCreatePbufferFromClientBuffer fCreatePbufferFromClientBuffer;
         typedef EGLSurface (GLAPIENTRY * pfnCreatePixmapSurface)(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint* attrib_list);
         pfnCreatePixmapSurface fCreatePixmapSurface;
         typedef EGLBoolean (GLAPIENTRY * pfnBindAPI)(EGLenum api);
         pfnBindAPI fBindAPI;
         typedef EGLBoolean (GLAPIENTRY * pfnInitialize)(EGLDisplay dpy, EGLint* major, EGLint* minor);
         pfnInitialize fInitialize;
         typedef EGLBoolean (GLAPIENTRY * pfnChooseConfig)(EGLDisplay dpy, const EGLint* attrib_list, EGLConfig* configs, EGLint config_size, EGLint* num_config);
         pfnChooseConfig fChooseConfig;