1 //
2 // Copyright (c) 2002-2014 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
7 // libEGL.cpp: Implements the exported EGL functions.
8
9 #include "libGLESv2/entry_points_egl.h"
10 #include "libGLESv2/entry_points_egl_ext.h"
11
12 extern "C"
13 {
14
eglChooseConfig(EGLDisplay dpy,const EGLint * attrib_list,EGLConfig * configs,EGLint config_size,EGLint * num_config)15 EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config)
16 {
17 return egl::ChooseConfig(dpy, attrib_list, configs, config_size, num_config);
18 }
19
eglCopyBuffers(EGLDisplay dpy,EGLSurface surface,EGLNativePixmapType target)20 EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target)
21 {
22 return egl::CopyBuffers(dpy, surface, target);
23 }
24
eglCreateContext(EGLDisplay dpy,EGLConfig config,EGLContext share_context,const EGLint * attrib_list)25 EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list)
26 {
27 return egl::CreateContext(dpy, config, share_context, attrib_list);
28 }
29
eglCreatePbufferSurface(EGLDisplay dpy,EGLConfig config,const EGLint * attrib_list)30 EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list)
31 {
32 return egl::CreatePbufferSurface(dpy, config, attrib_list);
33 }
34
eglCreatePixmapSurface(EGLDisplay dpy,EGLConfig config,EGLNativePixmapType pixmap,const EGLint * attrib_list)35 EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list)
36 {
37 return egl::CreatePixmapSurface(dpy, config, pixmap, attrib_list);
38 }
39
eglCreateWindowSurface(EGLDisplay dpy,EGLConfig config,EGLNativeWindowType win,const EGLint * attrib_list)40 EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list)
41 {
42 return egl::CreateWindowSurface(dpy, config, win, attrib_list);
43 }
44
eglDestroyContext(EGLDisplay dpy,EGLContext ctx)45 EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx)
46 {
47 return egl::DestroyContext(dpy, ctx);
48 }
49
eglDestroySurface(EGLDisplay dpy,EGLSurface surface)50 EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface)
51 {
52 return egl::DestroySurface(dpy, surface);
53 }
54
eglGetConfigAttrib(EGLDisplay dpy,EGLConfig config,EGLint attribute,EGLint * value)55 EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value)
56 {
57 return egl::GetConfigAttrib(dpy, config, attribute, value);
58 }
59
eglGetConfigs(EGLDisplay dpy,EGLConfig * configs,EGLint config_size,EGLint * num_config)60 EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config)
61 {
62 return egl::GetConfigs(dpy, configs, config_size, num_config);
63 }
64
eglGetCurrentDisplay(void)65 EGLDisplay EGLAPIENTRY eglGetCurrentDisplay(void)
66 {
67 return egl::GetCurrentDisplay();
68 }
69
eglGetCurrentSurface(EGLint readdraw)70 EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw)
71 {
72 return egl::GetCurrentSurface(readdraw);
73 }
74
eglGetDisplay(EGLNativeDisplayType display_id)75 EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id)
76 {
77 return egl::GetDisplay(display_id);
78 }
79
eglGetError(void)80 EGLint EGLAPIENTRY eglGetError(void)
81 {
82 return egl::GetError();
83 }
84
eglInitialize(EGLDisplay dpy,EGLint * major,EGLint * minor)85 EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
86 {
87 return egl::Initialize(dpy, major, minor);
88 }
89
eglMakeCurrent(EGLDisplay dpy,EGLSurface draw,EGLSurface read,EGLContext ctx)90 EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx)
91 {
92 return egl::MakeCurrent(dpy, draw, read, ctx);
93 }
94
eglQueryContext(EGLDisplay dpy,EGLContext ctx,EGLint attribute,EGLint * value)95 EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value)
96 {
97 return egl::QueryContext(dpy, ctx, attribute, value);
98 }
99
eglQueryString(EGLDisplay dpy,EGLint name)100 const char* EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name)
101 {
102 return egl::QueryString(dpy, name);
103 }
104
eglQuerySurface(EGLDisplay dpy,EGLSurface surface,EGLint attribute,EGLint * value)105 EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value)
106 {
107 return egl::QuerySurface(dpy, surface, attribute, value);
108 }
109
eglSwapBuffers(EGLDisplay dpy,EGLSurface surface)110 EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface)
111 {
112 return egl::SwapBuffers(dpy, surface);
113 }
114
eglTerminate(EGLDisplay dpy)115 EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy)
116 {
117 return egl::Terminate(dpy);
118 }
119
eglWaitGL(void)120 EGLBoolean EGLAPIENTRY eglWaitGL(void)
121 {
122 return egl::WaitGL();
123 }
124
eglWaitNative(EGLint engine)125 EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine)
126 {
127 return egl::WaitNative(engine);
128 }
129
eglBindTexImage(EGLDisplay dpy,EGLSurface surface,EGLint buffer)130 EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer)
131 {
132 return egl::BindTexImage(dpy, surface, buffer);
133 }
134
eglReleaseTexImage(EGLDisplay dpy,EGLSurface surface,EGLint buffer)135 EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer)
136 {
137 return egl::ReleaseTexImage(dpy, surface, buffer);
138 }
139
eglSurfaceAttrib(EGLDisplay dpy,EGLSurface surface,EGLint attribute,EGLint value)140 EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value)
141 {
142 return egl::SurfaceAttrib(dpy, surface, attribute, value);
143 }
144
eglSwapInterval(EGLDisplay dpy,EGLint interval)145 EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval)
146 {
147 return egl::SwapInterval(dpy, interval);
148 }
149
eglBindAPI(EGLenum api)150 EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api)
151 {
152 return egl::BindAPI(api);
153 }
154
eglQueryAPI(void)155 EGLenum EGLAPIENTRY eglQueryAPI(void)
156 {
157 return egl::QueryAPI();
158 }
159
eglCreatePbufferFromClientBuffer(EGLDisplay dpy,EGLenum buftype,EGLClientBuffer buffer,EGLConfig config,const EGLint * attrib_list)160 EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list)
161 {
162 return egl::CreatePbufferFromClientBuffer(dpy, buftype, buffer, config, attrib_list);
163 }
164
eglReleaseThread(void)165 EGLBoolean EGLAPIENTRY eglReleaseThread(void)
166 {
167 return egl::ReleaseThread();
168 }
169
eglWaitClient(void)170 EGLBoolean EGLAPIENTRY eglWaitClient(void)
171 {
172 return egl::WaitClient();
173 }
174
eglGetCurrentContext(void)175 EGLContext EGLAPIENTRY eglGetCurrentContext(void)
176 {
177 return egl::GetCurrentContext();
178 }
179
eglCreateSync(EGLDisplay dpy,EGLenum type,const EGLAttrib * attrib_list)180 EGLSync EGLAPIENTRY eglCreateSync(EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list)
181 {
182 return egl::CreateSync(dpy, type, attrib_list);
183 }
184
eglDestroySync(EGLDisplay dpy,EGLSync sync)185 EGLBoolean EGLAPIENTRY eglDestroySync(EGLDisplay dpy, EGLSync sync)
186 {
187 return egl::DestroySync(dpy, sync);
188 }
189
eglClientWaitSync(EGLDisplay dpy,EGLSync sync,EGLint flags,EGLTime timeout)190 EGLint EGLAPIENTRY eglClientWaitSync(EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout)
191 {
192 return egl::ClientWaitSync(dpy, sync, flags, timeout);
193 }
194
eglGetSyncAttrib(EGLDisplay dpy,EGLSync sync,EGLint attribute,EGLAttrib * value)195 EGLBoolean EGLAPIENTRY eglGetSyncAttrib(EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value)
196 {
197 return egl::GetSyncAttrib(dpy, sync, attribute, value);
198 }
199
eglCreateImage(EGLDisplay dpy,EGLContext ctx,EGLenum target,EGLClientBuffer buffer,const EGLAttrib * attrib_list)200 EGLImage EGLAPIENTRY eglCreateImage(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list)
201 {
202 return egl::CreateImage(dpy, ctx, target, buffer, attrib_list);
203 }
204
eglDestroyImage(EGLDisplay dpy,EGLImage image)205 EGLBoolean EGLAPIENTRY eglDestroyImage(EGLDisplay dpy, EGLImage image)
206 {
207 return egl::DestroyImage(dpy, image);
208 }
209
eglGetPlatformDisplay(EGLenum platform,void * native_display,const EGLAttrib * attrib_list)210 EGLDisplay EGLAPIENTRY eglGetPlatformDisplay(EGLenum platform, void *native_display, const EGLAttrib *attrib_list)
211 {
212 return egl::GetPlatformDisplay(platform, native_display, attrib_list);
213 }
214
eglCreatePlatformWindowSurface(EGLDisplay dpy,EGLConfig config,void * native_window,const EGLAttrib * attrib_list)215 EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface(EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list)
216 {
217 return egl::CreatePlatformWindowSurface(dpy, config, native_window, attrib_list);
218 }
219
eglCreatePlatformPixmapSurface(EGLDisplay dpy,EGLConfig config,void * native_pixmap,const EGLAttrib * attrib_list)220 EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurface(EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list)
221 {
222 return egl::CreatePlatformPixmapSurface(dpy, config, native_pixmap, attrib_list);
223 }
224
eglWaitSync(EGLDisplay dpy,EGLSync sync,EGLint flags)225 EGLBoolean EGLAPIENTRY eglWaitSync(EGLDisplay dpy, EGLSync sync, EGLint flags)
226 {
227 return egl::WaitSync(dpy, sync, flags);
228 }
229
eglQuerySurfacePointerANGLE(EGLDisplay dpy,EGLSurface surface,EGLint attribute,void ** value)230 EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE(EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value)
231 {
232 return egl::QuerySurfacePointerANGLE(dpy, surface, attribute, value);
233 }
234
eglPostSubBufferNV(EGLDisplay dpy,EGLSurface surface,EGLint x,EGLint y,EGLint width,EGLint height)235 EGLBoolean EGLAPIENTRY eglPostSubBufferNV(EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height)
236 {
237 return egl::PostSubBufferNV(dpy, surface, x, y, width, height);
238 }
239
eglGetPlatformDisplayEXT(EGLenum platform,void * native_display,const EGLint * attrib_list)240 EGLDisplay EGLAPIENTRY eglGetPlatformDisplayEXT(EGLenum platform, void *native_display, const EGLint *attrib_list)
241 {
242 return egl::GetPlatformDisplayEXT(platform, native_display, attrib_list);
243 }
244
eglQueryDisplayAttribEXT(EGLDisplay dpy,EGLint attribute,EGLAttrib * value)245 EGLBoolean EGLAPIENTRY eglQueryDisplayAttribEXT(EGLDisplay dpy, EGLint attribute, EGLAttrib *value)
246 {
247 return egl::QueryDisplayAttribEXT(dpy, attribute, value);
248 }
249
eglQueryDeviceAttribEXT(EGLDeviceEXT device,EGLint attribute,EGLAttrib * value)250 EGLBoolean EGLAPIENTRY eglQueryDeviceAttribEXT(EGLDeviceEXT device, EGLint attribute, EGLAttrib *value)
251 {
252 return egl::QueryDeviceAttribEXT(device, attribute, value);
253 }
254
eglQueryDeviceStringEXT(EGLDeviceEXT device,EGLint name)255 const char * EGLAPIENTRY eglQueryDeviceStringEXT(EGLDeviceEXT device, EGLint name)
256 {
257 return egl::QueryDeviceStringEXT(device, name);
258 }
259
eglCreateImageKHR(EGLDisplay dpy,EGLContext ctx,EGLenum target,EGLClientBuffer buffer,const EGLint * attrib_list)260 EGLImageKHR EGLAPIENTRY eglCreateImageKHR(EGLDisplay dpy,
261 EGLContext ctx,
262 EGLenum target,
263 EGLClientBuffer buffer,
264 const EGLint *attrib_list)
265 {
266 return egl::CreateImageKHR(dpy, ctx, target, buffer, attrib_list);
267 }
268
eglDestroyImageKHR(EGLDisplay dpy,EGLImageKHR image)269 EGLBoolean EGLAPIENTRY eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR image)
270 {
271 return egl::DestroyImageKHR(dpy, image);
272 }
273
eglCreateDeviceANGLE(EGLint device_type,void * native_device,const EGLAttrib * attrib_list)274 EGLDeviceEXT EGLAPIENTRY eglCreateDeviceANGLE(EGLint device_type,
275 void *native_device,
276 const EGLAttrib *attrib_list)
277 {
278 return egl::CreateDeviceANGLE(device_type, native_device, attrib_list);
279 }
280
eglReleaseDeviceANGLE(EGLDeviceEXT device)281 EGLBoolean EGLAPIENTRY eglReleaseDeviceANGLE(EGLDeviceEXT device)
282 {
283 return egl::ReleaseDeviceANGLE(device);
284 }
285
eglGetProcAddress(const char * procname)286 __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress(const char *procname)
287 {
288 return egl::GetProcAddress(procname);
289 }
290
eglCreateStreamKHR(EGLDisplay dpy,const EGLint * attrib_list)291 EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR(EGLDisplay dpy, const EGLint *attrib_list)
292 {
293 return egl::CreateStreamKHR(dpy, attrib_list);
294 }
295
eglDestroyStreamKHR(EGLDisplay dpy,EGLStreamKHR stream)296 EGLBoolean EGLAPIENTRY eglDestroyStreamKHR(EGLDisplay dpy, EGLStreamKHR stream)
297 {
298 return egl::DestroyStreamKHR(dpy, stream);
299 }
300
eglStreamAttribKHR(EGLDisplay dpy,EGLStreamKHR stream,EGLenum attribute,EGLint value)301 EGLBoolean EGLAPIENTRY eglStreamAttribKHR(EGLDisplay dpy,
302 EGLStreamKHR stream,
303 EGLenum attribute,
304 EGLint value)
305 {
306 return egl::StreamAttribKHR(dpy, stream, attribute, value);
307 }
308
eglQueryStreamKHR(EGLDisplay dpy,EGLStreamKHR stream,EGLenum attribute,EGLint * value)309 EGLBoolean EGLAPIENTRY eglQueryStreamKHR(EGLDisplay dpy,
310 EGLStreamKHR stream,
311 EGLenum attribute,
312 EGLint *value)
313 {
314 return egl::QueryStreamKHR(dpy, stream, attribute, value);
315 }
316
eglQueryStreamu64KHR(EGLDisplay dpy,EGLStreamKHR stream,EGLenum attribute,EGLuint64KHR * value)317 EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR(EGLDisplay dpy,
318 EGLStreamKHR stream,
319 EGLenum attribute,
320 EGLuint64KHR *value)
321 {
322 return egl::QueryStreamu64KHR(dpy, stream, attribute, value);
323 }
324
eglStreamConsumerGLTextureExternalKHR(EGLDisplay dpy,EGLStreamKHR stream)325 EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalKHR(EGLDisplay dpy, EGLStreamKHR stream)
326 {
327 return egl::StreamConsumerGLTextureExternalKHR(dpy, stream);
328 }
329
eglStreamConsumerAcquireKHR(EGLDisplay dpy,EGLStreamKHR stream)330 EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireKHR(EGLDisplay dpy, EGLStreamKHR stream)
331 {
332 return egl::StreamConsumerAcquireKHR(dpy, stream);
333 }
334
eglStreamConsumerReleaseKHR(EGLDisplay dpy,EGLStreamKHR stream)335 EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseKHR(EGLDisplay dpy, EGLStreamKHR stream)
336 {
337 return egl::StreamConsumerReleaseKHR(dpy, stream);
338 }
339
eglStreamConsumerGLTextureExternalAttribsNV(EGLDisplay dpy,EGLStreamKHR stream,EGLAttrib * attrib_list)340 EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalAttribsNV(EGLDisplay dpy,
341 EGLStreamKHR stream,
342 EGLAttrib *attrib_list)
343 {
344 return egl::StreamConsumerGLTextureExternalAttribsNV(dpy, stream, attrib_list);
345 }
346
eglCreateStreamProducerD3DTextureNV12ANGLE(EGLDisplay dpy,EGLStreamKHR stream,const EGLAttrib * attrib_list)347 EGLBoolean EGLAPIENTRY eglCreateStreamProducerD3DTextureNV12ANGLE(EGLDisplay dpy,
348 EGLStreamKHR stream,
349 const EGLAttrib *attrib_list)
350 {
351 return egl::CreateStreamProducerD3DTextureNV12ANGLE(dpy, stream, attrib_list);
352 }
353
eglStreamPostD3DTextureNV12ANGLE(EGLDisplay dpy,EGLStreamKHR stream,void * texture,const EGLAttrib * attrib_list)354 EGLBoolean EGLAPIENTRY eglStreamPostD3DTextureNV12ANGLE(EGLDisplay dpy,
355 EGLStreamKHR stream,
356 void *texture,
357 const EGLAttrib *attrib_list)
358 {
359 return egl::StreamPostD3DTextureNV12ANGLE(dpy, stream, texture, attrib_list);
360 }
361
eglGetSyncValuesCHROMIUM(EGLDisplay dpy,EGLSurface surface,EGLuint64KHR * ust,EGLuint64KHR * msc,EGLuint64KHR * sbc)362 EGLBoolean EGLAPIENTRY eglGetSyncValuesCHROMIUM(EGLDisplay dpy,
363 EGLSurface surface,
364 EGLuint64KHR *ust,
365 EGLuint64KHR *msc,
366 EGLuint64KHR *sbc)
367 {
368 return egl::GetSyncValuesCHROMIUM(dpy, surface, ust, msc, sbc);
369 }
370
eglSwapBuffersWithDamageEXT(EGLDisplay dpy,EGLSurface surface,EGLint * rects,EGLint n_rects)371 EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageEXT(EGLDisplay dpy,
372 EGLSurface surface,
373 EGLint *rects,
374 EGLint n_rects)
375 {
376 return egl::SwapBuffersWithDamageEXT(dpy, surface, rects, n_rects);
377 }
378
eglProgramCacheGetAttribANGLE(EGLDisplay dpy,EGLenum attrib)379 EGLint EGLAPIENTRY eglProgramCacheGetAttribANGLE(EGLDisplay dpy, EGLenum attrib)
380 {
381 return egl::ProgramCacheGetAttribANGLE(dpy, attrib);
382 }
383
eglProgramCacheQueryANGLE(EGLDisplay dpy,EGLint index,void * key,EGLint * keysize,void * binary,EGLint * binarysize)384 void EGLAPIENTRY eglProgramCacheQueryANGLE(EGLDisplay dpy,
385 EGLint index,
386 void *key,
387 EGLint *keysize,
388 void *binary,
389 EGLint *binarysize)
390 {
391 egl::ProgramCacheQueryANGLE(dpy, index, key, keysize, binary, binarysize);
392 }
393
eglProgramCachePopulateANGLE(EGLDisplay dpy,const void * key,EGLint keysize,const void * binary,EGLint binarysize)394 void EGLAPIENTRY eglProgramCachePopulateANGLE(EGLDisplay dpy,
395 const void *key,
396 EGLint keysize,
397 const void *binary,
398 EGLint binarysize)
399 {
400 egl::ProgramCachePopulateANGLE(dpy, key, keysize, binary, binarysize);
401 }
402
eglProgramCacheResizeANGLE(EGLDisplay dpy,EGLint limit,EGLenum mode)403 EGLint EGLAPIENTRY eglProgramCacheResizeANGLE(EGLDisplay dpy, EGLint limit, EGLenum mode)
404 {
405 return egl::ProgramCacheResizeANGLE(dpy, limit, mode);
406 }
407
408 } // extern "C"
409