From 5eca41665bbd6deb5ffff011e47ff0cec41916da Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 20 Sep 2011 14:01:26 +0800 Subject: [PATCH] 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(+) diff --git a/src/egl/main/Makefile b/src/egl/main/Makefile index 5e5090ebc04..57fb691ea9d 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 1d05e57c429..39ba8830cda 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 cddea803c24..67a2e244e20 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, -- 2.30.2