1 //
2 // Copyright 2023 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 // egl_context_lock_autogen.h:
7 // Context Lock functions for the EGL entry points.
8
9 #ifndef LIBGLESV2_EGL_CONTEXT_LOCK_IMPL_H_
10 #define LIBGLESV2_EGL_CONTEXT_LOCK_IMPL_H_
11
12 #include "libGLESv2/egl_context_lock_autogen.h"
13
14 namespace egl
15 {
16 namespace priv
17 {
ClientWaitSyncHasFlush(EGLint flags)18 ANGLE_INLINE bool ClientWaitSyncHasFlush(EGLint flags)
19 {
20 return (flags & EGL_SYNC_FLUSH_COMMANDS_BIT_KHR) != 0;
21 }
22 } // namespace priv
23
GetContextLock_ChooseConfig(Thread * thread,egl::Display * dpyPacked)24 ANGLE_INLINE ScopedContextMutexLock GetContextLock_ChooseConfig(Thread *thread,
25 egl::Display *dpyPacked)
26 {
27 return {};
28 }
29
GetContextLock_CopyBuffers(Thread * thread,egl::Display * dpyPacked)30 ANGLE_INLINE ScopedContextMutexLock GetContextLock_CopyBuffers(Thread *thread,
31 egl::Display *dpyPacked)
32 {
33 return {};
34 }
35
GetContextLock_CreateContext(Thread * thread,egl::Display * dpyPacked,gl::ContextID share_contextPacked)36 ANGLE_INLINE ScopedContextMutexLock GetContextLock_CreateContext(Thread *thread,
37 egl::Display *dpyPacked,
38 gl::ContextID share_contextPacked)
39 {
40 return TryLockContext(dpyPacked, share_contextPacked);
41 }
42
GetContextLock_CreatePbufferSurface(Thread * thread,egl::Display * dpyPacked)43 ANGLE_INLINE ScopedContextMutexLock GetContextLock_CreatePbufferSurface(Thread *thread,
44 egl::Display *dpyPacked)
45 {
46 return {};
47 }
48
GetContextLock_CreatePixmapSurface(Thread * thread,egl::Display * dpyPacked)49 ANGLE_INLINE ScopedContextMutexLock GetContextLock_CreatePixmapSurface(Thread *thread,
50 egl::Display *dpyPacked)
51 {
52 return {};
53 }
54
GetContextLock_CreateWindowSurface(Thread * thread,egl::Display * dpyPacked)55 ANGLE_INLINE ScopedContextMutexLock GetContextLock_CreateWindowSurface(Thread *thread,
56 egl::Display *dpyPacked)
57 {
58 return {};
59 }
60
GetContextLock_DestroyContext(Thread * thread,egl::Display * dpyPacked,gl::ContextID ctxPacked)61 ANGLE_INLINE ScopedContextMutexLock GetContextLock_DestroyContext(Thread *thread,
62 egl::Display *dpyPacked,
63 gl::ContextID ctxPacked)
64 {
65 // Explicit lock in egl::Display::destroyContext()/makeCurrent()
66 return {};
67 }
68
GetContextLock_DestroySurface(Thread * thread,egl::Display * dpyPacked)69 ANGLE_INLINE ScopedContextMutexLock GetContextLock_DestroySurface(Thread *thread,
70 egl::Display *dpyPacked)
71 {
72 return {};
73 }
74
GetContextLock_GetConfigAttrib(Thread * thread,egl::Display * dpyPacked,EGLint attribute)75 ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetConfigAttrib(Thread *thread,
76 egl::Display *dpyPacked,
77 EGLint attribute)
78 {
79 return {};
80 }
81
GetContextLock_GetConfigs(Thread * thread,egl::Display * dpyPacked)82 ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetConfigs(Thread *thread,
83 egl::Display *dpyPacked)
84 {
85 return {};
86 }
87
GetContextLock_GetCurrentDisplay(Thread * thread)88 ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetCurrentDisplay(Thread *thread)
89 {
90 return {};
91 }
92
GetContextLock_GetCurrentSurface(Thread * thread)93 ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetCurrentSurface(Thread *thread)
94 {
95 return {};
96 }
97
GetContextLock_GetDisplay(Thread * thread)98 ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetDisplay(Thread *thread)
99 {
100 return {};
101 }
102
GetContextLock_GetError(Thread * thread)103 ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetError(Thread *thread)
104 {
105 return {};
106 }
107
GetContextLock_GetProcAddress(Thread * thread)108 ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetProcAddress(Thread *thread)
109 {
110 return {};
111 }
112
GetContextLock_Initialize(Thread * thread,egl::Display * dpyPacked)113 ANGLE_INLINE ScopedContextMutexLock GetContextLock_Initialize(Thread *thread,
114 egl::Display *dpyPacked)
115 {
116 return {};
117 }
118
GetContextLock_MakeCurrent(Thread * thread,egl::Display * dpyPacked,gl::ContextID ctxPacked)119 ANGLE_INLINE ScopedContextMutexLock GetContextLock_MakeCurrent(Thread *thread,
120 egl::Display *dpyPacked,
121 gl::ContextID ctxPacked)
122 {
123 // Explicit lock in egl::Display::makeCurrent()
124 return {};
125 }
126
GetContextLock_QueryContext(Thread * thread,egl::Display * dpyPacked,gl::ContextID ctxPacked,EGLint attribute)127 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryContext(Thread *thread,
128 egl::Display *dpyPacked,
129 gl::ContextID ctxPacked,
130 EGLint attribute)
131 {
132 return TryLockContext(dpyPacked, ctxPacked);
133 }
134
GetContextLock_QueryString(Thread * thread,egl::Display * dpyPacked)135 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryString(Thread *thread,
136 egl::Display *dpyPacked)
137 {
138 return {};
139 }
140
GetContextLock_QuerySurface(Thread * thread,egl::Display * dpyPacked,EGLint attribute)141 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QuerySurface(Thread *thread,
142 egl::Display *dpyPacked,
143 EGLint attribute)
144 {
145 switch (attribute)
146 {
147 // EGL_BUFFER_AGE_EXT uses current Context and therefore requires the lock.
148 case EGL_BUFFER_AGE_EXT:
149 return TryLockCurrentContext(thread);
150 // Other attributes are not using Context, therefore lock is not required.
151 default:
152 return {};
153 }
154 }
155
GetContextLock_SwapBuffers(Thread * thread,egl::Display * dpyPacked)156 ANGLE_INLINE ScopedContextMutexLock GetContextLock_SwapBuffers(Thread *thread,
157 egl::Display *dpyPacked)
158 {
159 return TryLockCurrentContext(thread);
160 }
161
GetContextLock_Terminate(Thread * thread,egl::Display * dpyPacked)162 ANGLE_INLINE ScopedContextMutexLock GetContextLock_Terminate(Thread *thread,
163 egl::Display *dpyPacked)
164 {
165 // Accesses only not curent Contexts
166 return {};
167 }
168
GetContextLock_WaitGL(Thread * thread)169 ANGLE_INLINE ScopedContextMutexLock GetContextLock_WaitGL(Thread *thread)
170 {
171 return TryLockCurrentContext(thread);
172 }
173
GetContextLock_WaitNative(Thread * thread)174 ANGLE_INLINE ScopedContextMutexLock GetContextLock_WaitNative(Thread *thread)
175 {
176 return TryLockCurrentContext(thread);
177 }
178
179 // EGL 1.1
GetContextLock_BindTexImage(Thread * thread,egl::Display * dpyPacked)180 ANGLE_INLINE ScopedContextMutexLock GetContextLock_BindTexImage(Thread *thread,
181 egl::Display *dpyPacked)
182 {
183 return TryLockCurrentContext(thread);
184 }
185
GetContextLock_ReleaseTexImage(Thread * thread,egl::Display * dpyPacked)186 ANGLE_INLINE ScopedContextMutexLock GetContextLock_ReleaseTexImage(Thread *thread,
187 egl::Display *dpyPacked)
188 {
189 return TryLockCurrentContext(thread);
190 }
191
GetContextLock_SurfaceAttrib(Thread * thread,egl::Display * dpyPacked,EGLint attribute)192 ANGLE_INLINE ScopedContextMutexLock GetContextLock_SurfaceAttrib(Thread *thread,
193 egl::Display *dpyPacked,
194 EGLint attribute)
195 {
196 return {};
197 }
198
GetContextLock_SwapInterval(Thread * thread,egl::Display * dpyPacked)199 ANGLE_INLINE ScopedContextMutexLock GetContextLock_SwapInterval(Thread *thread,
200 egl::Display *dpyPacked)
201 {
202 // Only checked in Validation that we have current Context
203 return {};
204 }
205
206 // EGL 1.2
GetContextLock_BindAPI(Thread * thread)207 ANGLE_INLINE ScopedContextMutexLock GetContextLock_BindAPI(Thread *thread)
208 {
209 return {};
210 }
211
212 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_CreatePbufferFromClientBuffer(Thread * thread,egl::Display * dpyPacked)213 GetContextLock_CreatePbufferFromClientBuffer(Thread *thread, egl::Display *dpyPacked)
214 {
215 return {};
216 }
217
GetContextLock_QueryAPI(Thread * thread)218 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryAPI(Thread *thread)
219 {
220 return {};
221 }
222
GetContextLock_ReleaseThread(Thread * thread)223 ANGLE_INLINE ScopedContextMutexLock GetContextLock_ReleaseThread(Thread *thread)
224 {
225 // Explicit lock in egl::Display::makeCurrent()
226 return {};
227 }
228
GetContextLock_WaitClient(Thread * thread)229 ANGLE_INLINE ScopedContextMutexLock GetContextLock_WaitClient(Thread *thread)
230 {
231 return TryLockCurrentContext(thread);
232 }
233
234 // EGL 1.4
GetContextLock_GetCurrentContext(Thread * thread)235 ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetCurrentContext(Thread *thread)
236 {
237 return {};
238 }
239
240 // EGL 1.5
GetContextLock_ClientWaitSync(Thread * thread,egl::Display * dpyPacked,EGLint flags)241 ANGLE_INLINE ScopedContextMutexLock GetContextLock_ClientWaitSync(Thread *thread,
242 egl::Display *dpyPacked,
243 EGLint flags)
244 {
245 if (priv::ClientWaitSyncHasFlush(flags))
246 {
247 return TryLockCurrentContext(thread);
248 }
249 else
250 {
251 return {};
252 }
253 }
254
GetContextLock_CreateImage(Thread * thread,egl::Display * dpyPacked,gl::ContextID ctxPacked)255 ANGLE_INLINE ScopedContextMutexLock GetContextLock_CreateImage(Thread *thread,
256 egl::Display *dpyPacked,
257 gl::ContextID ctxPacked)
258 {
259 return TryLockContext(dpyPacked, ctxPacked);
260 }
261
262 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_CreatePlatformPixmapSurface(Thread * thread,egl::Display * dpyPacked)263 GetContextLock_CreatePlatformPixmapSurface(Thread *thread, egl::Display *dpyPacked)
264 {
265 return {};
266 }
267
268 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_CreatePlatformWindowSurface(Thread * thread,egl::Display * dpyPacked)269 GetContextLock_CreatePlatformWindowSurface(Thread *thread, egl::Display *dpyPacked)
270 {
271 return {};
272 }
273
GetContextLock_CreateSync(Thread * thread,egl::Display * dpyPacked)274 ANGLE_INLINE ScopedContextMutexLock GetContextLock_CreateSync(Thread *thread,
275 egl::Display *dpyPacked)
276 {
277 return TryLockCurrentContext(thread);
278 }
279
GetContextLock_DestroyImage(Thread * thread,egl::Display * dpyPacked)280 ANGLE_INLINE ScopedContextMutexLock GetContextLock_DestroyImage(Thread *thread,
281 egl::Display *dpyPacked)
282 {
283 // Explicit lock in egl::Display::destroyImageImpl()
284 return {};
285 }
286
GetContextLock_DestroySync(Thread * thread,egl::Display * dpyPacked)287 ANGLE_INLINE ScopedContextMutexLock GetContextLock_DestroySync(Thread *thread,
288 egl::Display *dpyPacked)
289 {
290 return {};
291 }
292
GetContextLock_GetPlatformDisplay(Thread * thread)293 ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetPlatformDisplay(Thread *thread)
294 {
295 return {};
296 }
297
GetContextLock_GetSyncAttrib(Thread * thread,egl::Display * dpyPacked,EGLint attribute)298 ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetSyncAttrib(Thread *thread,
299 egl::Display *dpyPacked,
300 EGLint attribute)
301 {
302 return {};
303 }
304
GetContextLock_WaitSync(Thread * thread,egl::Display * dpyPacked,EGLint flags)305 ANGLE_INLINE ScopedContextMutexLock GetContextLock_WaitSync(Thread *thread,
306 egl::Display *dpyPacked,
307 EGLint flags)
308
309 {
310 return TryLockCurrentContext(thread);
311 }
312
313 // EGL_ANDROID_blob_cache
GetContextLock_SetBlobCacheFuncsANDROID(Thread * thread,egl::Display * dpyPacked)314 ANGLE_INLINE ScopedContextMutexLock GetContextLock_SetBlobCacheFuncsANDROID(Thread *thread,
315 egl::Display *dpyPacked)
316 {
317 return {};
318 }
319
320 // EGL_ANDROID_create_native_client_buffer
GetContextLock_CreateNativeClientBufferANDROID(Thread * thread)321 ANGLE_INLINE ScopedContextMutexLock GetContextLock_CreateNativeClientBufferANDROID(Thread *thread)
322 {
323 return {};
324 }
325
326 // EGL_ANDROID_get_frame_timestamps
327 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_GetCompositorTimingSupportedANDROID(Thread * thread,egl::Display * dpyPacked)328 GetContextLock_GetCompositorTimingSupportedANDROID(Thread *thread, egl::Display *dpyPacked)
329 {
330 return {};
331 }
332
333 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_GetCompositorTimingANDROID(Thread * thread,egl::Display * dpyPacked)334 GetContextLock_GetCompositorTimingANDROID(Thread *thread, egl::Display *dpyPacked)
335 {
336 return {};
337 }
338
GetContextLock_GetNextFrameIdANDROID(Thread * thread,egl::Display * dpyPacked)339 ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetNextFrameIdANDROID(Thread *thread,
340 egl::Display *dpyPacked)
341 {
342 return {};
343 }
344
345 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_GetFrameTimestampSupportedANDROID(Thread * thread,egl::Display * dpyPacked)346 GetContextLock_GetFrameTimestampSupportedANDROID(Thread *thread, egl::Display *dpyPacked)
347 {
348 return {};
349 }
350
351 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_GetFrameTimestampsANDROID(Thread * thread,egl::Display * dpyPacked)352 GetContextLock_GetFrameTimestampsANDROID(Thread *thread, egl::Display *dpyPacked)
353 {
354 return {};
355 }
356
357 // EGL_ANDROID_get_native_client_buffer
GetContextLock_GetNativeClientBufferANDROID(Thread * thread)358 ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetNativeClientBufferANDROID(Thread *thread)
359 {
360 return {};
361 }
362
363 // EGL_ANDROID_native_fence_sync
GetContextLock_DupNativeFenceFDANDROID(Thread * thread,egl::Display * dpyPacked)364 ANGLE_INLINE ScopedContextMutexLock GetContextLock_DupNativeFenceFDANDROID(Thread *thread,
365 egl::Display *dpyPacked)
366 {
367 return {};
368 }
369
370 // EGL_ANDROID_presentation_time
GetContextLock_PresentationTimeANDROID(Thread * thread,egl::Display * dpyPacked)371 ANGLE_INLINE ScopedContextMutexLock GetContextLock_PresentationTimeANDROID(Thread *thread,
372 egl::Display *dpyPacked)
373 {
374 return {};
375 }
376
377 // EGL_ANGLE_device_creation
GetContextLock_CreateDeviceANGLE(Thread * thread)378 ANGLE_INLINE ScopedContextMutexLock GetContextLock_CreateDeviceANGLE(Thread *thread)
379 {
380 return {};
381 }
382
GetContextLock_ReleaseDeviceANGLE(Thread * thread)383 ANGLE_INLINE ScopedContextMutexLock GetContextLock_ReleaseDeviceANGLE(Thread *thread)
384 {
385 return {};
386 }
387
388 // EGL_ANGLE_external_context_and_surface
389 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_AcquireExternalContextANGLE(Thread * thread,egl::Display * dpyPacked)390 GetContextLock_AcquireExternalContextANGLE(Thread *thread, egl::Display *dpyPacked)
391 {
392 return TryLockCurrentContext(thread);
393 }
394
395 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_ReleaseExternalContextANGLE(Thread * thread,egl::Display * dpyPacked)396 GetContextLock_ReleaseExternalContextANGLE(Thread *thread, egl::Display *dpyPacked)
397 {
398 return TryLockCurrentContext(thread);
399 }
400
401 // EGL_ANGLE_feature_control
GetContextLock_QueryStringiANGLE(Thread * thread,egl::Display * dpyPacked)402 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryStringiANGLE(Thread *thread,
403 egl::Display *dpyPacked)
404 {
405 return {};
406 }
407
GetContextLock_QueryDisplayAttribANGLE(Thread * thread,egl::Display * dpyPacked,EGLint attribute)408 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryDisplayAttribANGLE(Thread *thread,
409 egl::Display *dpyPacked,
410 EGLint attribute)
411 {
412 return {};
413 }
414
415 // EGL_ANGLE_metal_shared_event_sync
416 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_CopyMetalSharedEventANGLE(Thread * thread,egl::Display * dpyPacked)417 GetContextLock_CopyMetalSharedEventANGLE(Thread *thread, egl::Display *dpyPacked)
418 {
419 return {};
420 }
421
422 // EGL_ANGLE_power_preference
GetContextLock_ReleaseHighPowerGPUANGLE(Thread * thread,egl::Display * dpyPacked,gl::ContextID ctxPacked)423 ANGLE_INLINE ScopedContextMutexLock GetContextLock_ReleaseHighPowerGPUANGLE(Thread *thread,
424 egl::Display *dpyPacked,
425 gl::ContextID ctxPacked)
426 {
427 return TryLockContext(dpyPacked, ctxPacked);
428 }
429
430 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_ReacquireHighPowerGPUANGLE(Thread * thread,egl::Display * dpyPacked,gl::ContextID ctxPacked)431 GetContextLock_ReacquireHighPowerGPUANGLE(Thread *thread,
432 egl::Display *dpyPacked,
433 gl::ContextID ctxPacked)
434 {
435 return TryLockContext(dpyPacked, ctxPacked);
436 }
437
GetContextLock_HandleGPUSwitchANGLE(Thread * thread,egl::Display * dpyPacked)438 ANGLE_INLINE ScopedContextMutexLock GetContextLock_HandleGPUSwitchANGLE(Thread *thread,
439 egl::Display *dpyPacked)
440 {
441 return {};
442 }
443
GetContextLock_ForceGPUSwitchANGLE(Thread * thread,egl::Display * dpyPacked)444 ANGLE_INLINE ScopedContextMutexLock GetContextLock_ForceGPUSwitchANGLE(Thread *thread,
445 egl::Display *dpyPacked)
446 {
447 return {};
448 }
449
450 // EGL_ANGLE_prepare_swap_buffers
GetContextLock_PrepareSwapBuffersANGLE(Thread * thread,egl::Display * dpyPacked)451 ANGLE_INLINE ScopedContextMutexLock GetContextLock_PrepareSwapBuffersANGLE(Thread *thread,
452 egl::Display *dpyPacked)
453 {
454 return TryLockCurrentContext(thread);
455 }
456
457 // EGL_ANGLE_program_cache_control
458 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_ProgramCacheGetAttribANGLE(Thread * thread,egl::Display * dpyPacked)459 GetContextLock_ProgramCacheGetAttribANGLE(Thread *thread, egl::Display *dpyPacked)
460 {
461 return {};
462 }
463
GetContextLock_ProgramCacheQueryANGLE(Thread * thread,egl::Display * dpyPacked)464 ANGLE_INLINE ScopedContextMutexLock GetContextLock_ProgramCacheQueryANGLE(Thread *thread,
465 egl::Display *dpyPacked)
466 {
467 return {};
468 }
469
470 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_ProgramCachePopulateANGLE(Thread * thread,egl::Display * dpyPacked)471 GetContextLock_ProgramCachePopulateANGLE(Thread *thread, egl::Display *dpyPacked)
472 {
473 return {};
474 }
475
GetContextLock_ProgramCacheResizeANGLE(Thread * thread,egl::Display * dpyPacked)476 ANGLE_INLINE ScopedContextMutexLock GetContextLock_ProgramCacheResizeANGLE(Thread *thread,
477 egl::Display *dpyPacked)
478 {
479 return {};
480 }
481
482 // EGL_ANGLE_query_surface_pointer
GetContextLock_QuerySurfacePointerANGLE(Thread * thread,egl::Display * dpyPacked,EGLint attribute)483 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QuerySurfacePointerANGLE(Thread *thread,
484 egl::Display *dpyPacked,
485 EGLint attribute)
486 {
487 return {};
488 }
489
490 // EGL_ANGLE_stream_producer_d3d_texture
491 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_CreateStreamProducerD3DTextureANGLE(Thread * thread,egl::Display * dpyPacked)492 GetContextLock_CreateStreamProducerD3DTextureANGLE(Thread *thread, egl::Display *dpyPacked)
493 {
494 return {};
495 }
496
497 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_StreamPostD3DTextureANGLE(Thread * thread,egl::Display * dpyPacked)498 GetContextLock_StreamPostD3DTextureANGLE(Thread *thread, egl::Display *dpyPacked)
499 {
500 return {};
501 }
502
503 // EGL_ANGLE_swap_with_frame_token
504 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_SwapBuffersWithFrameTokenANGLE(Thread * thread,egl::Display * dpyPacked)505 GetContextLock_SwapBuffersWithFrameTokenANGLE(Thread *thread, egl::Display *dpyPacked)
506 {
507 return TryLockCurrentContext(thread);
508 }
509
510 // EGL_ANGLE_sync_control_rate
GetContextLock_GetMscRateANGLE(Thread * thread,egl::Display * dpyPacked)511 ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetMscRateANGLE(Thread *thread,
512 egl::Display *dpyPacked)
513 {
514 return {};
515 }
516
517 // EGL_ANGLE_vulkan_image
GetContextLock_ExportVkImageANGLE(Thread * thread,egl::Display * dpyPacked)518 ANGLE_INLINE ScopedContextMutexLock GetContextLock_ExportVkImageANGLE(Thread *thread,
519 egl::Display *dpyPacked)
520 {
521 return {};
522 }
523
524 // EGL_ANGLE_wait_until_work_scheduled
525 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_WaitUntilWorkScheduledANGLE(Thread * thread,egl::Display * dpyPacked)526 GetContextLock_WaitUntilWorkScheduledANGLE(Thread *thread, egl::Display *dpyPacked)
527 {
528 return {};
529 }
530
531 // EGL_CHROMIUM_sync_control
GetContextLock_GetSyncValuesCHROMIUM(Thread * thread,egl::Display * dpyPacked)532 ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetSyncValuesCHROMIUM(Thread *thread,
533 egl::Display *dpyPacked)
534 {
535 return {};
536 }
537
538 // EGL_EXT_device_query
GetContextLock_QueryDeviceAttribEXT(Thread * thread,EGLint attribute)539 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryDeviceAttribEXT(Thread *thread,
540 EGLint attribute)
541 {
542 return {};
543 }
544
GetContextLock_QueryDeviceStringEXT(Thread * thread)545 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryDeviceStringEXT(Thread *thread)
546 {
547 return {};
548 }
549
GetContextLock_QueryDisplayAttribEXT(Thread * thread,egl::Display * dpyPacked,EGLint attribute)550 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryDisplayAttribEXT(Thread *thread,
551 egl::Display *dpyPacked,
552 EGLint attribute)
553 {
554 return {};
555 }
556
557 // EGL_EXT_image_dma_buf_import_modifiers
GetContextLock_QueryDmaBufFormatsEXT(Thread * thread,egl::Display * dpyPacked)558 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryDmaBufFormatsEXT(Thread *thread,
559 egl::Display *dpyPacked)
560 {
561 return {};
562 }
563
GetContextLock_QueryDmaBufModifiersEXT(Thread * thread,egl::Display * dpyPacked)564 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryDmaBufModifiersEXT(Thread *thread,
565 egl::Display *dpyPacked)
566 {
567 return {};
568 }
569
570 // EGL_EXT_platform_base
571 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_CreatePlatformPixmapSurfaceEXT(Thread * thread,egl::Display * dpyPacked)572 GetContextLock_CreatePlatformPixmapSurfaceEXT(Thread *thread, egl::Display *dpyPacked)
573 {
574 return {};
575 }
576
577 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_CreatePlatformWindowSurfaceEXT(Thread * thread,egl::Display * dpyPacked)578 GetContextLock_CreatePlatformWindowSurfaceEXT(Thread *thread, egl::Display *dpyPacked)
579 {
580 return {};
581 }
582
GetContextLock_GetPlatformDisplayEXT(Thread * thread)583 ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetPlatformDisplayEXT(Thread *thread)
584 {
585 return {};
586 }
587
588 // EGL_KHR_debug
GetContextLock_DebugMessageControlKHR(Thread * thread)589 ANGLE_INLINE ScopedContextMutexLock GetContextLock_DebugMessageControlKHR(Thread *thread)
590 {
591 return {};
592 }
593
GetContextLock_LabelObjectKHR(Thread * thread,egl::Display * dpyPacked)594 ANGLE_INLINE ScopedContextMutexLock GetContextLock_LabelObjectKHR(Thread *thread,
595 egl::Display *dpyPacked)
596 {
597 return {};
598 }
599
GetContextLock_QueryDebugKHR(Thread * thread,EGLint attribute)600 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryDebugKHR(Thread *thread, EGLint attribute)
601 {
602 return {};
603 }
604
605 // EGL_KHR_fence_sync
GetContextLock_ClientWaitSyncKHR(Thread * thread,egl::Display * dpyPacked,EGLint flags)606 ANGLE_INLINE ScopedContextMutexLock GetContextLock_ClientWaitSyncKHR(Thread *thread,
607 egl::Display *dpyPacked,
608 EGLint flags)
609 {
610 if (priv::ClientWaitSyncHasFlush(flags))
611 {
612 return TryLockCurrentContext(thread);
613 }
614 else
615 {
616 return {};
617 }
618 }
619
GetContextLock_CreateSyncKHR(Thread * thread,egl::Display * dpyPacked)620 ANGLE_INLINE ScopedContextMutexLock GetContextLock_CreateSyncKHR(Thread *thread,
621 egl::Display *dpyPacked)
622 {
623 return TryLockCurrentContext(thread);
624 }
625
GetContextLock_DestroySyncKHR(Thread * thread,egl::Display * dpyPacked)626 ANGLE_INLINE ScopedContextMutexLock GetContextLock_DestroySyncKHR(Thread *thread,
627 egl::Display *dpyPacked)
628 {
629 return {};
630 }
631
GetContextLock_GetSyncAttribKHR(Thread * thread,egl::Display * dpyPacked,EGLint attribute)632 ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetSyncAttribKHR(Thread *thread,
633 egl::Display *dpyPacked,
634 EGLint attribute)
635 {
636 return {};
637 }
638
639 // EGL_KHR_image
GetContextLock_CreateImageKHR(Thread * thread,egl::Display * dpyPacked,gl::ContextID ctxPacked)640 ANGLE_INLINE ScopedContextMutexLock GetContextLock_CreateImageKHR(Thread *thread,
641 egl::Display *dpyPacked,
642 gl::ContextID ctxPacked)
643 {
644 return TryLockContext(dpyPacked, ctxPacked);
645 }
646
GetContextLock_DestroyImageKHR(Thread * thread,egl::Display * dpyPacked)647 ANGLE_INLINE ScopedContextMutexLock GetContextLock_DestroyImageKHR(Thread *thread,
648 egl::Display *dpyPacked)
649 {
650 // Explicit lock in egl::Display::destroyImageImpl()
651 return {};
652 }
653
654 // EGL_KHR_lock_surface3
GetContextLock_LockSurfaceKHR(Thread * thread,egl::Display * dpyPacked)655 ANGLE_INLINE ScopedContextMutexLock GetContextLock_LockSurfaceKHR(Thread *thread,
656 egl::Display *dpyPacked)
657 {
658 return {};
659 }
660
GetContextLock_QuerySurface64KHR(Thread * thread,egl::Display * dpyPacked,EGLint attribute)661 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QuerySurface64KHR(Thread *thread,
662 egl::Display *dpyPacked,
663 EGLint attribute)
664 {
665 return {};
666 }
667
GetContextLock_UnlockSurfaceKHR(Thread * thread,egl::Display * dpyPacked)668 ANGLE_INLINE ScopedContextMutexLock GetContextLock_UnlockSurfaceKHR(Thread *thread,
669 egl::Display *dpyPacked)
670 {
671 return {};
672 }
673
674 // EGL_KHR_partial_update
GetContextLock_SetDamageRegionKHR(Thread * thread,egl::Display * dpyPacked)675 ANGLE_INLINE ScopedContextMutexLock GetContextLock_SetDamageRegionKHR(Thread *thread,
676 egl::Display *dpyPacked)
677 {
678 return {};
679 }
680
681 // EGL_KHR_reusable_sync
GetContextLock_SignalSyncKHR(Thread * thread,egl::Display * dpyPacked)682 ANGLE_INLINE ScopedContextMutexLock GetContextLock_SignalSyncKHR(Thread *thread,
683 egl::Display *dpyPacked)
684 {
685 return TryLockCurrentContext(thread);
686 }
687
688 // EGL_KHR_stream
GetContextLock_CreateStreamKHR(Thread * thread,egl::Display * dpyPacked)689 ANGLE_INLINE ScopedContextMutexLock GetContextLock_CreateStreamKHR(Thread *thread,
690 egl::Display *dpyPacked)
691 {
692 return {};
693 }
694
GetContextLock_DestroyStreamKHR(Thread * thread,egl::Display * dpyPacked)695 ANGLE_INLINE ScopedContextMutexLock GetContextLock_DestroyStreamKHR(Thread *thread,
696 egl::Display *dpyPacked)
697 {
698 return {};
699 }
700
GetContextLock_QueryStreamKHR(Thread * thread,egl::Display * dpyPacked,EGLenum attribute)701 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryStreamKHR(Thread *thread,
702 egl::Display *dpyPacked,
703 EGLenum attribute)
704 {
705 return {};
706 }
707
GetContextLock_QueryStreamu64KHR(Thread * thread,egl::Display * dpyPacked,EGLenum attribute)708 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryStreamu64KHR(Thread *thread,
709 egl::Display *dpyPacked,
710 EGLenum attribute)
711 {
712 return {};
713 }
714
GetContextLock_StreamAttribKHR(Thread * thread,egl::Display * dpyPacked,EGLenum attribute)715 ANGLE_INLINE ScopedContextMutexLock GetContextLock_StreamAttribKHR(Thread *thread,
716 egl::Display *dpyPacked,
717 EGLenum attribute)
718 {
719 return {};
720 }
721
722 // EGL_KHR_stream_consumer_gltexture
GetContextLock_StreamConsumerAcquireKHR(Thread * thread,egl::Display * dpyPacked)723 ANGLE_INLINE ScopedContextMutexLock GetContextLock_StreamConsumerAcquireKHR(Thread *thread,
724 egl::Display *dpyPacked)
725 {
726 return TryLockCurrentContext(thread);
727 }
728
729 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_StreamConsumerGLTextureExternalKHR(Thread * thread,egl::Display * dpyPacked)730 GetContextLock_StreamConsumerGLTextureExternalKHR(Thread *thread, egl::Display *dpyPacked)
731 {
732 return TryLockCurrentContext(thread);
733 }
734
GetContextLock_StreamConsumerReleaseKHR(Thread * thread,egl::Display * dpyPacked)735 ANGLE_INLINE ScopedContextMutexLock GetContextLock_StreamConsumerReleaseKHR(Thread *thread,
736 egl::Display *dpyPacked)
737 {
738 return TryLockCurrentContext(thread);
739 }
740
741 // EGL_KHR_swap_buffers_with_damage
GetContextLock_SwapBuffersWithDamageKHR(Thread * thread,egl::Display * dpyPacked)742 ANGLE_INLINE ScopedContextMutexLock GetContextLock_SwapBuffersWithDamageKHR(Thread *thread,
743 egl::Display *dpyPacked)
744 {
745 return TryLockCurrentContext(thread);
746 }
747
748 // EGL_KHR_wait_sync
GetContextLock_WaitSyncKHR(Thread * thread,egl::Display * dpyPacked,EGLint flags)749 ANGLE_INLINE ScopedContextMutexLock GetContextLock_WaitSyncKHR(Thread *thread,
750 egl::Display *dpyPacked,
751 EGLint flags)
752 {
753 return TryLockCurrentContext(thread);
754 }
755
756 // EGL_NV_post_sub_buffer
GetContextLock_PostSubBufferNV(Thread * thread,egl::Display * dpyPacked)757 ANGLE_INLINE ScopedContextMutexLock GetContextLock_PostSubBufferNV(Thread *thread,
758 egl::Display *dpyPacked)
759 {
760 return TryLockCurrentContext(thread);
761 }
762
763 // EGL_NV_stream_consumer_gltexture_yuv
764 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_StreamConsumerGLTextureExternalAttribsNV(Thread * thread,egl::Display * dpyPacked)765 GetContextLock_StreamConsumerGLTextureExternalAttribsNV(Thread *thread, egl::Display *dpyPacked)
766 {
767 return TryLockCurrentContext(thread);
768 }
769
770 // EGL_ANGLE_no_error
GetContextLock_SetValidationEnabledANGLE(Thread * thread)771 ANGLE_INLINE ScopedContextMutexLock GetContextLock_SetValidationEnabledANGLE(Thread *thread)
772 {
773 return {};
774 }
775
776 } // namespace egl
777
778 #endif // LIBGLESV2_EGL_CONTEXT_LOCK_IMPL_H_
779