egl: add null platform
authorChia-I Wu <olv@lunarg.com>
Tue, 20 Sep 2011 06:01:26 +0000 (14:01 +0800)
committerChia-I Wu <olv@lunarg.com>
Tue, 20 Sep 2011 09:44:15 +0000 (17:44 +0800)
The null platform has no window or pixmap surface (but pbuffer surface).
And the only valid display is EGL_DEFAULT_DISPLAY.  It is useful for
offscreen rendering.  It works everywhere becase no window system is
required.

src/egl/main/Makefile
src/egl/main/egldisplay.c
src/egl/main/egldisplay.h

index 5e5090e..57fb691 100644 (file)
@@ -94,6 +94,9 @@ endif
 ifeq ($(firstword $(EGL_PLATFORMS)),fbdev)
 EGL_NATIVE_PLATFORM=_EGL_PLATFORM_FBDEV
 endif
+ifeq ($(firstword $(EGL_PLATFORMS)),null)
+EGL_NATIVE_PLATFORM=_EGL_PLATFORM_NULL
+endif
 
 ifneq ($(findstring x11, $(EGL_PLATFORMS)),)
 LOCAL_CFLAGS += -DHAVE_X11_PLATFORM
@@ -107,6 +110,9 @@ endif
 ifneq ($(findstring fbdev, $(EGL_PLATFORMS)),)
 LOCAL_CFLAGS += -DHAVE_FBDEV_PLATFORM
 endif
+ifneq ($(findstring null, $(EGL_PLATFORMS)),)
+LOCAL_CFLAGS += -DHAVE_NULL_PLATFORM
+endif
 
 LOCAL_CFLAGS += \
        -D_EGL_NATIVE_PLATFORM=$(EGL_NATIVE_PLATFORM) \
index 1d05e57..39ba883 100644 (file)
@@ -73,6 +73,7 @@ static const struct {
    { _EGL_PLATFORM_WAYLAND, "wayland" },
    { _EGL_PLATFORM_DRM, "drm" },
    { _EGL_PLATFORM_FBDEV, "fbdev" },
+   { _EGL_PLATFORM_NULL, "null" },
    { _EGL_PLATFORM_ANDROID, "android" }
 };
 
index cddea80..67a2e24 100644 (file)
@@ -44,6 +44,7 @@ enum _egl_platform_type {
    _EGL_PLATFORM_WAYLAND,
    _EGL_PLATFORM_DRM,
    _EGL_PLATFORM_FBDEV,
+   _EGL_PLATFORM_NULL,
    _EGL_PLATFORM_ANDROID,
 
    _EGL_NUM_PLATFORMS,