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_device_vulkan
GetContextLock_LockVulkanQueueANGLE(Thread * thread,egl::Display * dpyPacked)389 ANGLE_INLINE ScopedContextMutexLock GetContextLock_LockVulkanQueueANGLE(Thread *thread,
390 egl::Display *dpyPacked)
391 {
392 return {};
393 }
394
GetContextLock_UnlockVulkanQueueANGLE(Thread * thread,egl::Display * dpyPacked)395 ANGLE_INLINE ScopedContextMutexLock GetContextLock_UnlockVulkanQueueANGLE(Thread *thread,
396 egl::Display *dpyPacked)
397 {
398 return {};
399 }
400
401 // EGL_ANGLE_external_context_and_surface
402 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_AcquireExternalContextANGLE(Thread * thread,egl::Display * dpyPacked)403 GetContextLock_AcquireExternalContextANGLE(Thread *thread, egl::Display *dpyPacked)
404 {
405 return TryLockCurrentContext(thread);
406 }
407
408 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_ReleaseExternalContextANGLE(Thread * thread,egl::Display * dpyPacked)409 GetContextLock_ReleaseExternalContextANGLE(Thread *thread, egl::Display *dpyPacked)
410 {
411 return TryLockCurrentContext(thread);
412 }
413
414 // EGL_ANGLE_feature_control
GetContextLock_QueryStringiANGLE(Thread * thread,egl::Display * dpyPacked)415 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryStringiANGLE(Thread *thread,
416 egl::Display *dpyPacked)
417 {
418 return {};
419 }
420
GetContextLock_QueryDisplayAttribANGLE(Thread * thread,egl::Display * dpyPacked,EGLint attribute)421 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryDisplayAttribANGLE(Thread *thread,
422 egl::Display *dpyPacked,
423 EGLint attribute)
424 {
425 return {};
426 }
427
428 // EGL_ANGLE_metal_shared_event_sync
429 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_CopyMetalSharedEventANGLE(Thread * thread,egl::Display * dpyPacked)430 GetContextLock_CopyMetalSharedEventANGLE(Thread *thread, egl::Display *dpyPacked)
431 {
432 return {};
433 }
434
435 // EGL_ANGLE_power_preference
GetContextLock_ReleaseHighPowerGPUANGLE(Thread * thread,egl::Display * dpyPacked,gl::ContextID ctxPacked)436 ANGLE_INLINE ScopedContextMutexLock GetContextLock_ReleaseHighPowerGPUANGLE(Thread *thread,
437 egl::Display *dpyPacked,
438 gl::ContextID ctxPacked)
439 {
440 return TryLockContext(dpyPacked, ctxPacked);
441 }
442
443 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_ReacquireHighPowerGPUANGLE(Thread * thread,egl::Display * dpyPacked,gl::ContextID ctxPacked)444 GetContextLock_ReacquireHighPowerGPUANGLE(Thread *thread,
445 egl::Display *dpyPacked,
446 gl::ContextID ctxPacked)
447 {
448 return TryLockContext(dpyPacked, ctxPacked);
449 }
450
GetContextLock_HandleGPUSwitchANGLE(Thread * thread,egl::Display * dpyPacked)451 ANGLE_INLINE ScopedContextMutexLock GetContextLock_HandleGPUSwitchANGLE(Thread *thread,
452 egl::Display *dpyPacked)
453 {
454 return {};
455 }
456
GetContextLock_ForceGPUSwitchANGLE(Thread * thread,egl::Display * dpyPacked)457 ANGLE_INLINE ScopedContextMutexLock GetContextLock_ForceGPUSwitchANGLE(Thread *thread,
458 egl::Display *dpyPacked)
459 {
460 return {};
461 }
462
463 // EGL_ANGLE_prepare_swap_buffers
GetContextLock_PrepareSwapBuffersANGLE(Thread * thread,egl::Display * dpyPacked)464 ANGLE_INLINE ScopedContextMutexLock GetContextLock_PrepareSwapBuffersANGLE(Thread *thread,
465 egl::Display *dpyPacked)
466 {
467 return TryLockCurrentContext(thread);
468 }
469
470 // EGL_ANGLE_program_cache_control
471 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_ProgramCacheGetAttribANGLE(Thread * thread,egl::Display * dpyPacked)472 GetContextLock_ProgramCacheGetAttribANGLE(Thread *thread, egl::Display *dpyPacked)
473 {
474 return {};
475 }
476
GetContextLock_ProgramCacheQueryANGLE(Thread * thread,egl::Display * dpyPacked)477 ANGLE_INLINE ScopedContextMutexLock GetContextLock_ProgramCacheQueryANGLE(Thread *thread,
478 egl::Display *dpyPacked)
479 {
480 return {};
481 }
482
483 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_ProgramCachePopulateANGLE(Thread * thread,egl::Display * dpyPacked)484 GetContextLock_ProgramCachePopulateANGLE(Thread *thread, egl::Display *dpyPacked)
485 {
486 return {};
487 }
488
GetContextLock_ProgramCacheResizeANGLE(Thread * thread,egl::Display * dpyPacked)489 ANGLE_INLINE ScopedContextMutexLock GetContextLock_ProgramCacheResizeANGLE(Thread *thread,
490 egl::Display *dpyPacked)
491 {
492 return {};
493 }
494
495 // EGL_ANGLE_query_surface_pointer
GetContextLock_QuerySurfacePointerANGLE(Thread * thread,egl::Display * dpyPacked,EGLint attribute)496 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QuerySurfacePointerANGLE(Thread *thread,
497 egl::Display *dpyPacked,
498 EGLint attribute)
499 {
500 return {};
501 }
502
503 // EGL_ANGLE_stream_producer_d3d_texture
504 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_CreateStreamProducerD3DTextureANGLE(Thread * thread,egl::Display * dpyPacked)505 GetContextLock_CreateStreamProducerD3DTextureANGLE(Thread *thread, egl::Display *dpyPacked)
506 {
507 return {};
508 }
509
510 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_StreamPostD3DTextureANGLE(Thread * thread,egl::Display * dpyPacked)511 GetContextLock_StreamPostD3DTextureANGLE(Thread *thread, egl::Display *dpyPacked)
512 {
513 return {};
514 }
515
516 // EGL_ANGLE_sync_control_rate
GetContextLock_GetMscRateANGLE(Thread * thread,egl::Display * dpyPacked)517 ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetMscRateANGLE(Thread *thread,
518 egl::Display *dpyPacked)
519 {
520 return {};
521 }
522
523 // EGL_ANGLE_vulkan_image
GetContextLock_ExportVkImageANGLE(Thread * thread,egl::Display * dpyPacked)524 ANGLE_INLINE ScopedContextMutexLock GetContextLock_ExportVkImageANGLE(Thread *thread,
525 egl::Display *dpyPacked)
526 {
527 return {};
528 }
529
530 // EGL_ANGLE_wait_until_work_scheduled
531 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_WaitUntilWorkScheduledANGLE(Thread * thread,egl::Display * dpyPacked)532 GetContextLock_WaitUntilWorkScheduledANGLE(Thread *thread, egl::Display *dpyPacked)
533 {
534 return {};
535 }
536
537 // EGL_CHROMIUM_sync_control
GetContextLock_GetSyncValuesCHROMIUM(Thread * thread,egl::Display * dpyPacked)538 ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetSyncValuesCHROMIUM(Thread *thread,
539 egl::Display *dpyPacked)
540 {
541 return {};
542 }
543
544 // EGL_EXT_device_query
GetContextLock_QueryDeviceAttribEXT(Thread * thread,EGLint attribute)545 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryDeviceAttribEXT(Thread *thread,
546 EGLint attribute)
547 {
548 return {};
549 }
550
GetContextLock_QueryDeviceStringEXT(Thread * thread)551 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryDeviceStringEXT(Thread *thread)
552 {
553 return {};
554 }
555
GetContextLock_QueryDisplayAttribEXT(Thread * thread,egl::Display * dpyPacked,EGLint attribute)556 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryDisplayAttribEXT(Thread *thread,
557 egl::Display *dpyPacked,
558 EGLint attribute)
559 {
560 return {};
561 }
562
563 // EGL_EXT_image_dma_buf_import_modifiers
GetContextLock_QueryDmaBufFormatsEXT(Thread * thread,egl::Display * dpyPacked)564 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryDmaBufFormatsEXT(Thread *thread,
565 egl::Display *dpyPacked)
566 {
567 return {};
568 }
569
GetContextLock_QueryDmaBufModifiersEXT(Thread * thread,egl::Display * dpyPacked)570 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryDmaBufModifiersEXT(Thread *thread,
571 egl::Display *dpyPacked)
572 {
573 return {};
574 }
575
576 // EGL_EXT_platform_base
577 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_CreatePlatformPixmapSurfaceEXT(Thread * thread,egl::Display * dpyPacked)578 GetContextLock_CreatePlatformPixmapSurfaceEXT(Thread *thread, egl::Display *dpyPacked)
579 {
580 return {};
581 }
582
583 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_CreatePlatformWindowSurfaceEXT(Thread * thread,egl::Display * dpyPacked)584 GetContextLock_CreatePlatformWindowSurfaceEXT(Thread *thread, egl::Display *dpyPacked)
585 {
586 return {};
587 }
588
GetContextLock_GetPlatformDisplayEXT(Thread * thread)589 ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetPlatformDisplayEXT(Thread *thread)
590 {
591 return {};
592 }
593
594 // EGL_EXT_surface_compression
595 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_QuerySupportedCompressionRatesEXT(Thread * thread,egl::Display * dpyPacked)596 GetContextLock_QuerySupportedCompressionRatesEXT(Thread *thread, egl::Display *dpyPacked)
597 {
598 return {};
599 }
600
601 // EGL_KHR_debug
GetContextLock_DebugMessageControlKHR(Thread * thread)602 ANGLE_INLINE ScopedContextMutexLock GetContextLock_DebugMessageControlKHR(Thread *thread)
603 {
604 return {};
605 }
606
GetContextLock_LabelObjectKHR(Thread * thread,egl::Display * dpyPacked)607 ANGLE_INLINE ScopedContextMutexLock GetContextLock_LabelObjectKHR(Thread *thread,
608 egl::Display *dpyPacked)
609 {
610 return {};
611 }
612
GetContextLock_QueryDebugKHR(Thread * thread,EGLint attribute)613 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryDebugKHR(Thread *thread, EGLint attribute)
614 {
615 return {};
616 }
617
618 // EGL_KHR_fence_sync
GetContextLock_ClientWaitSyncKHR(Thread * thread,egl::Display * dpyPacked,EGLint flags)619 ANGLE_INLINE ScopedContextMutexLock GetContextLock_ClientWaitSyncKHR(Thread *thread,
620 egl::Display *dpyPacked,
621 EGLint flags)
622 {
623 if (priv::ClientWaitSyncHasFlush(flags))
624 {
625 return TryLockCurrentContext(thread);
626 }
627 else
628 {
629 return {};
630 }
631 }
632
GetContextLock_CreateSyncKHR(Thread * thread,egl::Display * dpyPacked)633 ANGLE_INLINE ScopedContextMutexLock GetContextLock_CreateSyncKHR(Thread *thread,
634 egl::Display *dpyPacked)
635 {
636 return TryLockCurrentContext(thread);
637 }
638
GetContextLock_DestroySyncKHR(Thread * thread,egl::Display * dpyPacked)639 ANGLE_INLINE ScopedContextMutexLock GetContextLock_DestroySyncKHR(Thread *thread,
640 egl::Display *dpyPacked)
641 {
642 return {};
643 }
644
GetContextLock_GetSyncAttribKHR(Thread * thread,egl::Display * dpyPacked,EGLint attribute)645 ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetSyncAttribKHR(Thread *thread,
646 egl::Display *dpyPacked,
647 EGLint attribute)
648 {
649 return {};
650 }
651
652 // EGL_KHR_image
GetContextLock_CreateImageKHR(Thread * thread,egl::Display * dpyPacked,gl::ContextID ctxPacked)653 ANGLE_INLINE ScopedContextMutexLock GetContextLock_CreateImageKHR(Thread *thread,
654 egl::Display *dpyPacked,
655 gl::ContextID ctxPacked)
656 {
657 return TryLockContext(dpyPacked, ctxPacked);
658 }
659
GetContextLock_DestroyImageKHR(Thread * thread,egl::Display * dpyPacked)660 ANGLE_INLINE ScopedContextMutexLock GetContextLock_DestroyImageKHR(Thread *thread,
661 egl::Display *dpyPacked)
662 {
663 // Explicit lock in egl::Display::destroyImageImpl()
664 return {};
665 }
666
667 // EGL_KHR_lock_surface3
GetContextLock_LockSurfaceKHR(Thread * thread,egl::Display * dpyPacked)668 ANGLE_INLINE ScopedContextMutexLock GetContextLock_LockSurfaceKHR(Thread *thread,
669 egl::Display *dpyPacked)
670 {
671 return {};
672 }
673
GetContextLock_QuerySurface64KHR(Thread * thread,egl::Display * dpyPacked,EGLint attribute)674 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QuerySurface64KHR(Thread *thread,
675 egl::Display *dpyPacked,
676 EGLint attribute)
677 {
678 return {};
679 }
680
GetContextLock_UnlockSurfaceKHR(Thread * thread,egl::Display * dpyPacked)681 ANGLE_INLINE ScopedContextMutexLock GetContextLock_UnlockSurfaceKHR(Thread *thread,
682 egl::Display *dpyPacked)
683 {
684 return {};
685 }
686
687 // EGL_KHR_partial_update
GetContextLock_SetDamageRegionKHR(Thread * thread,egl::Display * dpyPacked)688 ANGLE_INLINE ScopedContextMutexLock GetContextLock_SetDamageRegionKHR(Thread *thread,
689 egl::Display *dpyPacked)
690 {
691 return {};
692 }
693
694 // EGL_KHR_reusable_sync
GetContextLock_SignalSyncKHR(Thread * thread,egl::Display * dpyPacked)695 ANGLE_INLINE ScopedContextMutexLock GetContextLock_SignalSyncKHR(Thread *thread,
696 egl::Display *dpyPacked)
697 {
698 return TryLockCurrentContext(thread);
699 }
700
701 // EGL_KHR_stream
GetContextLock_CreateStreamKHR(Thread * thread,egl::Display * dpyPacked)702 ANGLE_INLINE ScopedContextMutexLock GetContextLock_CreateStreamKHR(Thread *thread,
703 egl::Display *dpyPacked)
704 {
705 return {};
706 }
707
GetContextLock_DestroyStreamKHR(Thread * thread,egl::Display * dpyPacked)708 ANGLE_INLINE ScopedContextMutexLock GetContextLock_DestroyStreamKHR(Thread *thread,
709 egl::Display *dpyPacked)
710 {
711 return {};
712 }
713
GetContextLock_QueryStreamKHR(Thread * thread,egl::Display * dpyPacked,EGLenum attribute)714 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryStreamKHR(Thread *thread,
715 egl::Display *dpyPacked,
716 EGLenum attribute)
717 {
718 return {};
719 }
720
GetContextLock_QueryStreamu64KHR(Thread * thread,egl::Display * dpyPacked,EGLenum attribute)721 ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryStreamu64KHR(Thread *thread,
722 egl::Display *dpyPacked,
723 EGLenum attribute)
724 {
725 return {};
726 }
727
GetContextLock_StreamAttribKHR(Thread * thread,egl::Display * dpyPacked,EGLenum attribute)728 ANGLE_INLINE ScopedContextMutexLock GetContextLock_StreamAttribKHR(Thread *thread,
729 egl::Display *dpyPacked,
730 EGLenum attribute)
731 {
732 return {};
733 }
734
735 // EGL_KHR_stream_consumer_gltexture
GetContextLock_StreamConsumerAcquireKHR(Thread * thread,egl::Display * dpyPacked)736 ANGLE_INLINE ScopedContextMutexLock GetContextLock_StreamConsumerAcquireKHR(Thread *thread,
737 egl::Display *dpyPacked)
738 {
739 return TryLockCurrentContext(thread);
740 }
741
742 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_StreamConsumerGLTextureExternalKHR(Thread * thread,egl::Display * dpyPacked)743 GetContextLock_StreamConsumerGLTextureExternalKHR(Thread *thread, egl::Display *dpyPacked)
744 {
745 return TryLockCurrentContext(thread);
746 }
747
GetContextLock_StreamConsumerReleaseKHR(Thread * thread,egl::Display * dpyPacked)748 ANGLE_INLINE ScopedContextMutexLock GetContextLock_StreamConsumerReleaseKHR(Thread *thread,
749 egl::Display *dpyPacked)
750 {
751 return TryLockCurrentContext(thread);
752 }
753
754 // EGL_KHR_swap_buffers_with_damage
GetContextLock_SwapBuffersWithDamageKHR(Thread * thread,egl::Display * dpyPacked)755 ANGLE_INLINE ScopedContextMutexLock GetContextLock_SwapBuffersWithDamageKHR(Thread *thread,
756 egl::Display *dpyPacked)
757 {
758 return TryLockCurrentContext(thread);
759 }
760
761 // EGL_KHR_wait_sync
GetContextLock_WaitSyncKHR(Thread * thread,egl::Display * dpyPacked,EGLint flags)762 ANGLE_INLINE ScopedContextMutexLock GetContextLock_WaitSyncKHR(Thread *thread,
763 egl::Display *dpyPacked,
764 EGLint flags)
765 {
766 return TryLockCurrentContext(thread);
767 }
768
769 // EGL_NV_post_sub_buffer
GetContextLock_PostSubBufferNV(Thread * thread,egl::Display * dpyPacked)770 ANGLE_INLINE ScopedContextMutexLock GetContextLock_PostSubBufferNV(Thread *thread,
771 egl::Display *dpyPacked)
772 {
773 return TryLockCurrentContext(thread);
774 }
775
776 // EGL_NV_stream_consumer_gltexture_yuv
777 ANGLE_INLINE ScopedContextMutexLock
GetContextLock_StreamConsumerGLTextureExternalAttribsNV(Thread * thread,egl::Display * dpyPacked)778 GetContextLock_StreamConsumerGLTextureExternalAttribsNV(Thread *thread, egl::Display *dpyPacked)
779 {
780 return TryLockCurrentContext(thread);
781 }
782
783 // EGL_ANGLE_no_error
GetContextLock_SetValidationEnabledANGLE(Thread * thread)784 ANGLE_INLINE ScopedContextMutexLock GetContextLock_SetValidationEnabledANGLE(Thread *thread)
785 {
786 return {};
787 }
788
789 } // namespace egl
790
791 #endif // LIBGLESV2_EGL_CONTEXT_LOCK_IMPL_H_
792