tor-browser

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

entry_points_egl_ext_autogen.cpp (56176B)


      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 // entry_points_egl_ext_autogen.cpp:
      9 //   Defines the EGL Extension entry points.
     10 
     11 #include "libGLESv2/entry_points_egl_ext_autogen.h"
     12 
     13 #include "libANGLE/entry_points_utils.h"
     14 #include "libANGLE/validationEGL_autogen.h"
     15 #include "libGLESv2/egl_ext_stubs_autogen.h"
     16 #include "libGLESv2/global_state.h"
     17 
     18 using namespace egl;
     19 
     20 extern "C" {
     21 
     22 // EGL_ANDROID_blob_cache
     23 void EGLAPIENTRY EGL_SetBlobCacheFuncsANDROID(EGLDisplay dpy,
     24                                              EGLSetBlobFuncANDROID set,
     25                                              EGLGetBlobFuncANDROID get)
     26 {
     27 
     28    ANGLE_SCOPED_GLOBAL_LOCK();
     29    EGL_EVENT(SetBlobCacheFuncsANDROID,
     30              "dpy = 0x%016" PRIxPTR ", set = 0x%016" PRIxPTR ", get = 0x%016" PRIxPTR "",
     31              (uintptr_t)dpy, (uintptr_t)set, (uintptr_t)get);
     32 
     33    Thread *thread = egl::GetCurrentThread();
     34 
     35    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
     36 
     37    ANGLE_EGL_VALIDATE_VOID(thread, SetBlobCacheFuncsANDROID, GetDisplayIfValid(dpyPacked),
     38                            dpyPacked, set, get);
     39 
     40    SetBlobCacheFuncsANDROID(thread, dpyPacked, set, get);
     41 }
     42 
     43 // EGL_ANDROID_create_native_client_buffer
     44 EGLClientBuffer EGLAPIENTRY EGL_CreateNativeClientBufferANDROID(const EGLint *attrib_list)
     45 {
     46 
     47    ANGLE_SCOPED_GLOBAL_LOCK();
     48    EGL_EVENT(CreateNativeClientBufferANDROID, "attrib_list = 0x%016" PRIxPTR "",
     49              (uintptr_t)attrib_list);
     50 
     51    Thread *thread = egl::GetCurrentThread();
     52 
     53    const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
     54 
     55    ANGLE_EGL_VALIDATE(thread, CreateNativeClientBufferANDROID, nullptr, EGLClientBuffer,
     56                       attrib_listPacked);
     57 
     58    return CreateNativeClientBufferANDROID(thread, attrib_listPacked);
     59 }
     60 
     61 // EGL_ANDROID_get_frame_timestamps
     62 EGLBoolean EGLAPIENTRY EGL_GetCompositorTimingSupportedANDROID(EGLDisplay dpy,
     63                                                               EGLSurface surface,
     64                                                               EGLint name)
     65 {
     66 
     67    ANGLE_SCOPED_GLOBAL_SURFACE_LOCK();
     68    ANGLE_SCOPED_GLOBAL_LOCK();
     69    EGL_EVENT(GetCompositorTimingSupportedANDROID,
     70              "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR ", name = %d", (uintptr_t)dpy,
     71              (uintptr_t)surface, name);
     72 
     73    Thread *thread = egl::GetCurrentThread();
     74 
     75    egl::Display *dpyPacked     = PackParam<egl::Display *>(dpy);
     76    Surface *surfacePacked      = PackParam<Surface *>(surface);
     77    CompositorTiming namePacked = PackParam<CompositorTiming>(name);
     78 
     79    ANGLE_EGL_VALIDATE(thread, GetCompositorTimingSupportedANDROID, GetDisplayIfValid(dpyPacked),
     80                       EGLBoolean, dpyPacked, surfacePacked, namePacked);
     81 
     82    return GetCompositorTimingSupportedANDROID(thread, dpyPacked, surfacePacked, namePacked);
     83 }
     84 
     85 EGLBoolean EGLAPIENTRY EGL_GetCompositorTimingANDROID(EGLDisplay dpy,
     86                                                      EGLSurface surface,
     87                                                      EGLint numTimestamps,
     88                                                      const EGLint *names,
     89                                                      EGLnsecsANDROID *values)
     90 {
     91 
     92    ANGLE_SCOPED_GLOBAL_SURFACE_LOCK();
     93    ANGLE_SCOPED_GLOBAL_LOCK();
     94    EGL_EVENT(GetCompositorTimingANDROID,
     95              "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR
     96              ", numTimestamps = %d, names = 0x%016" PRIxPTR ", values = 0x%016" PRIxPTR "",
     97              (uintptr_t)dpy, (uintptr_t)surface, numTimestamps, (uintptr_t)names,
     98              (uintptr_t)values);
     99 
    100    Thread *thread = egl::GetCurrentThread();
    101 
    102    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    103    Surface *surfacePacked  = PackParam<Surface *>(surface);
    104 
    105    ANGLE_EGL_VALIDATE(thread, GetCompositorTimingANDROID, GetDisplayIfValid(dpyPacked), EGLBoolean,
    106                       dpyPacked, surfacePacked, numTimestamps, names, values);
    107 
    108    return GetCompositorTimingANDROID(thread, dpyPacked, surfacePacked, numTimestamps, names,
    109                                      values);
    110 }
    111 
    112 EGLBoolean EGLAPIENTRY EGL_GetNextFrameIdANDROID(EGLDisplay dpy,
    113                                                 EGLSurface surface,
    114                                                 EGLuint64KHR *frameId)
    115 {
    116 
    117    ANGLE_SCOPED_GLOBAL_SURFACE_LOCK();
    118    ANGLE_SCOPED_GLOBAL_LOCK();
    119    EGL_EVENT(GetNextFrameIdANDROID,
    120              "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR ", frameId = 0x%016" PRIxPTR "",
    121              (uintptr_t)dpy, (uintptr_t)surface, (uintptr_t)frameId);
    122 
    123    Thread *thread = egl::GetCurrentThread();
    124 
    125    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    126    Surface *surfacePacked  = PackParam<Surface *>(surface);
    127 
    128    ANGLE_EGL_VALIDATE(thread, GetNextFrameIdANDROID, GetDisplayIfValid(dpyPacked), EGLBoolean,
    129                       dpyPacked, surfacePacked, frameId);
    130 
    131    return GetNextFrameIdANDROID(thread, dpyPacked, surfacePacked, frameId);
    132 }
    133 
    134 EGLBoolean EGLAPIENTRY EGL_GetFrameTimestampSupportedANDROID(EGLDisplay dpy,
    135                                                             EGLSurface surface,
    136                                                             EGLint timestamp)
    137 {
    138 
    139    ANGLE_SCOPED_GLOBAL_SURFACE_LOCK();
    140    ANGLE_SCOPED_GLOBAL_LOCK();
    141    EGL_EVENT(GetFrameTimestampSupportedANDROID,
    142              "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR ", timestamp = %d",
    143              (uintptr_t)dpy, (uintptr_t)surface, timestamp);
    144 
    145    Thread *thread = egl::GetCurrentThread();
    146 
    147    egl::Display *dpyPacked   = PackParam<egl::Display *>(dpy);
    148    Surface *surfacePacked    = PackParam<Surface *>(surface);
    149    Timestamp timestampPacked = PackParam<Timestamp>(timestamp);
    150 
    151    ANGLE_EGL_VALIDATE(thread, GetFrameTimestampSupportedANDROID, GetDisplayIfValid(dpyPacked),
    152                       EGLBoolean, dpyPacked, surfacePacked, timestampPacked);
    153 
    154    return GetFrameTimestampSupportedANDROID(thread, dpyPacked, surfacePacked, timestampPacked);
    155 }
    156 
    157 EGLBoolean EGLAPIENTRY EGL_GetFrameTimestampsANDROID(EGLDisplay dpy,
    158                                                     EGLSurface surface,
    159                                                     EGLuint64KHR frameId,
    160                                                     EGLint numTimestamps,
    161                                                     const EGLint *timestamps,
    162                                                     EGLnsecsANDROID *values)
    163 {
    164 
    165    ANGLE_SCOPED_GLOBAL_SURFACE_LOCK();
    166    ANGLE_SCOPED_GLOBAL_LOCK();
    167    EGL_EVENT(GetFrameTimestampsANDROID,
    168              "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR
    169              ", frameId = %llu, numTimestamps = %d, timestamps = 0x%016" PRIxPTR
    170              ", values = 0x%016" PRIxPTR "",
    171              (uintptr_t)dpy, (uintptr_t)surface, static_cast<unsigned long long>(frameId),
    172              numTimestamps, (uintptr_t)timestamps, (uintptr_t)values);
    173 
    174    Thread *thread = egl::GetCurrentThread();
    175 
    176    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    177    Surface *surfacePacked  = PackParam<Surface *>(surface);
    178 
    179    ANGLE_EGL_VALIDATE(thread, GetFrameTimestampsANDROID, GetDisplayIfValid(dpyPacked), EGLBoolean,
    180                       dpyPacked, surfacePacked, frameId, numTimestamps, timestamps, values);
    181 
    182    return GetFrameTimestampsANDROID(thread, dpyPacked, surfacePacked, frameId, numTimestamps,
    183                                     timestamps, values);
    184 }
    185 
    186 // EGL_ANDROID_get_native_client_buffer
    187 EGLClientBuffer EGLAPIENTRY EGL_GetNativeClientBufferANDROID(const struct AHardwareBuffer *buffer)
    188 {
    189 
    190    ANGLE_SCOPED_GLOBAL_LOCK();
    191    EGL_EVENT(GetNativeClientBufferANDROID, "buffer = 0x%016" PRIxPTR "", (uintptr_t)buffer);
    192 
    193    Thread *thread = egl::GetCurrentThread();
    194 
    195    ANGLE_EGL_VALIDATE(thread, GetNativeClientBufferANDROID, nullptr, EGLClientBuffer, buffer);
    196 
    197    return GetNativeClientBufferANDROID(thread, buffer);
    198 }
    199 
    200 // EGL_ANDROID_native_fence_sync
    201 EGLint EGLAPIENTRY EGL_DupNativeFenceFDANDROID(EGLDisplay dpy, EGLSyncKHR sync)
    202 {
    203 
    204    ANGLE_SCOPED_GLOBAL_LOCK();
    205    EGL_EVENT(DupNativeFenceFDANDROID, "dpy = 0x%016" PRIxPTR ", sync = 0x%016" PRIxPTR "",
    206              (uintptr_t)dpy, (uintptr_t)sync);
    207 
    208    Thread *thread = egl::GetCurrentThread();
    209 
    210    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    211    Sync *syncPacked        = PackParam<Sync *>(sync);
    212 
    213    ANGLE_EGL_VALIDATE(thread, DupNativeFenceFDANDROID, GetDisplayIfValid(dpyPacked), EGLint,
    214                       dpyPacked, syncPacked);
    215 
    216    return DupNativeFenceFDANDROID(thread, dpyPacked, syncPacked);
    217 }
    218 
    219 // EGL_ANDROID_presentation_time
    220 EGLBoolean EGLAPIENTRY EGL_PresentationTimeANDROID(EGLDisplay dpy,
    221                                                   EGLSurface surface,
    222                                                   EGLnsecsANDROID time)
    223 {
    224 
    225    ANGLE_SCOPED_GLOBAL_SURFACE_LOCK();
    226    ANGLE_SCOPED_GLOBAL_LOCK();
    227    EGL_EVENT(PresentationTimeANDROID,
    228              "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR ", time = %llu", (uintptr_t)dpy,
    229              (uintptr_t)surface, static_cast<unsigned long long>(time));
    230 
    231    Thread *thread = egl::GetCurrentThread();
    232 
    233    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    234    Surface *surfacePacked  = PackParam<Surface *>(surface);
    235 
    236    ANGLE_EGL_VALIDATE(thread, PresentationTimeANDROID, GetDisplayIfValid(dpyPacked), EGLBoolean,
    237                       dpyPacked, surfacePacked, time);
    238 
    239    return PresentationTimeANDROID(thread, dpyPacked, surfacePacked, time);
    240 }
    241 
    242 // EGL_ANGLE_device_creation
    243 EGLDeviceEXT EGLAPIENTRY EGL_CreateDeviceANGLE(EGLint device_type,
    244                                               void *native_device,
    245                                               const EGLAttrib *attrib_list)
    246 {
    247 
    248    ANGLE_SCOPED_GLOBAL_LOCK();
    249    EGL_EVENT(CreateDeviceANGLE,
    250              "device_type = %d, native_device = 0x%016" PRIxPTR ", attrib_list = 0x%016" PRIxPTR
    251              "",
    252              device_type, (uintptr_t)native_device, (uintptr_t)attrib_list);
    253 
    254    Thread *thread = egl::GetCurrentThread();
    255 
    256    ANGLE_EGL_VALIDATE(thread, CreateDeviceANGLE, nullptr, EGLDeviceEXT, device_type, native_device,
    257                       attrib_list);
    258 
    259    return CreateDeviceANGLE(thread, device_type, native_device, attrib_list);
    260 }
    261 
    262 EGLBoolean EGLAPIENTRY EGL_ReleaseDeviceANGLE(EGLDeviceEXT device)
    263 {
    264 
    265    ANGLE_SCOPED_GLOBAL_LOCK();
    266    EGL_EVENT(ReleaseDeviceANGLE, "device = 0x%016" PRIxPTR "", (uintptr_t)device);
    267 
    268    Thread *thread = egl::GetCurrentThread();
    269 
    270    Device *devicePacked = PackParam<Device *>(device);
    271 
    272    ANGLE_EGL_VALIDATE(thread, ReleaseDeviceANGLE, nullptr, EGLBoolean, devicePacked);
    273 
    274    return ReleaseDeviceANGLE(thread, devicePacked);
    275 }
    276 
    277 // EGL_ANGLE_feature_control
    278 const char *EGLAPIENTRY EGL_QueryStringiANGLE(EGLDisplay dpy, EGLint name, EGLint index)
    279 {
    280 
    281    ANGLE_SCOPED_GLOBAL_LOCK();
    282    EGL_EVENT(QueryStringiANGLE, "dpy = 0x%016" PRIxPTR ", name = %d, index = %d", (uintptr_t)dpy,
    283              name, index);
    284 
    285    Thread *thread = egl::GetCurrentThread();
    286 
    287    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    288 
    289    ANGLE_EGL_VALIDATE(thread, QueryStringiANGLE, GetDisplayIfValid(dpyPacked), const char *,
    290                       dpyPacked, name, index);
    291 
    292    return QueryStringiANGLE(thread, dpyPacked, name, index);
    293 }
    294 
    295 EGLBoolean EGLAPIENTRY EGL_QueryDisplayAttribANGLE(EGLDisplay dpy,
    296                                                   EGLint attribute,
    297                                                   EGLAttrib *value)
    298 {
    299 
    300    ANGLE_SCOPED_GLOBAL_LOCK();
    301    EGL_EVENT(QueryDisplayAttribANGLE,
    302              "dpy = 0x%016" PRIxPTR ", attribute = %d, value = 0x%016" PRIxPTR "", (uintptr_t)dpy,
    303              attribute, (uintptr_t)value);
    304 
    305    Thread *thread = egl::GetCurrentThread();
    306 
    307    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    308 
    309    ANGLE_EGL_VALIDATE(thread, QueryDisplayAttribANGLE, GetDisplayIfValid(dpyPacked), EGLBoolean,
    310                       dpyPacked, attribute, value);
    311 
    312    return QueryDisplayAttribANGLE(thread, dpyPacked, attribute, value);
    313 }
    314 
    315 // EGL_ANGLE_metal_shared_event_sync
    316 void *EGLAPIENTRY EGL_CopyMetalSharedEventANGLE(EGLDisplay dpy, EGLSyncKHR sync)
    317 {
    318 
    319    ANGLE_SCOPED_GLOBAL_LOCK();
    320    EGL_EVENT(CopyMetalSharedEventANGLE, "dpy = 0x%016" PRIxPTR ", sync = 0x%016" PRIxPTR "",
    321              (uintptr_t)dpy, (uintptr_t)sync);
    322 
    323    Thread *thread = egl::GetCurrentThread();
    324 
    325    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    326    Sync *syncPacked        = PackParam<Sync *>(sync);
    327 
    328    ANGLE_EGL_VALIDATE(thread, CopyMetalSharedEventANGLE, GetDisplayIfValid(dpyPacked), void *,
    329                       dpyPacked, syncPacked);
    330 
    331    return CopyMetalSharedEventANGLE(thread, dpyPacked, syncPacked);
    332 }
    333 
    334 // EGL_ANGLE_power_preference
    335 void EGLAPIENTRY EGL_ReleaseHighPowerGPUANGLE(EGLDisplay dpy, EGLContext ctx)
    336 {
    337 
    338    ANGLE_SCOPED_GLOBAL_LOCK();
    339    EGL_EVENT(ReleaseHighPowerGPUANGLE, "dpy = 0x%016" PRIxPTR ", ctx = 0x%016" PRIxPTR "",
    340              (uintptr_t)dpy, (uintptr_t)ctx);
    341 
    342    Thread *thread = egl::GetCurrentThread();
    343 
    344    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    345    gl::Context *ctxPacked  = PackParam<gl::Context *>(ctx);
    346 
    347    ANGLE_EGL_VALIDATE_VOID(thread, ReleaseHighPowerGPUANGLE, GetDisplayIfValid(dpyPacked),
    348                            dpyPacked, ctxPacked);
    349 
    350    ReleaseHighPowerGPUANGLE(thread, dpyPacked, ctxPacked);
    351 }
    352 
    353 void EGLAPIENTRY EGL_ReacquireHighPowerGPUANGLE(EGLDisplay dpy, EGLContext ctx)
    354 {
    355 
    356    ANGLE_SCOPED_GLOBAL_LOCK();
    357    EGL_EVENT(ReacquireHighPowerGPUANGLE, "dpy = 0x%016" PRIxPTR ", ctx = 0x%016" PRIxPTR "",
    358              (uintptr_t)dpy, (uintptr_t)ctx);
    359 
    360    Thread *thread = egl::GetCurrentThread();
    361 
    362    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    363    gl::Context *ctxPacked  = PackParam<gl::Context *>(ctx);
    364 
    365    ANGLE_EGL_VALIDATE_VOID(thread, ReacquireHighPowerGPUANGLE, GetDisplayIfValid(dpyPacked),
    366                            dpyPacked, ctxPacked);
    367 
    368    ReacquireHighPowerGPUANGLE(thread, dpyPacked, ctxPacked);
    369 }
    370 
    371 void EGLAPIENTRY EGL_HandleGPUSwitchANGLE(EGLDisplay dpy)
    372 {
    373 
    374    ANGLE_SCOPED_GLOBAL_LOCK();
    375    EGL_EVENT(HandleGPUSwitchANGLE, "dpy = 0x%016" PRIxPTR "", (uintptr_t)dpy);
    376 
    377    Thread *thread = egl::GetCurrentThread();
    378 
    379    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    380 
    381    ANGLE_EGL_VALIDATE_VOID(thread, HandleGPUSwitchANGLE, GetDisplayIfValid(dpyPacked), dpyPacked);
    382 
    383    HandleGPUSwitchANGLE(thread, dpyPacked);
    384 }
    385 
    386 void EGLAPIENTRY EGL_ForceGPUSwitchANGLE(EGLDisplay dpy, EGLint gpuIDHigh, EGLint gpuIDLow)
    387 {
    388 
    389    ANGLE_SCOPED_GLOBAL_LOCK();
    390    EGL_EVENT(ForceGPUSwitchANGLE, "dpy = 0x%016" PRIxPTR ", gpuIDHigh = %d, gpuIDLow = %d",
    391              (uintptr_t)dpy, gpuIDHigh, gpuIDLow);
    392 
    393    Thread *thread = egl::GetCurrentThread();
    394 
    395    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    396 
    397    ANGLE_EGL_VALIDATE_VOID(thread, ForceGPUSwitchANGLE, GetDisplayIfValid(dpyPacked), dpyPacked,
    398                            gpuIDHigh, gpuIDLow);
    399 
    400    ForceGPUSwitchANGLE(thread, dpyPacked, gpuIDHigh, gpuIDLow);
    401 }
    402 
    403 // EGL_ANGLE_prepare_swap_buffers
    404 EGLBoolean EGLAPIENTRY EGL_PrepareSwapBuffersANGLE(EGLDisplay dpy, EGLSurface surface)
    405 {
    406    return PrepareSwapBuffersANGLE(dpy, surface);
    407 }
    408 
    409 // EGL_ANGLE_program_cache_control
    410 EGLint EGLAPIENTRY EGL_ProgramCacheGetAttribANGLE(EGLDisplay dpy, EGLenum attrib)
    411 {
    412 
    413    ANGLE_SCOPED_GLOBAL_LOCK();
    414    EGL_EVENT(ProgramCacheGetAttribANGLE, "dpy = 0x%016" PRIxPTR ", attrib = 0x%X", (uintptr_t)dpy,
    415              attrib);
    416 
    417    Thread *thread = egl::GetCurrentThread();
    418 
    419    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    420 
    421    ANGLE_EGL_VALIDATE(thread, ProgramCacheGetAttribANGLE, GetDisplayIfValid(dpyPacked), EGLint,
    422                       dpyPacked, attrib);
    423 
    424    return ProgramCacheGetAttribANGLE(thread, dpyPacked, attrib);
    425 }
    426 
    427 void EGLAPIENTRY EGL_ProgramCacheQueryANGLE(EGLDisplay dpy,
    428                                            EGLint index,
    429                                            void *key,
    430                                            EGLint *keysize,
    431                                            void *binary,
    432                                            EGLint *binarysize)
    433 {
    434 
    435    ANGLE_SCOPED_GLOBAL_LOCK();
    436    EGL_EVENT(ProgramCacheQueryANGLE,
    437              "dpy = 0x%016" PRIxPTR ", index = %d, key = 0x%016" PRIxPTR
    438              ", keysize = 0x%016" PRIxPTR ", binary = 0x%016" PRIxPTR
    439              ", binarysize = 0x%016" PRIxPTR "",
    440              (uintptr_t)dpy, index, (uintptr_t)key, (uintptr_t)keysize, (uintptr_t)binary,
    441              (uintptr_t)binarysize);
    442 
    443    Thread *thread = egl::GetCurrentThread();
    444 
    445    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    446 
    447    ANGLE_EGL_VALIDATE_VOID(thread, ProgramCacheQueryANGLE, GetDisplayIfValid(dpyPacked), dpyPacked,
    448                            index, key, keysize, binary, binarysize);
    449 
    450    ProgramCacheQueryANGLE(thread, dpyPacked, index, key, keysize, binary, binarysize);
    451 }
    452 
    453 void EGLAPIENTRY EGL_ProgramCachePopulateANGLE(EGLDisplay dpy,
    454                                               const void *key,
    455                                               EGLint keysize,
    456                                               const void *binary,
    457                                               EGLint binarysize)
    458 {
    459 
    460    ANGLE_SCOPED_GLOBAL_LOCK();
    461    EGL_EVENT(ProgramCachePopulateANGLE,
    462              "dpy = 0x%016" PRIxPTR ", key = 0x%016" PRIxPTR
    463              ", keysize = %d, binary = 0x%016" PRIxPTR ", binarysize = %d",
    464              (uintptr_t)dpy, (uintptr_t)key, keysize, (uintptr_t)binary, binarysize);
    465 
    466    Thread *thread = egl::GetCurrentThread();
    467 
    468    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    469 
    470    ANGLE_EGL_VALIDATE_VOID(thread, ProgramCachePopulateANGLE, GetDisplayIfValid(dpyPacked),
    471                            dpyPacked, key, keysize, binary, binarysize);
    472 
    473    ProgramCachePopulateANGLE(thread, dpyPacked, key, keysize, binary, binarysize);
    474 }
    475 
    476 EGLint EGLAPIENTRY EGL_ProgramCacheResizeANGLE(EGLDisplay dpy, EGLint limit, EGLint mode)
    477 {
    478 
    479    ANGLE_SCOPED_GLOBAL_LOCK();
    480    EGL_EVENT(ProgramCacheResizeANGLE, "dpy = 0x%016" PRIxPTR ", limit = %d, mode = %d",
    481              (uintptr_t)dpy, limit, mode);
    482 
    483    Thread *thread = egl::GetCurrentThread();
    484 
    485    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    486 
    487    ANGLE_EGL_VALIDATE(thread, ProgramCacheResizeANGLE, GetDisplayIfValid(dpyPacked), EGLint,
    488                       dpyPacked, limit, mode);
    489 
    490    return ProgramCacheResizeANGLE(thread, dpyPacked, limit, mode);
    491 }
    492 
    493 // EGL_ANGLE_query_surface_pointer
    494 EGLBoolean EGLAPIENTRY EGL_QuerySurfacePointerANGLE(EGLDisplay dpy,
    495                                                    EGLSurface surface,
    496                                                    EGLint attribute,
    497                                                    void **value)
    498 {
    499 
    500    ANGLE_SCOPED_GLOBAL_SURFACE_LOCK();
    501    ANGLE_SCOPED_GLOBAL_LOCK();
    502    EGL_EVENT(QuerySurfacePointerANGLE,
    503              "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR
    504              ", attribute = %d, value = 0x%016" PRIxPTR "",
    505              (uintptr_t)dpy, (uintptr_t)surface, attribute, (uintptr_t)value);
    506 
    507    Thread *thread = egl::GetCurrentThread();
    508 
    509    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    510    Surface *surfacePacked  = PackParam<Surface *>(surface);
    511 
    512    ANGLE_EGL_VALIDATE(thread, QuerySurfacePointerANGLE, GetDisplayIfValid(dpyPacked), EGLBoolean,
    513                       dpyPacked, surfacePacked, attribute, value);
    514 
    515    return QuerySurfacePointerANGLE(thread, dpyPacked, surfacePacked, attribute, value);
    516 }
    517 
    518 // EGL_ANGLE_stream_producer_d3d_texture
    519 EGLBoolean EGLAPIENTRY EGL_CreateStreamProducerD3DTextureANGLE(EGLDisplay dpy,
    520                                                               EGLStreamKHR stream,
    521                                                               const EGLAttrib *attrib_list)
    522 {
    523 
    524    ANGLE_SCOPED_GLOBAL_LOCK();
    525    EGL_EVENT(CreateStreamProducerD3DTextureANGLE,
    526              "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR ", attrib_list = 0x%016" PRIxPTR
    527              "",
    528              (uintptr_t)dpy, (uintptr_t)stream, (uintptr_t)attrib_list);
    529 
    530    Thread *thread = egl::GetCurrentThread();
    531 
    532    egl::Display *dpyPacked               = PackParam<egl::Display *>(dpy);
    533    Stream *streamPacked                  = PackParam<Stream *>(stream);
    534    const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
    535 
    536    ANGLE_EGL_VALIDATE(thread, CreateStreamProducerD3DTextureANGLE, GetDisplayIfValid(dpyPacked),
    537                       EGLBoolean, dpyPacked, streamPacked, attrib_listPacked);
    538 
    539    return CreateStreamProducerD3DTextureANGLE(thread, dpyPacked, streamPacked, attrib_listPacked);
    540 }
    541 
    542 EGLBoolean EGLAPIENTRY EGL_StreamPostD3DTextureANGLE(EGLDisplay dpy,
    543                                                     EGLStreamKHR stream,
    544                                                     void *texture,
    545                                                     const EGLAttrib *attrib_list)
    546 {
    547 
    548    ANGLE_SCOPED_GLOBAL_LOCK();
    549    EGL_EVENT(StreamPostD3DTextureANGLE,
    550              "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR ", texture = 0x%016" PRIxPTR
    551              ", attrib_list = 0x%016" PRIxPTR "",
    552              (uintptr_t)dpy, (uintptr_t)stream, (uintptr_t)texture, (uintptr_t)attrib_list);
    553 
    554    Thread *thread = egl::GetCurrentThread();
    555 
    556    egl::Display *dpyPacked               = PackParam<egl::Display *>(dpy);
    557    Stream *streamPacked                  = PackParam<Stream *>(stream);
    558    const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
    559 
    560    ANGLE_EGL_VALIDATE(thread, StreamPostD3DTextureANGLE, GetDisplayIfValid(dpyPacked), EGLBoolean,
    561                       dpyPacked, streamPacked, texture, attrib_listPacked);
    562 
    563    return StreamPostD3DTextureANGLE(thread, dpyPacked, streamPacked, texture, attrib_listPacked);
    564 }
    565 
    566 // EGL_ANGLE_swap_with_frame_token
    567 EGLBoolean EGLAPIENTRY EGL_SwapBuffersWithFrameTokenANGLE(EGLDisplay dpy,
    568                                                          EGLSurface surface,
    569                                                          EGLFrameTokenANGLE frametoken)
    570 {
    571    ANGLE_EGLBOOLEAN_TRY(PrepareSwapBuffersANGLE(dpy, surface));
    572    ANGLE_SCOPED_GLOBAL_SURFACE_LOCK();
    573    ANGLE_SCOPED_GLOBAL_LOCK();
    574    EGL_EVENT(SwapBuffersWithFrameTokenANGLE,
    575              "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR ", frametoken = 0x%llX",
    576              (uintptr_t)dpy, (uintptr_t)surface, static_cast<unsigned long long>(frametoken));
    577 
    578    Thread *thread = egl::GetCurrentThread();
    579 
    580    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    581    Surface *surfacePacked  = PackParam<Surface *>(surface);
    582 
    583    ANGLE_EGL_VALIDATE(thread, SwapBuffersWithFrameTokenANGLE, GetDisplayIfValid(dpyPacked),
    584                       EGLBoolean, dpyPacked, surfacePacked, frametoken);
    585 
    586    return SwapBuffersWithFrameTokenANGLE(thread, dpyPacked, surfacePacked, frametoken);
    587 }
    588 
    589 // EGL_ANGLE_sync_control_rate
    590 EGLBoolean EGLAPIENTRY EGL_GetMscRateANGLE(EGLDisplay dpy,
    591                                           EGLSurface surface,
    592                                           EGLint *numerator,
    593                                           EGLint *denominator)
    594 {
    595 
    596    ANGLE_SCOPED_GLOBAL_SURFACE_LOCK();
    597    ANGLE_SCOPED_GLOBAL_LOCK();
    598    EGL_EVENT(GetMscRateANGLE,
    599              "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR ", numerator = 0x%016" PRIxPTR
    600              ", denominator = 0x%016" PRIxPTR "",
    601              (uintptr_t)dpy, (uintptr_t)surface, (uintptr_t)numerator, (uintptr_t)denominator);
    602 
    603    Thread *thread = egl::GetCurrentThread();
    604 
    605    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    606    Surface *surfacePacked  = PackParam<Surface *>(surface);
    607 
    608    ANGLE_EGL_VALIDATE(thread, GetMscRateANGLE, GetDisplayIfValid(dpyPacked), EGLBoolean, dpyPacked,
    609                       surfacePacked, numerator, denominator);
    610 
    611    return GetMscRateANGLE(thread, dpyPacked, surfacePacked, numerator, denominator);
    612 }
    613 
    614 // EGL_ANGLE_vulkan_image
    615 EGLBoolean EGLAPIENTRY EGL_ExportVkImageANGLE(EGLDisplay dpy,
    616                                              EGLImage image,
    617                                              void *vk_image,
    618                                              void *vk_image_create_info)
    619 {
    620 
    621    ANGLE_SCOPED_GLOBAL_LOCK();
    622    EGL_EVENT(ExportVkImageANGLE,
    623              "dpy = 0x%016" PRIxPTR ", image = 0x%016" PRIxPTR ", vk_image = 0x%016" PRIxPTR
    624              ", vk_image_create_info = 0x%016" PRIxPTR "",
    625              (uintptr_t)dpy, (uintptr_t)image, (uintptr_t)vk_image,
    626              (uintptr_t)vk_image_create_info);
    627 
    628    Thread *thread = egl::GetCurrentThread();
    629 
    630    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    631    Image *imagePacked      = PackParam<Image *>(image);
    632 
    633    ANGLE_EGL_VALIDATE(thread, ExportVkImageANGLE, GetDisplayIfValid(dpyPacked), EGLBoolean,
    634                       dpyPacked, imagePacked, vk_image, vk_image_create_info);
    635 
    636    return ExportVkImageANGLE(thread, dpyPacked, imagePacked, vk_image, vk_image_create_info);
    637 }
    638 
    639 // EGL_CHROMIUM_sync_control
    640 EGLBoolean EGLAPIENTRY EGL_GetSyncValuesCHROMIUM(EGLDisplay dpy,
    641                                                 EGLSurface surface,
    642                                                 EGLuint64KHR *ust,
    643                                                 EGLuint64KHR *msc,
    644                                                 EGLuint64KHR *sbc)
    645 {
    646 
    647    ANGLE_SCOPED_GLOBAL_SURFACE_LOCK();
    648    ANGLE_SCOPED_GLOBAL_LOCK();
    649    EGL_EVENT(GetSyncValuesCHROMIUM,
    650              "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR ", ust = 0x%016" PRIxPTR
    651              ", msc = 0x%016" PRIxPTR ", sbc = 0x%016" PRIxPTR "",
    652              (uintptr_t)dpy, (uintptr_t)surface, (uintptr_t)ust, (uintptr_t)msc, (uintptr_t)sbc);
    653 
    654    Thread *thread = egl::GetCurrentThread();
    655 
    656    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    657    Surface *surfacePacked  = PackParam<Surface *>(surface);
    658 
    659    ANGLE_EGL_VALIDATE(thread, GetSyncValuesCHROMIUM, GetDisplayIfValid(dpyPacked), EGLBoolean,
    660                       dpyPacked, surfacePacked, ust, msc, sbc);
    661 
    662    return GetSyncValuesCHROMIUM(thread, dpyPacked, surfacePacked, ust, msc, sbc);
    663 }
    664 
    665 // EGL_EXT_device_query
    666 EGLBoolean EGLAPIENTRY EGL_QueryDeviceAttribEXT(EGLDeviceEXT device,
    667                                                EGLint attribute,
    668                                                EGLAttrib *value)
    669 {
    670 
    671    ANGLE_SCOPED_GLOBAL_LOCK();
    672    EGL_EVENT(QueryDeviceAttribEXT,
    673              "device = 0x%016" PRIxPTR ", attribute = %d, value = 0x%016" PRIxPTR "",
    674              (uintptr_t)device, attribute, (uintptr_t)value);
    675 
    676    Thread *thread = egl::GetCurrentThread();
    677 
    678    Device *devicePacked = PackParam<Device *>(device);
    679 
    680    ANGLE_EGL_VALIDATE(thread, QueryDeviceAttribEXT, nullptr, EGLBoolean, devicePacked, attribute,
    681                       value);
    682 
    683    return QueryDeviceAttribEXT(thread, devicePacked, attribute, value);
    684 }
    685 
    686 const char *EGLAPIENTRY EGL_QueryDeviceStringEXT(EGLDeviceEXT device, EGLint name)
    687 {
    688 
    689    ANGLE_SCOPED_GLOBAL_LOCK();
    690    EGL_EVENT(QueryDeviceStringEXT, "device = 0x%016" PRIxPTR ", name = %d", (uintptr_t)device,
    691              name);
    692 
    693    Thread *thread = egl::GetCurrentThread();
    694 
    695    Device *devicePacked = PackParam<Device *>(device);
    696 
    697    ANGLE_EGL_VALIDATE(thread, QueryDeviceStringEXT, nullptr, const char *, devicePacked, name);
    698 
    699    return QueryDeviceStringEXT(thread, devicePacked, name);
    700 }
    701 
    702 EGLBoolean EGLAPIENTRY EGL_QueryDisplayAttribEXT(EGLDisplay dpy, EGLint attribute, EGLAttrib *value)
    703 {
    704 
    705    ANGLE_SCOPED_GLOBAL_LOCK();
    706    EGL_EVENT(QueryDisplayAttribEXT,
    707              "dpy = 0x%016" PRIxPTR ", attribute = %d, value = 0x%016" PRIxPTR "", (uintptr_t)dpy,
    708              attribute, (uintptr_t)value);
    709 
    710    Thread *thread = egl::GetCurrentThread();
    711 
    712    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    713 
    714    ANGLE_EGL_VALIDATE(thread, QueryDisplayAttribEXT, GetDisplayIfValid(dpyPacked), EGLBoolean,
    715                       dpyPacked, attribute, value);
    716 
    717    return QueryDisplayAttribEXT(thread, dpyPacked, attribute, value);
    718 }
    719 
    720 // EGL_EXT_image_dma_buf_import_modifiers
    721 EGLBoolean EGLAPIENTRY EGL_QueryDmaBufFormatsEXT(EGLDisplay dpy,
    722                                                 EGLint max_formats,
    723                                                 EGLint *formats,
    724                                                 EGLint *num_formats)
    725 {
    726 
    727    ANGLE_SCOPED_GLOBAL_LOCK();
    728    EGL_EVENT(QueryDmaBufFormatsEXT,
    729              "dpy = 0x%016" PRIxPTR ", max_formats = %d, formats = 0x%016" PRIxPTR
    730              ", num_formats = 0x%016" PRIxPTR "",
    731              (uintptr_t)dpy, max_formats, (uintptr_t)formats, (uintptr_t)num_formats);
    732 
    733    Thread *thread = egl::GetCurrentThread();
    734 
    735    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    736 
    737    ANGLE_EGL_VALIDATE(thread, QueryDmaBufFormatsEXT, GetDisplayIfValid(dpyPacked), EGLBoolean,
    738                       dpyPacked, max_formats, formats, num_formats);
    739 
    740    return QueryDmaBufFormatsEXT(thread, dpyPacked, max_formats, formats, num_formats);
    741 }
    742 
    743 EGLBoolean EGLAPIENTRY EGL_QueryDmaBufModifiersEXT(EGLDisplay dpy,
    744                                                   EGLint format,
    745                                                   EGLint max_modifiers,
    746                                                   EGLuint64KHR *modifiers,
    747                                                   EGLBoolean *external_only,
    748                                                   EGLint *num_modifiers)
    749 {
    750 
    751    ANGLE_SCOPED_GLOBAL_LOCK();
    752    EGL_EVENT(QueryDmaBufModifiersEXT,
    753              "dpy = 0x%016" PRIxPTR ", format = %d, max_modifiers = %d, modifiers = 0x%016" PRIxPTR
    754              ", external_only = 0x%016" PRIxPTR ", num_modifiers = 0x%016" PRIxPTR "",
    755              (uintptr_t)dpy, format, max_modifiers, (uintptr_t)modifiers, (uintptr_t)external_only,
    756              (uintptr_t)num_modifiers);
    757 
    758    Thread *thread = egl::GetCurrentThread();
    759 
    760    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    761 
    762    ANGLE_EGL_VALIDATE(thread, QueryDmaBufModifiersEXT, GetDisplayIfValid(dpyPacked), EGLBoolean,
    763                       dpyPacked, format, max_modifiers, modifiers, external_only, num_modifiers);
    764 
    765    return QueryDmaBufModifiersEXT(thread, dpyPacked, format, max_modifiers, modifiers,
    766                                   external_only, num_modifiers);
    767 }
    768 
    769 // EGL_EXT_platform_base
    770 EGLSurface EGLAPIENTRY EGL_CreatePlatformPixmapSurfaceEXT(EGLDisplay dpy,
    771                                                          EGLConfig config,
    772                                                          void *native_pixmap,
    773                                                          const EGLint *attrib_list)
    774 {
    775 
    776    ANGLE_SCOPED_GLOBAL_LOCK();
    777    EGL_EVENT(CreatePlatformPixmapSurfaceEXT,
    778              "dpy = 0x%016" PRIxPTR ", config = 0x%016" PRIxPTR ", native_pixmap = 0x%016" PRIxPTR
    779              ", attrib_list = 0x%016" PRIxPTR "",
    780              (uintptr_t)dpy, (uintptr_t)config, (uintptr_t)native_pixmap, (uintptr_t)attrib_list);
    781 
    782    Thread *thread = egl::GetCurrentThread();
    783 
    784    egl::Display *dpyPacked               = PackParam<egl::Display *>(dpy);
    785    Config *configPacked                  = PackParam<Config *>(config);
    786    const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
    787 
    788    ANGLE_EGL_VALIDATE(thread, CreatePlatformPixmapSurfaceEXT, GetDisplayIfValid(dpyPacked),
    789                       EGLSurface, dpyPacked, configPacked, native_pixmap, attrib_listPacked);
    790 
    791    return CreatePlatformPixmapSurfaceEXT(thread, dpyPacked, configPacked, native_pixmap,
    792                                          attrib_listPacked);
    793 }
    794 
    795 EGLSurface EGLAPIENTRY EGL_CreatePlatformWindowSurfaceEXT(EGLDisplay dpy,
    796                                                          EGLConfig config,
    797                                                          void *native_window,
    798                                                          const EGLint *attrib_list)
    799 {
    800 
    801    ANGLE_SCOPED_GLOBAL_LOCK();
    802    EGL_EVENT(CreatePlatformWindowSurfaceEXT,
    803              "dpy = 0x%016" PRIxPTR ", config = 0x%016" PRIxPTR ", native_window = 0x%016" PRIxPTR
    804              ", attrib_list = 0x%016" PRIxPTR "",
    805              (uintptr_t)dpy, (uintptr_t)config, (uintptr_t)native_window, (uintptr_t)attrib_list);
    806 
    807    Thread *thread = egl::GetCurrentThread();
    808 
    809    egl::Display *dpyPacked               = PackParam<egl::Display *>(dpy);
    810    Config *configPacked                  = PackParam<Config *>(config);
    811    const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
    812 
    813    ANGLE_EGL_VALIDATE(thread, CreatePlatformWindowSurfaceEXT, GetDisplayIfValid(dpyPacked),
    814                       EGLSurface, dpyPacked, configPacked, native_window, attrib_listPacked);
    815 
    816    return CreatePlatformWindowSurfaceEXT(thread, dpyPacked, configPacked, native_window,
    817                                          attrib_listPacked);
    818 }
    819 
    820 EGLDisplay EGLAPIENTRY EGL_GetPlatformDisplayEXT(EGLenum platform,
    821                                                 void *native_display,
    822                                                 const EGLint *attrib_list)
    823 {
    824 
    825    ANGLE_SCOPED_GLOBAL_LOCK();
    826    EGL_EVENT(GetPlatformDisplayEXT,
    827              "platform = 0x%X, native_display = 0x%016" PRIxPTR ", attrib_list = 0x%016" PRIxPTR
    828              "",
    829              platform, (uintptr_t)native_display, (uintptr_t)attrib_list);
    830 
    831    Thread *thread = egl::GetCurrentThread();
    832 
    833    const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
    834 
    835    ANGLE_EGL_VALIDATE(thread, GetPlatformDisplayEXT, nullptr, EGLDisplay, platform, native_display,
    836                       attrib_listPacked);
    837 
    838    return GetPlatformDisplayEXT(thread, platform, native_display, attrib_listPacked);
    839 }
    840 
    841 // EGL_KHR_debug
    842 EGLint EGLAPIENTRY EGL_DebugMessageControlKHR(EGLDEBUGPROCKHR callback,
    843                                              const EGLAttrib *attrib_list)
    844 {
    845 
    846    ANGLE_SCOPED_GLOBAL_LOCK();
    847    EGL_EVENT(DebugMessageControlKHR,
    848              "callback = 0x%016" PRIxPTR ", attrib_list = 0x%016" PRIxPTR "", (uintptr_t)callback,
    849              (uintptr_t)attrib_list);
    850 
    851    Thread *thread = egl::GetCurrentThread();
    852 
    853    const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
    854 
    855    ANGLE_EGL_VALIDATE(thread, DebugMessageControlKHR, nullptr, EGLint, callback,
    856                       attrib_listPacked);
    857 
    858    return DebugMessageControlKHR(thread, callback, attrib_listPacked);
    859 }
    860 
    861 EGLint EGLAPIENTRY EGL_LabelObjectKHR(EGLDisplay display,
    862                                      EGLenum objectType,
    863                                      EGLObjectKHR object,
    864                                      EGLLabelKHR label)
    865 {
    866 
    867    ANGLE_SCOPED_GLOBAL_LOCK();
    868    EGL_EVENT(LabelObjectKHR,
    869              "display = 0x%016" PRIxPTR ", objectType = 0x%X, object = 0x%016" PRIxPTR
    870              ", label = 0x%016" PRIxPTR "",
    871              (uintptr_t)display, objectType, (uintptr_t)object, (uintptr_t)label);
    872 
    873    Thread *thread = egl::GetCurrentThread();
    874 
    875    egl::Display *displayPacked = PackParam<egl::Display *>(display);
    876    ObjectType objectTypePacked = PackParam<ObjectType>(objectType);
    877 
    878    ANGLE_EGL_VALIDATE(thread, LabelObjectKHR, GetDisplayIfValid(displayPacked), EGLint,
    879                       displayPacked, objectTypePacked, object, label);
    880 
    881    return LabelObjectKHR(thread, displayPacked, objectTypePacked, object, label);
    882 }
    883 
    884 EGLBoolean EGLAPIENTRY EGL_QueryDebugKHR(EGLint attribute, EGLAttrib *value)
    885 {
    886 
    887    ANGLE_SCOPED_GLOBAL_LOCK();
    888    EGL_EVENT(QueryDebugKHR, "attribute = %d, value = 0x%016" PRIxPTR "", attribute,
    889              (uintptr_t)value);
    890 
    891    Thread *thread = egl::GetCurrentThread();
    892 
    893    ANGLE_EGL_VALIDATE(thread, QueryDebugKHR, nullptr, EGLBoolean, attribute, value);
    894 
    895    return QueryDebugKHR(thread, attribute, value);
    896 }
    897 
    898 // EGL_KHR_fence_sync
    899 EGLint EGLAPIENTRY EGL_ClientWaitSyncKHR(EGLDisplay dpy,
    900                                         EGLSyncKHR sync,
    901                                         EGLint flags,
    902                                         EGLTimeKHR timeout)
    903 {
    904 
    905    ANGLE_SCOPED_GLOBAL_LOCK();
    906    EGL_EVENT(ClientWaitSyncKHR,
    907              "dpy = 0x%016" PRIxPTR ", sync = 0x%016" PRIxPTR ", flags = %d, timeout = %llu",
    908              (uintptr_t)dpy, (uintptr_t)sync, flags, static_cast<unsigned long long>(timeout));
    909 
    910    Thread *thread = egl::GetCurrentThread();
    911 
    912    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    913    Sync *syncPacked        = PackParam<Sync *>(sync);
    914 
    915    ANGLE_EGL_VALIDATE(thread, ClientWaitSyncKHR, GetDisplayIfValid(dpyPacked), EGLint, dpyPacked,
    916                       syncPacked, flags, timeout);
    917 
    918    return ClientWaitSyncKHR(thread, dpyPacked, syncPacked, flags, timeout);
    919 }
    920 
    921 EGLSyncKHR EGLAPIENTRY EGL_CreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list)
    922 {
    923 
    924    ANGLE_SCOPED_GLOBAL_LOCK();
    925    EGL_EVENT(CreateSyncKHR,
    926              "dpy = 0x%016" PRIxPTR ", type = 0x%X, attrib_list = 0x%016" PRIxPTR "",
    927              (uintptr_t)dpy, type, (uintptr_t)attrib_list);
    928 
    929    Thread *thread = egl::GetCurrentThread();
    930 
    931    egl::Display *dpyPacked               = PackParam<egl::Display *>(dpy);
    932    const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
    933 
    934    ANGLE_EGL_VALIDATE(thread, CreateSyncKHR, GetDisplayIfValid(dpyPacked), EGLSyncKHR, dpyPacked,
    935                       type, attrib_listPacked);
    936 
    937    return CreateSyncKHR(thread, dpyPacked, type, attrib_listPacked);
    938 }
    939 
    940 EGLBoolean EGLAPIENTRY EGL_DestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync)
    941 {
    942 
    943    ANGLE_SCOPED_GLOBAL_LOCK();
    944    EGL_EVENT(DestroySyncKHR, "dpy = 0x%016" PRIxPTR ", sync = 0x%016" PRIxPTR "", (uintptr_t)dpy,
    945              (uintptr_t)sync);
    946 
    947    Thread *thread = egl::GetCurrentThread();
    948 
    949    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    950    Sync *syncPacked        = PackParam<Sync *>(sync);
    951 
    952    ANGLE_EGL_VALIDATE(thread, DestroySyncKHR, GetDisplayIfValid(dpyPacked), EGLBoolean, dpyPacked,
    953                       syncPacked);
    954 
    955    return DestroySyncKHR(thread, dpyPacked, syncPacked);
    956 }
    957 
    958 EGLBoolean EGLAPIENTRY EGL_GetSyncAttribKHR(EGLDisplay dpy,
    959                                            EGLSyncKHR sync,
    960                                            EGLint attribute,
    961                                            EGLint *value)
    962 {
    963 
    964    ANGLE_SCOPED_GLOBAL_LOCK();
    965    EGL_EVENT(GetSyncAttribKHR,
    966              "dpy = 0x%016" PRIxPTR ", sync = 0x%016" PRIxPTR
    967              ", attribute = %d, value = 0x%016" PRIxPTR "",
    968              (uintptr_t)dpy, (uintptr_t)sync, attribute, (uintptr_t)value);
    969 
    970    Thread *thread = egl::GetCurrentThread();
    971 
    972    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
    973    Sync *syncPacked        = PackParam<Sync *>(sync);
    974 
    975    ANGLE_EGL_VALIDATE(thread, GetSyncAttribKHR, GetDisplayIfValid(dpyPacked), EGLBoolean,
    976                       dpyPacked, syncPacked, attribute, value);
    977 
    978    return GetSyncAttribKHR(thread, dpyPacked, syncPacked, attribute, value);
    979 }
    980 
    981 // EGL_KHR_image
    982 EGLImageKHR EGLAPIENTRY EGL_CreateImageKHR(EGLDisplay dpy,
    983                                           EGLContext ctx,
    984                                           EGLenum target,
    985                                           EGLClientBuffer buffer,
    986                                           const EGLint *attrib_list)
    987 {
    988 
    989    ANGLE_SCOPED_GLOBAL_LOCK();
    990    EGL_EVENT(CreateImageKHR,
    991              "dpy = 0x%016" PRIxPTR ", ctx = 0x%016" PRIxPTR
    992              ", target = 0x%X, buffer = 0x%016" PRIxPTR ", attrib_list = 0x%016" PRIxPTR "",
    993              (uintptr_t)dpy, (uintptr_t)ctx, target, (uintptr_t)buffer, (uintptr_t)attrib_list);
    994 
    995    Thread *thread = egl::GetCurrentThread();
    996 
    997    egl::Display *dpyPacked               = PackParam<egl::Display *>(dpy);
    998    gl::Context *ctxPacked                = PackParam<gl::Context *>(ctx);
    999    const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
   1000 
   1001    ANGLE_EGL_VALIDATE(thread, CreateImageKHR, GetDisplayIfValid(dpyPacked), EGLImageKHR, dpyPacked,
   1002                       ctxPacked, target, buffer, attrib_listPacked);
   1003 
   1004    return CreateImageKHR(thread, dpyPacked, ctxPacked, target, buffer, attrib_listPacked);
   1005 }
   1006 
   1007 EGLBoolean EGLAPIENTRY EGL_DestroyImageKHR(EGLDisplay dpy, EGLImageKHR image)
   1008 {
   1009 
   1010    ANGLE_SCOPED_GLOBAL_LOCK();
   1011    EGL_EVENT(DestroyImageKHR, "dpy = 0x%016" PRIxPTR ", image = 0x%016" PRIxPTR "", (uintptr_t)dpy,
   1012              (uintptr_t)image);
   1013 
   1014    Thread *thread = egl::GetCurrentThread();
   1015 
   1016    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
   1017    Image *imagePacked      = PackParam<Image *>(image);
   1018 
   1019    ANGLE_EGL_VALIDATE(thread, DestroyImageKHR, GetDisplayIfValid(dpyPacked), EGLBoolean, dpyPacked,
   1020                       imagePacked);
   1021 
   1022    return DestroyImageKHR(thread, dpyPacked, imagePacked);
   1023 }
   1024 
   1025 // EGL_KHR_lock_surface3
   1026 EGLBoolean EGLAPIENTRY EGL_LockSurfaceKHR(EGLDisplay dpy,
   1027                                          EGLSurface surface,
   1028                                          const EGLint *attrib_list)
   1029 {
   1030 
   1031    ANGLE_SCOPED_GLOBAL_SURFACE_LOCK();
   1032    ANGLE_SCOPED_GLOBAL_LOCK();
   1033    EGL_EVENT(LockSurfaceKHR,
   1034              "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR ", attrib_list = 0x%016" PRIxPTR
   1035              "",
   1036              (uintptr_t)dpy, (uintptr_t)surface, (uintptr_t)attrib_list);
   1037 
   1038    Thread *thread = egl::GetCurrentThread();
   1039 
   1040    egl::Display *dpyPacked               = PackParam<egl::Display *>(dpy);
   1041    Surface *surfacePacked                = PackParam<Surface *>(surface);
   1042    const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
   1043 
   1044    ANGLE_EGL_VALIDATE(thread, LockSurfaceKHR, GetDisplayIfValid(dpyPacked), EGLBoolean, dpyPacked,
   1045                       surfacePacked, attrib_listPacked);
   1046 
   1047    return LockSurfaceKHR(thread, dpyPacked, surfacePacked, attrib_listPacked);
   1048 }
   1049 
   1050 EGLBoolean EGLAPIENTRY EGL_QuerySurface64KHR(EGLDisplay dpy,
   1051                                             EGLSurface surface,
   1052                                             EGLint attribute,
   1053                                             EGLAttribKHR *value)
   1054 {
   1055 
   1056    ANGLE_SCOPED_GLOBAL_SURFACE_LOCK();
   1057    ANGLE_SCOPED_GLOBAL_LOCK();
   1058    EGL_EVENT(QuerySurface64KHR,
   1059              "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR
   1060              ", attribute = %d, value = 0x%016" PRIxPTR "",
   1061              (uintptr_t)dpy, (uintptr_t)surface, attribute, (uintptr_t)value);
   1062 
   1063    Thread *thread = egl::GetCurrentThread();
   1064 
   1065    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
   1066    Surface *surfacePacked  = PackParam<Surface *>(surface);
   1067 
   1068    ANGLE_EGL_VALIDATE(thread, QuerySurface64KHR, GetDisplayIfValid(dpyPacked), EGLBoolean,
   1069                       dpyPacked, surfacePacked, attribute, value);
   1070 
   1071    return QuerySurface64KHR(thread, dpyPacked, surfacePacked, attribute, value);
   1072 }
   1073 
   1074 EGLBoolean EGLAPIENTRY EGL_UnlockSurfaceKHR(EGLDisplay dpy, EGLSurface surface)
   1075 {
   1076 
   1077    ANGLE_SCOPED_GLOBAL_SURFACE_LOCK();
   1078    ANGLE_SCOPED_GLOBAL_LOCK();
   1079    EGL_EVENT(UnlockSurfaceKHR, "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR "",
   1080              (uintptr_t)dpy, (uintptr_t)surface);
   1081 
   1082    Thread *thread = egl::GetCurrentThread();
   1083 
   1084    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
   1085    Surface *surfacePacked  = PackParam<Surface *>(surface);
   1086 
   1087    ANGLE_EGL_VALIDATE(thread, UnlockSurfaceKHR, GetDisplayIfValid(dpyPacked), EGLBoolean,
   1088                       dpyPacked, surfacePacked);
   1089 
   1090    return UnlockSurfaceKHR(thread, dpyPacked, surfacePacked);
   1091 }
   1092 
   1093 // EGL_KHR_partial_update
   1094 EGLBoolean EGLAPIENTRY EGL_SetDamageRegionKHR(EGLDisplay dpy,
   1095                                              EGLSurface surface,
   1096                                              EGLint *rects,
   1097                                              EGLint n_rects)
   1098 {
   1099 
   1100    ANGLE_SCOPED_GLOBAL_SURFACE_LOCK();
   1101    ANGLE_SCOPED_GLOBAL_LOCK();
   1102    EGL_EVENT(SetDamageRegionKHR,
   1103              "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR ", rects = 0x%016" PRIxPTR
   1104              ", n_rects = %d",
   1105              (uintptr_t)dpy, (uintptr_t)surface, (uintptr_t)rects, n_rects);
   1106 
   1107    Thread *thread = egl::GetCurrentThread();
   1108 
   1109    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
   1110    Surface *surfacePacked  = PackParam<Surface *>(surface);
   1111 
   1112    ANGLE_EGL_VALIDATE(thread, SetDamageRegionKHR, GetDisplayIfValid(dpyPacked), EGLBoolean,
   1113                       dpyPacked, surfacePacked, rects, n_rects);
   1114 
   1115    return SetDamageRegionKHR(thread, dpyPacked, surfacePacked, rects, n_rects);
   1116 }
   1117 
   1118 // EGL_KHR_reusable_sync
   1119 EGLBoolean EGLAPIENTRY EGL_SignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode)
   1120 {
   1121 
   1122    ANGLE_SCOPED_GLOBAL_LOCK();
   1123    EGL_EVENT(SignalSyncKHR, "dpy = 0x%016" PRIxPTR ", sync = 0x%016" PRIxPTR ", mode = 0x%X",
   1124              (uintptr_t)dpy, (uintptr_t)sync, mode);
   1125 
   1126    Thread *thread = egl::GetCurrentThread();
   1127 
   1128    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
   1129    Sync *syncPacked        = PackParam<Sync *>(sync);
   1130 
   1131    ANGLE_EGL_VALIDATE(thread, SignalSyncKHR, GetDisplayIfValid(dpyPacked), EGLBoolean, dpyPacked,
   1132                       syncPacked, mode);
   1133 
   1134    return SignalSyncKHR(thread, dpyPacked, syncPacked, mode);
   1135 }
   1136 
   1137 // ClientWaitSyncKHR is already defined.
   1138 
   1139 // CreateSyncKHR is already defined.
   1140 
   1141 // DestroySyncKHR is already defined.
   1142 
   1143 // GetSyncAttribKHR is already defined.
   1144 
   1145 // EGL_KHR_stream
   1146 EGLStreamKHR EGLAPIENTRY EGL_CreateStreamKHR(EGLDisplay dpy, const EGLint *attrib_list)
   1147 {
   1148 
   1149    ANGLE_SCOPED_GLOBAL_LOCK();
   1150    EGL_EVENT(CreateStreamKHR, "dpy = 0x%016" PRIxPTR ", attrib_list = 0x%016" PRIxPTR "",
   1151              (uintptr_t)dpy, (uintptr_t)attrib_list);
   1152 
   1153    Thread *thread = egl::GetCurrentThread();
   1154 
   1155    egl::Display *dpyPacked               = PackParam<egl::Display *>(dpy);
   1156    const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
   1157 
   1158    ANGLE_EGL_VALIDATE(thread, CreateStreamKHR, GetDisplayIfValid(dpyPacked), EGLStreamKHR,
   1159                       dpyPacked, attrib_listPacked);
   1160 
   1161    return CreateStreamKHR(thread, dpyPacked, attrib_listPacked);
   1162 }
   1163 
   1164 EGLBoolean EGLAPIENTRY EGL_DestroyStreamKHR(EGLDisplay dpy, EGLStreamKHR stream)
   1165 {
   1166 
   1167    ANGLE_SCOPED_GLOBAL_LOCK();
   1168    EGL_EVENT(DestroyStreamKHR, "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR "",
   1169              (uintptr_t)dpy, (uintptr_t)stream);
   1170 
   1171    Thread *thread = egl::GetCurrentThread();
   1172 
   1173    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
   1174    Stream *streamPacked    = PackParam<Stream *>(stream);
   1175 
   1176    ANGLE_EGL_VALIDATE(thread, DestroyStreamKHR, GetDisplayIfValid(dpyPacked), EGLBoolean,
   1177                       dpyPacked, streamPacked);
   1178 
   1179    return DestroyStreamKHR(thread, dpyPacked, streamPacked);
   1180 }
   1181 
   1182 EGLBoolean EGLAPIENTRY EGL_QueryStreamKHR(EGLDisplay dpy,
   1183                                          EGLStreamKHR stream,
   1184                                          EGLenum attribute,
   1185                                          EGLint *value)
   1186 {
   1187 
   1188    ANGLE_SCOPED_GLOBAL_LOCK();
   1189    EGL_EVENT(QueryStreamKHR,
   1190              "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR
   1191              ", attribute = 0x%X, value = 0x%016" PRIxPTR "",
   1192              (uintptr_t)dpy, (uintptr_t)stream, attribute, (uintptr_t)value);
   1193 
   1194    Thread *thread = egl::GetCurrentThread();
   1195 
   1196    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
   1197    Stream *streamPacked    = PackParam<Stream *>(stream);
   1198 
   1199    ANGLE_EGL_VALIDATE(thread, QueryStreamKHR, GetDisplayIfValid(dpyPacked), EGLBoolean, dpyPacked,
   1200                       streamPacked, attribute, value);
   1201 
   1202    return QueryStreamKHR(thread, dpyPacked, streamPacked, attribute, value);
   1203 }
   1204 
   1205 EGLBoolean EGLAPIENTRY EGL_QueryStreamu64KHR(EGLDisplay dpy,
   1206                                             EGLStreamKHR stream,
   1207                                             EGLenum attribute,
   1208                                             EGLuint64KHR *value)
   1209 {
   1210 
   1211    ANGLE_SCOPED_GLOBAL_LOCK();
   1212    EGL_EVENT(QueryStreamu64KHR,
   1213              "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR
   1214              ", attribute = 0x%X, value = 0x%016" PRIxPTR "",
   1215              (uintptr_t)dpy, (uintptr_t)stream, attribute, (uintptr_t)value);
   1216 
   1217    Thread *thread = egl::GetCurrentThread();
   1218 
   1219    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
   1220    Stream *streamPacked    = PackParam<Stream *>(stream);
   1221 
   1222    ANGLE_EGL_VALIDATE(thread, QueryStreamu64KHR, GetDisplayIfValid(dpyPacked), EGLBoolean,
   1223                       dpyPacked, streamPacked, attribute, value);
   1224 
   1225    return QueryStreamu64KHR(thread, dpyPacked, streamPacked, attribute, value);
   1226 }
   1227 
   1228 EGLBoolean EGLAPIENTRY EGL_StreamAttribKHR(EGLDisplay dpy,
   1229                                           EGLStreamKHR stream,
   1230                                           EGLenum attribute,
   1231                                           EGLint value)
   1232 {
   1233 
   1234    ANGLE_SCOPED_GLOBAL_LOCK();
   1235    EGL_EVENT(StreamAttribKHR,
   1236              "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR ", attribute = 0x%X, value = %d",
   1237              (uintptr_t)dpy, (uintptr_t)stream, attribute, value);
   1238 
   1239    Thread *thread = egl::GetCurrentThread();
   1240 
   1241    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
   1242    Stream *streamPacked    = PackParam<Stream *>(stream);
   1243 
   1244    ANGLE_EGL_VALIDATE(thread, StreamAttribKHR, GetDisplayIfValid(dpyPacked), EGLBoolean, dpyPacked,
   1245                       streamPacked, attribute, value);
   1246 
   1247    return StreamAttribKHR(thread, dpyPacked, streamPacked, attribute, value);
   1248 }
   1249 
   1250 // EGL_KHR_stream_consumer_gltexture
   1251 EGLBoolean EGLAPIENTRY EGL_StreamConsumerAcquireKHR(EGLDisplay dpy, EGLStreamKHR stream)
   1252 {
   1253 
   1254    ANGLE_SCOPED_GLOBAL_LOCK();
   1255    EGL_EVENT(StreamConsumerAcquireKHR, "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR "",
   1256              (uintptr_t)dpy, (uintptr_t)stream);
   1257 
   1258    Thread *thread = egl::GetCurrentThread();
   1259 
   1260    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
   1261    Stream *streamPacked    = PackParam<Stream *>(stream);
   1262 
   1263    ANGLE_EGL_VALIDATE(thread, StreamConsumerAcquireKHR, GetDisplayIfValid(dpyPacked), EGLBoolean,
   1264                       dpyPacked, streamPacked);
   1265 
   1266    return StreamConsumerAcquireKHR(thread, dpyPacked, streamPacked);
   1267 }
   1268 
   1269 EGLBoolean EGLAPIENTRY EGL_StreamConsumerGLTextureExternalKHR(EGLDisplay dpy, EGLStreamKHR stream)
   1270 {
   1271 
   1272    ANGLE_SCOPED_GLOBAL_LOCK();
   1273    EGL_EVENT(StreamConsumerGLTextureExternalKHR,
   1274              "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR "", (uintptr_t)dpy,
   1275              (uintptr_t)stream);
   1276 
   1277    Thread *thread = egl::GetCurrentThread();
   1278 
   1279    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
   1280    Stream *streamPacked    = PackParam<Stream *>(stream);
   1281 
   1282    ANGLE_EGL_VALIDATE(thread, StreamConsumerGLTextureExternalKHR, GetDisplayIfValid(dpyPacked),
   1283                       EGLBoolean, dpyPacked, streamPacked);
   1284 
   1285    return StreamConsumerGLTextureExternalKHR(thread, dpyPacked, streamPacked);
   1286 }
   1287 
   1288 EGLBoolean EGLAPIENTRY EGL_StreamConsumerReleaseKHR(EGLDisplay dpy, EGLStreamKHR stream)
   1289 {
   1290 
   1291    ANGLE_SCOPED_GLOBAL_LOCK();
   1292    EGL_EVENT(StreamConsumerReleaseKHR, "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR "",
   1293              (uintptr_t)dpy, (uintptr_t)stream);
   1294 
   1295    Thread *thread = egl::GetCurrentThread();
   1296 
   1297    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
   1298    Stream *streamPacked    = PackParam<Stream *>(stream);
   1299 
   1300    ANGLE_EGL_VALIDATE(thread, StreamConsumerReleaseKHR, GetDisplayIfValid(dpyPacked), EGLBoolean,
   1301                       dpyPacked, streamPacked);
   1302 
   1303    return StreamConsumerReleaseKHR(thread, dpyPacked, streamPacked);
   1304 }
   1305 
   1306 // EGL_KHR_swap_buffers_with_damage
   1307 EGLBoolean EGLAPIENTRY EGL_SwapBuffersWithDamageKHR(EGLDisplay dpy,
   1308                                                    EGLSurface surface,
   1309                                                    const EGLint *rects,
   1310                                                    EGLint n_rects)
   1311 {
   1312    ANGLE_EGLBOOLEAN_TRY(PrepareSwapBuffersANGLE(dpy, surface));
   1313    ANGLE_SCOPED_GLOBAL_SURFACE_LOCK();
   1314    ANGLE_SCOPED_GLOBAL_LOCK();
   1315    EGL_EVENT(SwapBuffersWithDamageKHR,
   1316              "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR ", rects = 0x%016" PRIxPTR
   1317              ", n_rects = %d",
   1318              (uintptr_t)dpy, (uintptr_t)surface, (uintptr_t)rects, n_rects);
   1319 
   1320    Thread *thread = egl::GetCurrentThread();
   1321 
   1322    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
   1323    Surface *surfacePacked  = PackParam<Surface *>(surface);
   1324 
   1325    ANGLE_EGL_VALIDATE(thread, SwapBuffersWithDamageKHR, GetDisplayIfValid(dpyPacked), EGLBoolean,
   1326                       dpyPacked, surfacePacked, rects, n_rects);
   1327 
   1328    return SwapBuffersWithDamageKHR(thread, dpyPacked, surfacePacked, rects, n_rects);
   1329 }
   1330 
   1331 // EGL_KHR_wait_sync
   1332 EGLint EGLAPIENTRY EGL_WaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags)
   1333 {
   1334 
   1335    ANGLE_SCOPED_GLOBAL_LOCK();
   1336    EGL_EVENT(WaitSyncKHR, "dpy = 0x%016" PRIxPTR ", sync = 0x%016" PRIxPTR ", flags = %d",
   1337              (uintptr_t)dpy, (uintptr_t)sync, flags);
   1338 
   1339    Thread *thread = egl::GetCurrentThread();
   1340 
   1341    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
   1342    Sync *syncPacked        = PackParam<Sync *>(sync);
   1343 
   1344    ANGLE_EGL_VALIDATE(thread, WaitSyncKHR, GetDisplayIfValid(dpyPacked), EGLint, dpyPacked,
   1345                       syncPacked, flags);
   1346 
   1347    return WaitSyncKHR(thread, dpyPacked, syncPacked, flags);
   1348 }
   1349 
   1350 // EGL_NV_post_sub_buffer
   1351 EGLBoolean EGLAPIENTRY EGL_PostSubBufferNV(EGLDisplay dpy,
   1352                                           EGLSurface surface,
   1353                                           EGLint x,
   1354                                           EGLint y,
   1355                                           EGLint width,
   1356                                           EGLint height)
   1357 {
   1358 
   1359    ANGLE_SCOPED_GLOBAL_SURFACE_LOCK();
   1360    ANGLE_SCOPED_GLOBAL_LOCK();
   1361    EGL_EVENT(PostSubBufferNV,
   1362              "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR
   1363              ", x = %d, y = %d, width = %d, height = %d",
   1364              (uintptr_t)dpy, (uintptr_t)surface, x, y, width, height);
   1365 
   1366    Thread *thread = egl::GetCurrentThread();
   1367 
   1368    egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
   1369    Surface *surfacePacked  = PackParam<Surface *>(surface);
   1370 
   1371    ANGLE_EGL_VALIDATE(thread, PostSubBufferNV, GetDisplayIfValid(dpyPacked), EGLBoolean, dpyPacked,
   1372                       surfacePacked, x, y, width, height);
   1373 
   1374    return PostSubBufferNV(thread, dpyPacked, surfacePacked, x, y, width, height);
   1375 }
   1376 
   1377 // EGL_NV_stream_consumer_gltexture_yuv
   1378 EGLBoolean EGLAPIENTRY EGL_StreamConsumerGLTextureExternalAttribsNV(EGLDisplay dpy,
   1379                                                                    EGLStreamKHR stream,
   1380                                                                    const EGLAttrib *attrib_list)
   1381 {
   1382 
   1383    ANGLE_SCOPED_GLOBAL_LOCK();
   1384    EGL_EVENT(StreamConsumerGLTextureExternalAttribsNV,
   1385              "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR ", attrib_list = 0x%016" PRIxPTR
   1386              "",
   1387              (uintptr_t)dpy, (uintptr_t)stream, (uintptr_t)attrib_list);
   1388 
   1389    Thread *thread = egl::GetCurrentThread();
   1390 
   1391    egl::Display *dpyPacked               = PackParam<egl::Display *>(dpy);
   1392    Stream *streamPacked                  = PackParam<Stream *>(stream);
   1393    const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
   1394 
   1395    ANGLE_EGL_VALIDATE(thread, StreamConsumerGLTextureExternalAttribsNV,
   1396                       GetDisplayIfValid(dpyPacked), EGLBoolean, dpyPacked, streamPacked,
   1397                       attrib_listPacked);
   1398 
   1399    return StreamConsumerGLTextureExternalAttribsNV(thread, dpyPacked, streamPacked,
   1400                                                    attrib_listPacked);
   1401 }
   1402 
   1403 }  // extern "C"