mesa/src/egl/main
Adam Jackson a279760536 egl: Document why EGL_OPENGL{, _ES}_API are mostly identical
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
2016-09-08 13:19:58 -04:00
..
README.txt egl/main: Update README.txt 2015-05-14 21:00:04 +00:00
egl.def
egl.pc.in
eglapi.c EGL: Combine the GL and GLES current contexts (v2) 2016-09-07 11:56:48 -04:00
eglapi.h mesa_glinterop: remove mesa_glinterop typedefs 2016-05-30 17:53:44 +01:00
eglarray.c egl: don't allow eglGetConfigs to set num_configs param to a negative value 2015-08-13 17:36:06 +01:00
eglarray.h egl: Add needed extern "C" for C++ access 2015-05-14 14:08:37 -04:00
eglcompiler.h egl: Add needed extern "C" for C++ access 2015-05-14 14:08:37 -04:00
eglconfig.c egl: turn a couple asserts static (compile-time) 2016-08-24 11:30:15 +01:00
eglconfig.h egl: Add EGL_RECORDABLE_ANDROID attribute 2016-04-01 13:45:08 +01:00
eglcontext.c egl: Document why EGL_OPENGL{, _ES}_API are mostly identical 2016-09-08 13:19:58 -04:00
eglcontext.h egl: Add needed extern "C" for C++ access 2015-05-14 14:08:37 -04:00
eglcurrent.c EGL: Combine the GL and GLES current contexts (v2) 2016-09-07 11:56:48 -04:00
eglcurrent.h EGL: Combine the GL and GLES current contexts (v2) 2016-09-07 11:56:48 -04:00
egldefines.h egl: support EGL_LARGEST_PBUFFER in eglCreatePbufferSurface(...) 2016-03-18 07:35:32 +02:00
egldisplay.c egl/display: remove unnecessary code and make it easier to read 2016-07-07 11:13:13 -07:00
egldisplay.h Revert "egl: Check if API is supported when using eglBindAPI." 2016-06-03 11:33:45 +02:00
egldriver.c egl: remove final Windows specific workaround 2015-07-22 16:35:26 +01:00
egldriver.h egl/main: cleanup function prototypes 2015-05-14 21:00:04 +00:00
eglfallbacks.c egl: clean up typedef madness in the backend API 2016-03-10 18:03:14 +01:00
eglglobals.c egl: sort extension lists alphabetically 2015-07-03 16:23:28 +02:00
eglglobals.h egl: remove unused _egl_global::ClientExtensions 2015-06-05 19:44:33 +02:00
eglimage.c egl: definitions for EXT_image_dma_buf_import 2013-08-02 08:56:03 +03:00
eglimage.h egl: use EGL 1.5 types without suffixes 2015-06-05 19:44:33 +02:00
egllog.c egl: remove custom string functions 2015-07-22 16:35:26 +01:00
egllog.h egl: Add needed extern "C" for C++ access 2015-05-14 14:08:37 -04:00
eglsurface.c egl: Fix the bad surface attributes combination checking for pbuffers. (v3) 2016-07-07 11:28:55 -07:00
eglsurface.h egl: implement EGL_KHR_gl_colorspace (v2) 2015-07-22 23:56:00 +02:00
eglsync.c egl: add EGL_KHR_reusable_sync to egl_dri 2016-04-05 15:24:57 +02:00
eglsync.h egl: add eglGetSyncAttrib (v2) 2015-06-05 19:44:33 +02:00
egltypedefs.h egl/main: expose only core EGL functions statically 2015-05-14 21:00:05 +00:00

README.txt


Notes about the EGL library:


The EGL code here basically consists of two things:

1. An EGL API dispatcher.  This directly routes all the eglFooBar() API
   calls into driver-specific functions.

2. Fallbacks for EGL API functions.  A driver _could_ implement all the
   EGL API calls from scratch.  But in many cases, the fallbacks provided
   in libEGL (such as eglChooseConfig()) will do the job.



Bootstrapping:

When the apps calls eglInitialize() a device driver is selected and loaded
(look for _eglAddDrivers() and _eglLoadModule() in egldriver.c).

The built-in driver's entry point function is then called.  This driver function
allocates, initializes and returns a new _EGLDriver object (usually a
subclass of that type).

As part of initialization, the dispatch table in _EGLDriver->API must be
populated with all the EGL entrypoints.  Typically, _eglInitDriverFallbacks()
can be used to plug in default/fallback functions.  Some functions like
driver->API.Initialize and driver->API.Terminate _must_ be implemented
with driver-specific code (no default/fallback function is possible).


Shortly after, the driver->API.Initialize() function is executed.  Any additional
driver initialization that wasn't done in the driver entry point should be
done at this point.  Typically, this will involve setting up visual configs, etc.



Special Functions:

Certain EGL functions _must_ be implemented by the driver.  This includes:

eglCreateContext
eglCreateWindowSurface
eglCreatePixmapSurface
eglCreatePBufferSurface
eglMakeCurrent
eglSwapBuffers

Most of the EGLConfig-related functions can be implemented with the
defaults/fallbacks.  Same thing for the eglGet/Query functions.




Teardown:

When eglTerminate() is called, the driver->API.Terminate() function is
called.  The driver should clean up after itself.  eglTerminate() will
then close/unload the driver (shared library).




Subclassing:

The internal libEGL data structures such as _EGLDisplay, _EGLContext,
_EGLSurface, etc should be considered base classes from which drivers
will derive subclasses.