Mesa (master): egl: add null platform

Chia-I Wu olv at kemper.freedesktop.org
Tue Sep 20 02:44:50 PDT 2011


Module: Mesa
Branch: master
Commit: 5eca41665bbd6deb5ffff011e47ff0cec41916da
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5eca41665bbd6deb5ffff011e47ff0cec41916da

Author: Chia-I Wu <olv at lunarg.com>
Date:   Tue Sep 20 14:01:26 2011 +0800

egl: add null platform

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     |    6 ++++++
 src/egl/main/egldisplay.c |    1 +
 src/egl/main/egldisplay.h |    1 +
 3 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/egl/main/Makefile b/src/egl/main/Makefile
index 5e5090e..57fb691 100644
--- a/src/egl/main/Makefile
+++ b/src/egl/main/Makefile
@@ -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) \
diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c
index 1d05e57..39ba883 100644
--- a/src/egl/main/egldisplay.c
+++ b/src/egl/main/egldisplay.c
@@ -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" }
 };
 
diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h
index cddea80..67a2e24 100644
--- a/src/egl/main/egldisplay.h
+++ b/src/egl/main/egldisplay.h
@@ -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,



More information about the mesa-commit mailing list