Commit b2afc665 authored by sotaro's avatar sotaro
Browse files

Bug 1395417 - Expose eglCreateDeviceANGLE and eglReleaseDeviceANGLE r=jgilbert

parent 6e615beb
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -57,6 +57,8 @@ static const char* sEGLExtensionNames[] = {
    "EGL_EXT_device_query",
    "EGL_NV_stream_consumer_gltexture_yuv",
    "EGL_ANGLE_stream_producer_d3d_texture_nv12",
    "EGL_ANGLE_device_creation",
    "EGL_ANGLE_device_creation_d3d11",
};

#if defined(ANDROID)
@@ -653,6 +655,18 @@ GLLibraryEGL::EnsureInitialized(bool forceAccel, nsACString* const out_failureId
        }
    }

    if (IsExtensionSupported(ANGLE_device_creation)) {
        const GLLibraryLoader::SymLoadStruct createDeviceSymbols[] = {
            SYMBOL(CreateDeviceANGLE),
            SYMBOL(ReleaseDeviceANGLE),
            END_OF_SYMBOLS
        };
        if (!fnLoadSymbols(createDeviceSymbols)) {
            NS_ERROR("EGL supports ANGLE_device_creation without exposing its functions!");
            MarkExtensionUnsupported(ANGLE_device_creation);
        }
    }

    mInitialized = true;
    reporter.SetSuccessful();
    return true;
+15 −0
Original line number Diff line number Diff line
@@ -111,6 +111,8 @@ public:
        EXT_device_query,
        NV_stream_consumer_gltexture_yuv,
        ANGLE_stream_producer_d3d_texture_nv12,
        ANGLE_device_creation,
        ANGLE_device_creation_d3d11,
        Extensions_Max
    };

@@ -322,6 +324,13 @@ public:
    EGLBoolean  fStreamPostD3DTextureNV12ANGLE(EGLDisplay dpy, EGLStreamKHR stream, void* texture, const EGLAttrib* attrib_list) const
        WRAP(   fStreamPostD3DTextureNV12ANGLE(dpy, stream, texture, attrib_list) )

    // ANGLE_device_creation
    EGLDeviceEXT fCreateDeviceANGLE(EGLint device_type, void *native_device, const EGLAttrib *attrib_list) const
        WRAP(   fCreateDeviceANGLE(device_type, native_device, attrib_list) )

    EGLBoolean fReleaseDeviceANGLE(EGLDeviceEXT device)
        WRAP(   fReleaseDeviceANGLE(device) )

    void           fANGLEPlatformInitialize(angle::Platform* platform) const
        VOID_WRAP( fANGLEPlatformInitialize(platform) )

@@ -481,6 +490,12 @@ private:
                                                                 EGLStreamKHR stream,
                                                                 void* texture,
                                                                 const EGLAttrib* attrib_list);
        // ANGLE_device_creation
        EGLDeviceEXT (GLAPIENTRY * fCreateDeviceANGLE) (EGLint device_type,
                                                        void* native_device,
                                                        const EGLAttrib* attrib_list);
        EGLBoolean (GLAPIENTRY * fReleaseDeviceANGLE) (EGLDeviceEXT device);

        void       (GLAPIENTRY * fANGLEPlatformInitialize)(angle::Platform* platform);
        void       (GLAPIENTRY * fANGLEPlatformShutdown)();
    } mSymbols;