tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

libEGL_autogen.cpp (30542B)


      1 // GENERATED FILE - DO NOT EDIT.
      2 // Generated by generate_entry_points.py using data from egl.xml and egl_angle_ext.xml.
      3 //
      4 // Copyright 2020 The ANGLE Project Authors. All rights reserved.
      5 // Use of this source code is governed by a BSD-style license that can be
      6 // found in the LICENSE file.
      7 //
      8 // libEGL_autogen.cpp: Implements the exported EGL functions.
      9 
     10 #include "anglebase/no_destructor.h"
     11 #include "common/system_utils.h"
     12 
     13 #include <memory>
     14 
     15 #if defined(ANGLE_USE_EGL_LOADER)
     16 #    include "libEGL/egl_loader_autogen.h"
     17 #else
     18 #    include "libGLESv2/entry_points_egl_autogen.h"
     19 #    include "libGLESv2/entry_points_egl_ext_autogen.h"
     20 #endif  // defined(ANGLE_USE_EGL_LOADER)
     21 
     22 namespace
     23 {
     24 #if defined(ANGLE_USE_EGL_LOADER)
     25 bool gLoaded          = false;
     26 void *gEntryPointsLib = nullptr;
     27 
     28 GenericProc KHRONOS_APIENTRY GlobalLoad(const char *symbol)
     29 {
     30    return reinterpret_cast<GenericProc>(angle::GetLibrarySymbol(gEntryPointsLib, symbol));
     31 }
     32 
     33 void EnsureEGLLoaded()
     34 {
     35    if (gLoaded)
     36    {
     37        return;
     38    }
     39 
     40    std::string errorOut;
     41    gEntryPointsLib = OpenSystemLibraryAndGetError(ANGLE_GLESV2_LIBRARY_NAME,
     42                                                   angle::SearchType::ModuleDir, &errorOut);
     43    if (gEntryPointsLib)
     44    {
     45        LoadLibEGL_EGL(GlobalLoad);
     46        gLoaded = true;
     47    }
     48    else
     49    {
     50        fprintf(stderr, "Error loading EGL entry points: %s\n", errorOut.c_str());
     51    }
     52 }
     53 #else
     54 void EnsureEGLLoaded() {}
     55 #endif  // defined(ANGLE_USE_EGL_LOADER)
     56 }  // anonymous namespace
     57 
     58 extern "C" {
     59 
     60 // EGL 1.0
     61 EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy,
     62                                       const EGLint *attrib_list,
     63                                       EGLConfig *configs,
     64                                       EGLint config_size,
     65                                       EGLint *num_config)
     66 {
     67    EnsureEGLLoaded();
     68    return EGL_ChooseConfig(dpy, attrib_list, configs, config_size, num_config);
     69 }
     70 
     71 EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy,
     72                                      EGLSurface surface,
     73                                      EGLNativePixmapType target)
     74 {
     75    EnsureEGLLoaded();
     76    return EGL_CopyBuffers(dpy, surface, target);
     77 }
     78 
     79 EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy,
     80                                        EGLConfig config,
     81                                        EGLContext share_context,
     82                                        const EGLint *attrib_list)
     83 {
     84    EnsureEGLLoaded();
     85    return EGL_CreateContext(dpy, config, share_context, attrib_list);
     86 }
     87 
     88 EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy,
     89                                               EGLConfig config,
     90                                               const EGLint *attrib_list)
     91 {
     92    EnsureEGLLoaded();
     93    return EGL_CreatePbufferSurface(dpy, config, attrib_list);
     94 }
     95 
     96 EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy,
     97                                              EGLConfig config,
     98                                              EGLNativePixmapType pixmap,
     99                                              const EGLint *attrib_list)
    100 {
    101    EnsureEGLLoaded();
    102    return EGL_CreatePixmapSurface(dpy, config, pixmap, attrib_list);
    103 }
    104 
    105 EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy,
    106                                              EGLConfig config,
    107                                              EGLNativeWindowType win,
    108                                              const EGLint *attrib_list)
    109 {
    110    EnsureEGLLoaded();
    111    return EGL_CreateWindowSurface(dpy, config, win, attrib_list);
    112 }
    113 
    114 EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx)
    115 {
    116    EnsureEGLLoaded();
    117    return EGL_DestroyContext(dpy, ctx);
    118 }
    119 
    120 EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface)
    121 {
    122    EnsureEGLLoaded();
    123    return EGL_DestroySurface(dpy, surface);
    124 }
    125 
    126 EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy,
    127                                          EGLConfig config,
    128                                          EGLint attribute,
    129                                          EGLint *value)
    130 {
    131    EnsureEGLLoaded();
    132    return EGL_GetConfigAttrib(dpy, config, attribute, value);
    133 }
    134 
    135 EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy,
    136                                     EGLConfig *configs,
    137                                     EGLint config_size,
    138                                     EGLint *num_config)
    139 {
    140    EnsureEGLLoaded();
    141    return EGL_GetConfigs(dpy, configs, config_size, num_config);
    142 }
    143 
    144 EGLDisplay EGLAPIENTRY eglGetCurrentDisplay()
    145 {
    146    EnsureEGLLoaded();
    147    return EGL_GetCurrentDisplay();
    148 }
    149 
    150 EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw)
    151 {
    152    EnsureEGLLoaded();
    153    return EGL_GetCurrentSurface(readdraw);
    154 }
    155 
    156 EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id)
    157 {
    158    EnsureEGLLoaded();
    159    return EGL_GetDisplay(display_id);
    160 }
    161 
    162 EGLint EGLAPIENTRY eglGetError()
    163 {
    164    EnsureEGLLoaded();
    165    return EGL_GetError();
    166 }
    167 
    168 __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress(const char *procname)
    169 {
    170    EnsureEGLLoaded();
    171    return EGL_GetProcAddress(procname);
    172 }
    173 
    174 EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
    175 {
    176    EnsureEGLLoaded();
    177    return EGL_Initialize(dpy, major, minor);
    178 }
    179 
    180 EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy,
    181                                      EGLSurface draw,
    182                                      EGLSurface read,
    183                                      EGLContext ctx)
    184 {
    185    EnsureEGLLoaded();
    186    return EGL_MakeCurrent(dpy, draw, read, ctx);
    187 }
    188 
    189 EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy,
    190                                       EGLContext ctx,
    191                                       EGLint attribute,
    192                                       EGLint *value)
    193 {
    194    EnsureEGLLoaded();
    195    return EGL_QueryContext(dpy, ctx, attribute, value);
    196 }
    197 
    198 const char *EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name)
    199 {
    200    EnsureEGLLoaded();
    201    return EGL_QueryString(dpy, name);
    202 }
    203 
    204 EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy,
    205                                       EGLSurface surface,
    206                                       EGLint attribute,
    207                                       EGLint *value)
    208 {
    209    EnsureEGLLoaded();
    210    return EGL_QuerySurface(dpy, surface, attribute, value);
    211 }
    212 
    213 EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface)
    214 {
    215    EnsureEGLLoaded();
    216    return EGL_SwapBuffers(dpy, surface);
    217 }
    218 
    219 EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy)
    220 {
    221    EnsureEGLLoaded();
    222    return EGL_Terminate(dpy);
    223 }
    224 
    225 EGLBoolean EGLAPIENTRY eglWaitGL()
    226 {
    227    EnsureEGLLoaded();
    228    return EGL_WaitGL();
    229 }
    230 
    231 EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine)
    232 {
    233    EnsureEGLLoaded();
    234    return EGL_WaitNative(engine);
    235 }
    236 
    237 // EGL 1.1
    238 EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer)
    239 {
    240    EnsureEGLLoaded();
    241    return EGL_BindTexImage(dpy, surface, buffer);
    242 }
    243 
    244 EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer)
    245 {
    246    EnsureEGLLoaded();
    247    return EGL_ReleaseTexImage(dpy, surface, buffer);
    248 }
    249 
    250 EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy,
    251                                        EGLSurface surface,
    252                                        EGLint attribute,
    253                                        EGLint value)
    254 {
    255    EnsureEGLLoaded();
    256    return EGL_SurfaceAttrib(dpy, surface, attribute, value);
    257 }
    258 
    259 EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval)
    260 {
    261    EnsureEGLLoaded();
    262    return EGL_SwapInterval(dpy, interval);
    263 }
    264 
    265 // EGL 1.2
    266 EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api)
    267 {
    268    EnsureEGLLoaded();
    269    return EGL_BindAPI(api);
    270 }
    271 
    272 EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer(EGLDisplay dpy,
    273                                                        EGLenum buftype,
    274                                                        EGLClientBuffer buffer,
    275                                                        EGLConfig config,
    276                                                        const EGLint *attrib_list)
    277 {
    278    EnsureEGLLoaded();
    279    return EGL_CreatePbufferFromClientBuffer(dpy, buftype, buffer, config, attrib_list);
    280 }
    281 
    282 EGLenum EGLAPIENTRY eglQueryAPI()
    283 {
    284    EnsureEGLLoaded();
    285    return EGL_QueryAPI();
    286 }
    287 
    288 EGLBoolean EGLAPIENTRY eglReleaseThread()
    289 {
    290    EnsureEGLLoaded();
    291    return EGL_ReleaseThread();
    292 }
    293 
    294 EGLBoolean EGLAPIENTRY eglWaitClient()
    295 {
    296    EnsureEGLLoaded();
    297    return EGL_WaitClient();
    298 }
    299 
    300 // EGL 1.4
    301 EGLContext EGLAPIENTRY eglGetCurrentContext()
    302 {
    303    EnsureEGLLoaded();
    304    return EGL_GetCurrentContext();
    305 }
    306 
    307 // EGL 1.5
    308 EGLint EGLAPIENTRY eglClientWaitSync(EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout)
    309 {
    310    EnsureEGLLoaded();
    311    return EGL_ClientWaitSync(dpy, sync, flags, timeout);
    312 }
    313 
    314 EGLImage EGLAPIENTRY eglCreateImage(EGLDisplay dpy,
    315                                    EGLContext ctx,
    316                                    EGLenum target,
    317                                    EGLClientBuffer buffer,
    318                                    const EGLAttrib *attrib_list)
    319 {
    320    EnsureEGLLoaded();
    321    return EGL_CreateImage(dpy, ctx, target, buffer, attrib_list);
    322 }
    323 
    324 EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurface(EGLDisplay dpy,
    325                                                      EGLConfig config,
    326                                                      void *native_pixmap,
    327                                                      const EGLAttrib *attrib_list)
    328 {
    329    EnsureEGLLoaded();
    330    return EGL_CreatePlatformPixmapSurface(dpy, config, native_pixmap, attrib_list);
    331 }
    332 
    333 EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface(EGLDisplay dpy,
    334                                                      EGLConfig config,
    335                                                      void *native_window,
    336                                                      const EGLAttrib *attrib_list)
    337 {
    338    EnsureEGLLoaded();
    339    return EGL_CreatePlatformWindowSurface(dpy, config, native_window, attrib_list);
    340 }
    341 
    342 EGLSync EGLAPIENTRY eglCreateSync(EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list)
    343 {
    344    EnsureEGLLoaded();
    345    return EGL_CreateSync(dpy, type, attrib_list);
    346 }
    347 
    348 EGLBoolean EGLAPIENTRY eglDestroyImage(EGLDisplay dpy, EGLImage image)
    349 {
    350    EnsureEGLLoaded();
    351    return EGL_DestroyImage(dpy, image);
    352 }
    353 
    354 EGLBoolean EGLAPIENTRY eglDestroySync(EGLDisplay dpy, EGLSync sync)
    355 {
    356    EnsureEGLLoaded();
    357    return EGL_DestroySync(dpy, sync);
    358 }
    359 
    360 EGLDisplay EGLAPIENTRY eglGetPlatformDisplay(EGLenum platform,
    361                                             void *native_display,
    362                                             const EGLAttrib *attrib_list)
    363 {
    364    EnsureEGLLoaded();
    365    return EGL_GetPlatformDisplay(platform, native_display, attrib_list);
    366 }
    367 
    368 EGLBoolean EGLAPIENTRY eglGetSyncAttrib(EGLDisplay dpy,
    369                                        EGLSync sync,
    370                                        EGLint attribute,
    371                                        EGLAttrib *value)
    372 {
    373    EnsureEGLLoaded();
    374    return EGL_GetSyncAttrib(dpy, sync, attribute, value);
    375 }
    376 
    377 EGLBoolean EGLAPIENTRY eglWaitSync(EGLDisplay dpy, EGLSync sync, EGLint flags)
    378 {
    379    EnsureEGLLoaded();
    380    return EGL_WaitSync(dpy, sync, flags);
    381 }
    382 
    383 // EGL_ANDROID_blob_cache
    384 void EGLAPIENTRY eglSetBlobCacheFuncsANDROID(EGLDisplay dpy,
    385                                             EGLSetBlobFuncANDROID set,
    386                                             EGLGetBlobFuncANDROID get)
    387 {
    388    EnsureEGLLoaded();
    389    return EGL_SetBlobCacheFuncsANDROID(dpy, set, get);
    390 }
    391 
    392 // EGL_ANDROID_create_native_client_buffer
    393 EGLClientBuffer EGLAPIENTRY eglCreateNativeClientBufferANDROID(const EGLint *attrib_list)
    394 {
    395    EnsureEGLLoaded();
    396    return EGL_CreateNativeClientBufferANDROID(attrib_list);
    397 }
    398 
    399 // EGL_ANDROID_get_frame_timestamps
    400 EGLBoolean EGLAPIENTRY eglGetCompositorTimingSupportedANDROID(EGLDisplay dpy,
    401                                                              EGLSurface surface,
    402                                                              EGLint name)
    403 {
    404    EnsureEGLLoaded();
    405    return EGL_GetCompositorTimingSupportedANDROID(dpy, surface, name);
    406 }
    407 
    408 EGLBoolean EGLAPIENTRY eglGetCompositorTimingANDROID(EGLDisplay dpy,
    409                                                     EGLSurface surface,
    410                                                     EGLint numTimestamps,
    411                                                     const EGLint *names,
    412                                                     EGLnsecsANDROID *values)
    413 {
    414    EnsureEGLLoaded();
    415    return EGL_GetCompositorTimingANDROID(dpy, surface, numTimestamps, names, values);
    416 }
    417 
    418 EGLBoolean EGLAPIENTRY eglGetNextFrameIdANDROID(EGLDisplay dpy,
    419                                                EGLSurface surface,
    420                                                EGLuint64KHR *frameId)
    421 {
    422    EnsureEGLLoaded();
    423    return EGL_GetNextFrameIdANDROID(dpy, surface, frameId);
    424 }
    425 
    426 EGLBoolean EGLAPIENTRY eglGetFrameTimestampSupportedANDROID(EGLDisplay dpy,
    427                                                            EGLSurface surface,
    428                                                            EGLint timestamp)
    429 {
    430    EnsureEGLLoaded();
    431    return EGL_GetFrameTimestampSupportedANDROID(dpy, surface, timestamp);
    432 }
    433 
    434 EGLBoolean EGLAPIENTRY eglGetFrameTimestampsANDROID(EGLDisplay dpy,
    435                                                    EGLSurface surface,
    436                                                    EGLuint64KHR frameId,
    437                                                    EGLint numTimestamps,
    438                                                    const EGLint *timestamps,
    439                                                    EGLnsecsANDROID *values)
    440 {
    441    EnsureEGLLoaded();
    442    return EGL_GetFrameTimestampsANDROID(dpy, surface, frameId, numTimestamps, timestamps, values);
    443 }
    444 
    445 // EGL_ANDROID_get_native_client_buffer
    446 EGLClientBuffer EGLAPIENTRY eglGetNativeClientBufferANDROID(const struct AHardwareBuffer *buffer)
    447 {
    448    EnsureEGLLoaded();
    449    return EGL_GetNativeClientBufferANDROID(buffer);
    450 }
    451 
    452 // EGL_ANDROID_native_fence_sync
    453 EGLint EGLAPIENTRY eglDupNativeFenceFDANDROID(EGLDisplay dpy, EGLSyncKHR sync)
    454 {
    455    EnsureEGLLoaded();
    456    return EGL_DupNativeFenceFDANDROID(dpy, sync);
    457 }
    458 
    459 // EGL_ANDROID_presentation_time
    460 EGLBoolean EGLAPIENTRY eglPresentationTimeANDROID(EGLDisplay dpy,
    461                                                  EGLSurface surface,
    462                                                  EGLnsecsANDROID time)
    463 {
    464    EnsureEGLLoaded();
    465    return EGL_PresentationTimeANDROID(dpy, surface, time);
    466 }
    467 
    468 // EGL_ANGLE_device_creation
    469 EGLDeviceEXT EGLAPIENTRY eglCreateDeviceANGLE(EGLint device_type,
    470                                              void *native_device,
    471                                              const EGLAttrib *attrib_list)
    472 {
    473    EnsureEGLLoaded();
    474    return EGL_CreateDeviceANGLE(device_type, native_device, attrib_list);
    475 }
    476 
    477 EGLBoolean EGLAPIENTRY eglReleaseDeviceANGLE(EGLDeviceEXT device)
    478 {
    479    EnsureEGLLoaded();
    480    return EGL_ReleaseDeviceANGLE(device);
    481 }
    482 
    483 // EGL_ANGLE_feature_control
    484 const char *EGLAPIENTRY eglQueryStringiANGLE(EGLDisplay dpy, EGLint name, EGLint index)
    485 {
    486    EnsureEGLLoaded();
    487    return EGL_QueryStringiANGLE(dpy, name, index);
    488 }
    489 
    490 EGLBoolean EGLAPIENTRY eglQueryDisplayAttribANGLE(EGLDisplay dpy,
    491                                                  EGLint attribute,
    492                                                  EGLAttrib *value)
    493 {
    494    EnsureEGLLoaded();
    495    return EGL_QueryDisplayAttribANGLE(dpy, attribute, value);
    496 }
    497 
    498 // EGL_ANGLE_metal_shared_event_sync
    499 void *EGLAPIENTRY eglCopyMetalSharedEventANGLE(EGLDisplay dpy, EGLSyncKHR sync)
    500 {
    501    EnsureEGLLoaded();
    502    return EGL_CopyMetalSharedEventANGLE(dpy, sync);
    503 }
    504 
    505 // EGL_ANGLE_power_preference
    506 void EGLAPIENTRY eglReleaseHighPowerGPUANGLE(EGLDisplay dpy, EGLContext ctx)
    507 {
    508    EnsureEGLLoaded();
    509    return EGL_ReleaseHighPowerGPUANGLE(dpy, ctx);
    510 }
    511 
    512 void EGLAPIENTRY eglReacquireHighPowerGPUANGLE(EGLDisplay dpy, EGLContext ctx)
    513 {
    514    EnsureEGLLoaded();
    515    return EGL_ReacquireHighPowerGPUANGLE(dpy, ctx);
    516 }
    517 
    518 void EGLAPIENTRY eglHandleGPUSwitchANGLE(EGLDisplay dpy)
    519 {
    520    EnsureEGLLoaded();
    521    return EGL_HandleGPUSwitchANGLE(dpy);
    522 }
    523 
    524 void EGLAPIENTRY eglForceGPUSwitchANGLE(EGLDisplay dpy, EGLint gpuIDHigh, EGLint gpuIDLow)
    525 {
    526    EnsureEGLLoaded();
    527    return EGL_ForceGPUSwitchANGLE(dpy, gpuIDHigh, gpuIDLow);
    528 }
    529 
    530 // EGL_ANGLE_prepare_swap_buffers
    531 EGLBoolean EGLAPIENTRY eglPrepareSwapBuffersANGLE(EGLDisplay dpy, EGLSurface surface)
    532 {
    533    EnsureEGLLoaded();
    534    return EGL_PrepareSwapBuffersANGLE(dpy, surface);
    535 }
    536 
    537 // EGL_ANGLE_program_cache_control
    538 EGLint EGLAPIENTRY eglProgramCacheGetAttribANGLE(EGLDisplay dpy, EGLenum attrib)
    539 {
    540    EnsureEGLLoaded();
    541    return EGL_ProgramCacheGetAttribANGLE(dpy, attrib);
    542 }
    543 
    544 void EGLAPIENTRY eglProgramCacheQueryANGLE(EGLDisplay dpy,
    545                                           EGLint index,
    546                                           void *key,
    547                                           EGLint *keysize,
    548                                           void *binary,
    549                                           EGLint *binarysize)
    550 {
    551    EnsureEGLLoaded();
    552    return EGL_ProgramCacheQueryANGLE(dpy, index, key, keysize, binary, binarysize);
    553 }
    554 
    555 void EGLAPIENTRY eglProgramCachePopulateANGLE(EGLDisplay dpy,
    556                                              const void *key,
    557                                              EGLint keysize,
    558                                              const void *binary,
    559                                              EGLint binarysize)
    560 {
    561    EnsureEGLLoaded();
    562    return EGL_ProgramCachePopulateANGLE(dpy, key, keysize, binary, binarysize);
    563 }
    564 
    565 EGLint EGLAPIENTRY eglProgramCacheResizeANGLE(EGLDisplay dpy, EGLint limit, EGLint mode)
    566 {
    567    EnsureEGLLoaded();
    568    return EGL_ProgramCacheResizeANGLE(dpy, limit, mode);
    569 }
    570 
    571 // EGL_ANGLE_query_surface_pointer
    572 EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE(EGLDisplay dpy,
    573                                                   EGLSurface surface,
    574                                                   EGLint attribute,
    575                                                   void **value)
    576 {
    577    EnsureEGLLoaded();
    578    return EGL_QuerySurfacePointerANGLE(dpy, surface, attribute, value);
    579 }
    580 
    581 // EGL_ANGLE_stream_producer_d3d_texture
    582 EGLBoolean EGLAPIENTRY eglCreateStreamProducerD3DTextureANGLE(EGLDisplay dpy,
    583                                                              EGLStreamKHR stream,
    584                                                              const EGLAttrib *attrib_list)
    585 {
    586    EnsureEGLLoaded();
    587    return EGL_CreateStreamProducerD3DTextureANGLE(dpy, stream, attrib_list);
    588 }
    589 
    590 EGLBoolean EGLAPIENTRY eglStreamPostD3DTextureANGLE(EGLDisplay dpy,
    591                                                    EGLStreamKHR stream,
    592                                                    void *texture,
    593                                                    const EGLAttrib *attrib_list)
    594 {
    595    EnsureEGLLoaded();
    596    return EGL_StreamPostD3DTextureANGLE(dpy, stream, texture, attrib_list);
    597 }
    598 
    599 // EGL_ANGLE_swap_with_frame_token
    600 EGLBoolean EGLAPIENTRY eglSwapBuffersWithFrameTokenANGLE(EGLDisplay dpy,
    601                                                         EGLSurface surface,
    602                                                         EGLFrameTokenANGLE frametoken)
    603 {
    604    EnsureEGLLoaded();
    605    return EGL_SwapBuffersWithFrameTokenANGLE(dpy, surface, frametoken);
    606 }
    607 
    608 // EGL_ANGLE_sync_control_rate
    609 EGLBoolean EGLAPIENTRY eglGetMscRateANGLE(EGLDisplay dpy,
    610                                          EGLSurface surface,
    611                                          EGLint *numerator,
    612                                          EGLint *denominator)
    613 {
    614    EnsureEGLLoaded();
    615    return EGL_GetMscRateANGLE(dpy, surface, numerator, denominator);
    616 }
    617 
    618 // EGL_ANGLE_vulkan_image
    619 EGLBoolean EGLAPIENTRY eglExportVkImageANGLE(EGLDisplay dpy,
    620                                             EGLImage image,
    621                                             void *vk_image,
    622                                             void *vk_image_create_info)
    623 {
    624    EnsureEGLLoaded();
    625    return EGL_ExportVkImageANGLE(dpy, image, vk_image, vk_image_create_info);
    626 }
    627 
    628 // EGL_CHROMIUM_sync_control
    629 EGLBoolean EGLAPIENTRY eglGetSyncValuesCHROMIUM(EGLDisplay dpy,
    630                                                EGLSurface surface,
    631                                                EGLuint64KHR *ust,
    632                                                EGLuint64KHR *msc,
    633                                                EGLuint64KHR *sbc)
    634 {
    635    EnsureEGLLoaded();
    636    return EGL_GetSyncValuesCHROMIUM(dpy, surface, ust, msc, sbc);
    637 }
    638 
    639 // EGL_EXT_device_query
    640 EGLBoolean EGLAPIENTRY eglQueryDeviceAttribEXT(EGLDeviceEXT device,
    641                                               EGLint attribute,
    642                                               EGLAttrib *value)
    643 {
    644    EnsureEGLLoaded();
    645    return EGL_QueryDeviceAttribEXT(device, attribute, value);
    646 }
    647 
    648 const char *EGLAPIENTRY eglQueryDeviceStringEXT(EGLDeviceEXT device, EGLint name)
    649 {
    650    EnsureEGLLoaded();
    651    return EGL_QueryDeviceStringEXT(device, name);
    652 }
    653 
    654 EGLBoolean EGLAPIENTRY eglQueryDisplayAttribEXT(EGLDisplay dpy, EGLint attribute, EGLAttrib *value)
    655 {
    656    EnsureEGLLoaded();
    657    return EGL_QueryDisplayAttribEXT(dpy, attribute, value);
    658 }
    659 
    660 // EGL_EXT_image_dma_buf_import_modifiers
    661 EGLBoolean EGLAPIENTRY eglQueryDmaBufFormatsEXT(EGLDisplay dpy,
    662                                                EGLint max_formats,
    663                                                EGLint *formats,
    664                                                EGLint *num_formats)
    665 {
    666    EnsureEGLLoaded();
    667    return EGL_QueryDmaBufFormatsEXT(dpy, max_formats, formats, num_formats);
    668 }
    669 
    670 EGLBoolean EGLAPIENTRY eglQueryDmaBufModifiersEXT(EGLDisplay dpy,
    671                                                  EGLint format,
    672                                                  EGLint max_modifiers,
    673                                                  EGLuint64KHR *modifiers,
    674                                                  EGLBoolean *external_only,
    675                                                  EGLint *num_modifiers)
    676 {
    677    EnsureEGLLoaded();
    678    return EGL_QueryDmaBufModifiersEXT(dpy, format, max_modifiers, modifiers, external_only,
    679                                       num_modifiers);
    680 }
    681 
    682 // EGL_EXT_platform_base
    683 EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurfaceEXT(EGLDisplay dpy,
    684                                                         EGLConfig config,
    685                                                         void *native_pixmap,
    686                                                         const EGLint *attrib_list)
    687 {
    688    EnsureEGLLoaded();
    689    return EGL_CreatePlatformPixmapSurfaceEXT(dpy, config, native_pixmap, attrib_list);
    690 }
    691 
    692 EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurfaceEXT(EGLDisplay dpy,
    693                                                         EGLConfig config,
    694                                                         void *native_window,
    695                                                         const EGLint *attrib_list)
    696 {
    697    EnsureEGLLoaded();
    698    return EGL_CreatePlatformWindowSurfaceEXT(dpy, config, native_window, attrib_list);
    699 }
    700 
    701 EGLDisplay EGLAPIENTRY eglGetPlatformDisplayEXT(EGLenum platform,
    702                                                void *native_display,
    703                                                const EGLint *attrib_list)
    704 {
    705    EnsureEGLLoaded();
    706    return EGL_GetPlatformDisplayEXT(platform, native_display, attrib_list);
    707 }
    708 
    709 // EGL_KHR_debug
    710 EGLint EGLAPIENTRY eglDebugMessageControlKHR(EGLDEBUGPROCKHR callback, const EGLAttrib *attrib_list)
    711 {
    712    EnsureEGLLoaded();
    713    return EGL_DebugMessageControlKHR(callback, attrib_list);
    714 }
    715 
    716 EGLint EGLAPIENTRY eglLabelObjectKHR(EGLDisplay display,
    717                                     EGLenum objectType,
    718                                     EGLObjectKHR object,
    719                                     EGLLabelKHR label)
    720 {
    721    EnsureEGLLoaded();
    722    return EGL_LabelObjectKHR(display, objectType, object, label);
    723 }
    724 
    725 EGLBoolean EGLAPIENTRY eglQueryDebugKHR(EGLint attribute, EGLAttrib *value)
    726 {
    727    EnsureEGLLoaded();
    728    return EGL_QueryDebugKHR(attribute, value);
    729 }
    730 
    731 // EGL_KHR_fence_sync
    732 EGLint EGLAPIENTRY eglClientWaitSyncKHR(EGLDisplay dpy,
    733                                        EGLSyncKHR sync,
    734                                        EGLint flags,
    735                                        EGLTimeKHR timeout)
    736 {
    737    EnsureEGLLoaded();
    738    return EGL_ClientWaitSyncKHR(dpy, sync, flags, timeout);
    739 }
    740 
    741 EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list)
    742 {
    743    EnsureEGLLoaded();
    744    return EGL_CreateSyncKHR(dpy, type, attrib_list);
    745 }
    746 
    747 EGLBoolean EGLAPIENTRY eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync)
    748 {
    749    EnsureEGLLoaded();
    750    return EGL_DestroySyncKHR(dpy, sync);
    751 }
    752 
    753 EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR(EGLDisplay dpy,
    754                                           EGLSyncKHR sync,
    755                                           EGLint attribute,
    756                                           EGLint *value)
    757 {
    758    EnsureEGLLoaded();
    759    return EGL_GetSyncAttribKHR(dpy, sync, attribute, value);
    760 }
    761 
    762 // EGL_KHR_image
    763 EGLImageKHR EGLAPIENTRY eglCreateImageKHR(EGLDisplay dpy,
    764                                          EGLContext ctx,
    765                                          EGLenum target,
    766                                          EGLClientBuffer buffer,
    767                                          const EGLint *attrib_list)
    768 {
    769    EnsureEGLLoaded();
    770    return EGL_CreateImageKHR(dpy, ctx, target, buffer, attrib_list);
    771 }
    772 
    773 EGLBoolean EGLAPIENTRY eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR image)
    774 {
    775    EnsureEGLLoaded();
    776    return EGL_DestroyImageKHR(dpy, image);
    777 }
    778 
    779 // EGL_KHR_lock_surface3
    780 EGLBoolean EGLAPIENTRY eglLockSurfaceKHR(EGLDisplay dpy,
    781                                         EGLSurface surface,
    782                                         const EGLint *attrib_list)
    783 {
    784    EnsureEGLLoaded();
    785    return EGL_LockSurfaceKHR(dpy, surface, attrib_list);
    786 }
    787 
    788 EGLBoolean EGLAPIENTRY eglQuerySurface64KHR(EGLDisplay dpy,
    789                                            EGLSurface surface,
    790                                            EGLint attribute,
    791                                            EGLAttribKHR *value)
    792 {
    793    EnsureEGLLoaded();
    794    return EGL_QuerySurface64KHR(dpy, surface, attribute, value);
    795 }
    796 
    797 EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR(EGLDisplay dpy, EGLSurface surface)
    798 {
    799    EnsureEGLLoaded();
    800    return EGL_UnlockSurfaceKHR(dpy, surface);
    801 }
    802 
    803 // EGL_KHR_partial_update
    804 EGLBoolean EGLAPIENTRY eglSetDamageRegionKHR(EGLDisplay dpy,
    805                                             EGLSurface surface,
    806                                             EGLint *rects,
    807                                             EGLint n_rects)
    808 {
    809    EnsureEGLLoaded();
    810    return EGL_SetDamageRegionKHR(dpy, surface, rects, n_rects);
    811 }
    812 
    813 // EGL_KHR_reusable_sync
    814 EGLBoolean EGLAPIENTRY eglSignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode)
    815 {
    816    EnsureEGLLoaded();
    817    return EGL_SignalSyncKHR(dpy, sync, mode);
    818 }
    819 
    820 // EGL_KHR_stream
    821 EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR(EGLDisplay dpy, const EGLint *attrib_list)
    822 {
    823    EnsureEGLLoaded();
    824    return EGL_CreateStreamKHR(dpy, attrib_list);
    825 }
    826 
    827 EGLBoolean EGLAPIENTRY eglDestroyStreamKHR(EGLDisplay dpy, EGLStreamKHR stream)
    828 {
    829    EnsureEGLLoaded();
    830    return EGL_DestroyStreamKHR(dpy, stream);
    831 }
    832 
    833 EGLBoolean EGLAPIENTRY eglQueryStreamKHR(EGLDisplay dpy,
    834                                         EGLStreamKHR stream,
    835                                         EGLenum attribute,
    836                                         EGLint *value)
    837 {
    838    EnsureEGLLoaded();
    839    return EGL_QueryStreamKHR(dpy, stream, attribute, value);
    840 }
    841 
    842 EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR(EGLDisplay dpy,
    843                                            EGLStreamKHR stream,
    844                                            EGLenum attribute,
    845                                            EGLuint64KHR *value)
    846 {
    847    EnsureEGLLoaded();
    848    return EGL_QueryStreamu64KHR(dpy, stream, attribute, value);
    849 }
    850 
    851 EGLBoolean EGLAPIENTRY eglStreamAttribKHR(EGLDisplay dpy,
    852                                          EGLStreamKHR stream,
    853                                          EGLenum attribute,
    854                                          EGLint value)
    855 {
    856    EnsureEGLLoaded();
    857    return EGL_StreamAttribKHR(dpy, stream, attribute, value);
    858 }
    859 
    860 // EGL_KHR_stream_consumer_gltexture
    861 EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireKHR(EGLDisplay dpy, EGLStreamKHR stream)
    862 {
    863    EnsureEGLLoaded();
    864    return EGL_StreamConsumerAcquireKHR(dpy, stream);
    865 }
    866 
    867 EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalKHR(EGLDisplay dpy, EGLStreamKHR stream)
    868 {
    869    EnsureEGLLoaded();
    870    return EGL_StreamConsumerGLTextureExternalKHR(dpy, stream);
    871 }
    872 
    873 EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseKHR(EGLDisplay dpy, EGLStreamKHR stream)
    874 {
    875    EnsureEGLLoaded();
    876    return EGL_StreamConsumerReleaseKHR(dpy, stream);
    877 }
    878 
    879 // EGL_KHR_swap_buffers_with_damage
    880 EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageKHR(EGLDisplay dpy,
    881                                                   EGLSurface surface,
    882                                                   const EGLint *rects,
    883                                                   EGLint n_rects)
    884 {
    885    EnsureEGLLoaded();
    886    return EGL_SwapBuffersWithDamageKHR(dpy, surface, rects, n_rects);
    887 }
    888 
    889 // EGL_KHR_wait_sync
    890 EGLint EGLAPIENTRY eglWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags)
    891 {
    892    EnsureEGLLoaded();
    893    return EGL_WaitSyncKHR(dpy, sync, flags);
    894 }
    895 
    896 // EGL_NV_post_sub_buffer
    897 EGLBoolean EGLAPIENTRY eglPostSubBufferNV(EGLDisplay dpy,
    898                                          EGLSurface surface,
    899                                          EGLint x,
    900                                          EGLint y,
    901                                          EGLint width,
    902                                          EGLint height)
    903 {
    904    EnsureEGLLoaded();
    905    return EGL_PostSubBufferNV(dpy, surface, x, y, width, height);
    906 }
    907 
    908 // EGL_NV_stream_consumer_gltexture_yuv
    909 EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalAttribsNV(EGLDisplay dpy,
    910                                                                   EGLStreamKHR stream,
    911                                                                   const EGLAttrib *attrib_list)
    912 {
    913    EnsureEGLLoaded();
    914    return EGL_StreamConsumerGLTextureExternalAttribsNV(dpy, stream, attrib_list);
    915 }
    916 
    917 }  // extern "C"