EGL Reference Implementation Component

The EGL Reference Implementation component implements the minimum EGL functionality to support OpenWF composition. It does not implement the EGL functionality required to support the use of the Khronos rendering APIs, such as OpenGL ES and OpenVG. Typically device creators replace the reference implementation with a fully functional implementation of their own.

Target audience: Device creators.

Implemented APIs

The EGL Reference Implementation implements the following EGL 1.4 APIs:

  • eglGetError()
  • eglGetDisplay()
  • eglInitialize()
  • eglTerminate()
  • eglReleaseThread()
  • eglQueryString()
  • eglGetProcAddress()

The EGL Reference Implementation also implements the following reusable sync extension functions:

  • eglCreateSyncKHR()
  • eglDestroySyncKHR()
  • eglClientWaitSyncKHR()
  • eglSignalSyncKHR()
  • eglGetSyncAttribKHR()

The Reference Implementation implements eglGetProcAddress() , which supports retrieving OpenWF-C extension functions.

Calling any of the unsupported APIs panics the client with the EEglPanicNotSupported panic code and the return value and EGL error code are undefined. This behavior deliberately does not conform to the EGL specification. It is intended to make it easy to detect errors in the platform configuration—for example, where the intention was to use a fully-functional EGL implementation instead of the Reference Implementation.

Implementation-specific information

The Reference Implementation returns the following implementation-specific strings:

String Value
EGL_CLIENT_APIS “”
EGL_EXTENSIONS “EGL_KHR_reusable_sync”
EGL_VENDOR “Nokia”
EGL_VERSION “1.4 Reference EGL”

Thread handling

The Reference Implementation allows the supported EGL APIs to be used from multiple threads within the same process. The Reference Implementation maintains the process and thread state in order to conform to the correct behavior described in the EGL specification. Access to process-wide objects is serialized and protected by mutex to prevent race conditions.

The Reference Implementation uses its own heap to allow the creation, access and destruction of process-wide objects from any thread. This includes the EGLDisplay and EGLSync objects. The heap is created in a local chunk.

For simplicity, the Reference Implementation supports only one display: EGL_DEFAULT_DISPLAY. A request to obtain any other EGLDisplay returns EGL_NO_DISPLAY. EGLDisplay is a process-wide resource that can be accessed from any thread. Its behavior follows the EGL specification for eglGetDisplay(), eglInitialize() and eglTerminate().

Each client thread can have its own EGL error. Error handling and thread state management follows the EGL specification for eglGetError() and eglReleaseThread().

DLL summary

DLL Description
libegl_ref.dll The EGL reference implementation.
libEGL.dll In the emulator, this provides a mechanism that switches among different EGL implementation DLLs used in different scenarios, including the Reference Implementation mentioned above. For ARM builds, the file above is renamed to this during the ROM build process. This is controlled by IBY files.

To allow different EGL implementations to be used on a platform, the Reference Implementation is built with a target name of libegl_ref.dll. However, EGL Clients should link their code against libEGL.lib.

Enabling the EGL Reference Implementation

Emulator

To enable the ScreenPlay OpenWF-C components and the EGL Reference Implementation in the emulator, add the following lines to the \epoc32\data\epoc.ini file:

SYMBIAN_GRAPHICS_USE_OPENWF
SYMBIAN_GRAPHICS_USE_EGL_REF

Related concepts