diff options
author | Chad Versace <chad.versace@intel.com> | 2015-04-22 17:24:46 -0700 |
---|---|---|
committer | Chad Versace <chad.versace@intel.com> | 2015-04-22 17:24:46 -0700 |
commit | 0458ee9795f1803add3482d8ff668ed96d92f8c3 (patch) | |
tree | dd35c45f0622ebf2176405c017e3d26635c46128 | |
parent | 44f584a1fe9fdf4fa50c12903a66472638c061c5 (diff) | |
parent | d124ba68b4966821732c7afcefb0d59e88982f5d (diff) | |
download | waffle-0458ee9795f1803add3482d8ff668ed96d92f8c3.tar.gz |
Merge branch 'master' into next
* master:
android: Don't specify -std=gnu99 for C++ builds -- it breaks clang
waffle: add full screen window request
gl_basic: request alpha planes
-rw-r--r-- | Android.mk | 9 | ||||
-rw-r--r-- | include/waffle/waffle.h | 1 | ||||
-rw-r--r-- | man/waffle_enum.3.xml | 1 | ||||
-rw-r--r-- | man/waffle_window.3.xml | 10 | ||||
-rw-r--r-- | src/waffle/android/droid_window.c | 6 | ||||
-rw-r--r-- | src/waffle/api/waffle_window.c | 27 | ||||
-rw-r--r-- | src/waffle/cgl/cgl_window.m | 6 | ||||
-rw-r--r-- | src/waffle/core/wcore_util.c | 1 | ||||
-rw-r--r-- | src/waffle/gbm/wgbm_window.c | 6 | ||||
-rw-r--r-- | src/waffle/glx/glx_window.c | 5 | ||||
-rw-r--r-- | src/waffle/nacl/nacl_window.c | 6 | ||||
-rw-r--r-- | src/waffle/wayland/wayland_window.c | 6 | ||||
-rw-r--r-- | src/waffle/wgl/wgl_window.c | 6 | ||||
-rw-r--r-- | src/waffle/xegl/xegl_window.c | 5 |
14 files changed, 87 insertions, 8 deletions
@@ -13,6 +13,7 @@ waffle_api_version := 0x0106 waffle_android_major_version := $(word 1, $(subst ., , $(PLATFORM_VERSION))) waffle_android_minor_version := $(word 2, $(subst ., , $(PLATFORM_VERSION))) +waffle_android_version := $(waffle_android_major_version).$(waffle_android_minor_version) $(waffle_top)/include/waffle/waffle_version.h: \ $(waffle_top)/Android.mk \ @@ -36,7 +37,13 @@ LOCAL_CFLAGS := \ -DWAFFLE_ANDROID_MINOR_VERSION=$(waffle_android_minor_version) \ -Wno-pointer-arith -LOCAL_CFLAGS += -std=c99 -fvisibility=hidden +ifeq ($(shell echo "$(waffle_android_version) >= 4.4" | bc),1) +LOCAL_CONLYFLAGS := -std=c99 +else +LOCAL_CFLAGS += -std=c99 +endif + +LOCAL_CFLAGS += -fvisibility=hidden LOCAL_C_INCLUDES := \ $(LOCAL_PATH)/include \ diff --git a/include/waffle/waffle.h b/include/waffle/waffle.h index 297a487..df0218e 100644 --- a/include/waffle/waffle.h +++ b/include/waffle/waffle.h @@ -172,6 +172,7 @@ enum waffle_enum { WAFFLE_WINDOW_WIDTH = 0x0310, WAFFLE_WINDOW_HEIGHT = 0x0311, + WAFFLE_WINDOW_FULLSCREEN = 0x0312, }; const char* diff --git a/man/waffle_enum.3.xml b/man/waffle_enum.3.xml index 4874fe7..cff1ee6 100644 --- a/man/waffle_enum.3.xml +++ b/man/waffle_enum.3.xml @@ -149,6 +149,7 @@ enum waffle_enum { WAFFLE_WINDOW_WIDTH = 0x0310, WAFFLE_WINDOW_HEIGHT = 0x0311, + WAFFLE_WINDOW_FULLSCREEN = 0x0312, }; ]]> </programlisting> diff --git a/man/waffle_window.3.xml b/man/waffle_window.3.xml index 795152a..96fe08b 100644 --- a/man/waffle_window.3.xml +++ b/man/waffle_window.3.xml @@ -121,11 +121,13 @@ struct waffle_window; <parameter>config</parameter> and <parameter>attrib_list</parameter>. - <parameter>attrib_list</parameter> must contain the attributes + <parameter>attrib_list</parameter> must specify the window size + either with the attributes <constant>WAFFLE_WINDOW_WIDTH</constant> and - <constant>WAFFLE_WINDOW_HEIGHT</constant>, - whose values must be positive - and no greater than <constant>INT32_MAX</constant>. + <constant>WAFFLE_WINDOW_HEIGHT</constant> having positive values + <= <constant>INT32_MAX</constant>, + or with the attribute + <constant>WAFFLE_WINDOW_FULLSCREEN</constant> equal to true(1). </para> </listitem> </varlistentry> diff --git a/src/waffle/android/droid_window.c b/src/waffle/android/droid_window.c index b826ff9..048a2bb 100644 --- a/src/waffle/android/droid_window.c +++ b/src/waffle/android/droid_window.c @@ -49,6 +49,12 @@ droid_window_create(struct wcore_platform *wc_plat, (void) wc_plat; + if (width == -1 && height == -1) { + wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM, + "fullscreen window not supported"); + return NULL; + } + if (wcore_attrib_list_length(attrib_list) > 0) { wcore_error_bad_attribute(attrib_list[0]); } diff --git a/src/waffle/api/waffle_window.c b/src/waffle/api/waffle_window.c index 9ab63ca..d26797f 100644 --- a/src/waffle/api/waffle_window.c +++ b/src/waffle/api/waffle_window.c @@ -41,7 +41,9 @@ waffle_window_create2( struct wcore_window *wc_self = NULL; struct wcore_config *wc_config = wcore_config(config); intptr_t *attrib_list_filtered = NULL; - intptr_t width = 0, height = 0; + intptr_t width = 1, height = 1; + bool need_size = true; + intptr_t fullscreen = WAFFLE_DONT_CARE; const struct api_object *obj_list[] = { wc_config ? &wc_config->api : NULL, @@ -53,15 +55,31 @@ waffle_window_create2( attrib_list_filtered = wcore_attrib_list_copy(attrib_list); + wcore_attrib_list_pop(attrib_list_filtered, + WAFFLE_WINDOW_FULLSCREEN, &fullscreen); + if (fullscreen == WAFFLE_DONT_CARE) + fullscreen = 0; // default + + if (fullscreen == 1) { + need_size = false; + } else if (fullscreen != 0) { + // Same error message as in wcore_config_attrs.c. + wcore_errorf(WAFFLE_ERROR_BAD_ATTRIBUTE, + "WAFFLE_WINDOW_FULLSCREEN has bad value 0x%x. " + "Must be true(1), false(0), or WAFFLE_DONT_CARE(-1)", + fullscreen); + goto done; + } + if (!wcore_attrib_list_pop(attrib_list_filtered, - WAFFLE_WINDOW_WIDTH, &width)) { + WAFFLE_WINDOW_WIDTH, &width) && need_size) { wcore_errorf(WAFFLE_ERROR_BAD_ATTRIBUTE, "required attribute WAFFLE_WINDOW_WIDTH is missing"); goto done; } if (!wcore_attrib_list_pop(attrib_list_filtered, - WAFFLE_WINDOW_HEIGHT, &height)) { + WAFFLE_WINDOW_HEIGHT, &height) && need_size) { wcore_errorf(WAFFLE_ERROR_BAD_ATTRIBUTE, "required attribute WAFFLE_WINDOW_HEIGHT is missing"); goto done; @@ -87,6 +105,9 @@ waffle_window_create2( goto done; } + if (fullscreen) + width = height = -1; + wc_self = api_platform->vtbl->window.create(api_platform, wc_config, (int32_t) width, diff --git a/src/waffle/cgl/cgl_window.m b/src/waffle/cgl/cgl_window.m index 5ff1ec7..91273c5 100644 --- a/src/waffle/cgl/cgl_window.m +++ b/src/waffle/cgl/cgl_window.m @@ -102,6 +102,12 @@ cgl_window_create(struct wcore_platform *wc_plat, struct cgl_window *self; bool ok = true; + if (width == -1 && height == -1) { + wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM, + "fullscreen window not supported"); + return NULL; + } + if (wcore_attrib_list_length(attrib_list) > 0) { wcore_error_bad_attribute(attrib_list[0]); return NULL; diff --git a/src/waffle/core/wcore_util.c b/src/waffle/core/wcore_util.c index b7809a3..c563fae 100644 --- a/src/waffle/core/wcore_util.c +++ b/src/waffle/core/wcore_util.c @@ -113,6 +113,7 @@ wcore_enum_to_string(int32_t e) CASE(WAFFLE_DL_OPENGL_ES3); CASE(WAFFLE_WINDOW_WIDTH); CASE(WAFFLE_WINDOW_HEIGHT); + CASE(WAFFLE_WINDOW_FULLSCREEN); default: return NULL; diff --git a/src/waffle/gbm/wgbm_window.c b/src/waffle/gbm/wgbm_window.c index b75b5e3..313304b 100644 --- a/src/waffle/gbm/wgbm_window.c +++ b/src/waffle/gbm/wgbm_window.c @@ -70,6 +70,12 @@ wgbm_window_create(struct wcore_platform *wc_plat, uint32_t gbm_format; bool ok = true; + if (width == -1 && height == -1) { + wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM, + "fullscreen window not supported"); + return NULL; + } + if (wcore_attrib_list_length(attrib_list) > 0) { wcore_error_bad_attribute(attrib_list[0]); return NULL; diff --git a/src/waffle/glx/glx_window.c b/src/waffle/glx/glx_window.c index 331bb51..52efb61 100644 --- a/src/waffle/glx/glx_window.c +++ b/src/waffle/glx/glx_window.c @@ -62,6 +62,11 @@ glx_window_create(struct wcore_platform *wc_plat, struct glx_config *config = glx_config(wc_config); bool ok = true; + if (width == -1 && height == -1) { + width = DisplayWidth(dpy->x11.xlib, dpy->x11.screen); + height = DisplayHeight(dpy->x11.xlib, dpy->x11.screen); + } + if (wcore_attrib_list_length(attrib_list) > 0) { wcore_error_bad_attribute(attrib_list[0]); return NULL; diff --git a/src/waffle/nacl/nacl_window.c b/src/waffle/nacl/nacl_window.c index dc8d49c..1191f51 100644 --- a/src/waffle/nacl/nacl_window.c +++ b/src/waffle/nacl/nacl_window.c @@ -56,6 +56,12 @@ nacl_window_create(struct wcore_platform *wc_plat, struct nacl_platform *nplat = nacl_platform(wc_plat); bool ok = true; + if (width == -1 && height == -1) { + wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM, + "fullscreen window not supported"); + return NULL; + } + if (wcore_attrib_list_length(attrib_list) > 0) { wcore_error_bad_attribute(attrib_list[0]); return NULL; diff --git a/src/waffle/wayland/wayland_window.c b/src/waffle/wayland/wayland_window.c index b5eeaa3..2c4ebc8 100644 --- a/src/waffle/wayland/wayland_window.c +++ b/src/waffle/wayland/wayland_window.c @@ -111,6 +111,12 @@ wayland_window_create(struct wcore_platform *wc_plat, struct wayland_display *dpy = wayland_display(wc_config->display); bool ok = true; + if (width == -1 && height == -1) { + wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM, + "fullscreen window not supported"); + return NULL; + } + if (wcore_attrib_list_length(attrib_list) > 0) { wcore_error_bad_attribute(attrib_list[0]); return NULL; diff --git a/src/waffle/wgl/wgl_window.c b/src/waffle/wgl/wgl_window.c index 99dd194..316fb1d 100644 --- a/src/waffle/wgl/wgl_window.c +++ b/src/waffle/wgl/wgl_window.c @@ -78,6 +78,12 @@ wgl_window_create(struct wcore_platform *wc_plat, assert(config->window); + if (width == -1 && height == -1) { + wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM, + "fullscreen window not supported"); + return NULL; + } + if (wcore_attrib_list_length(attrib_list) > 0) { wcore_error_bad_attribute(attrib_list[0]); return NULL; diff --git a/src/waffle/xegl/xegl_window.c b/src/waffle/xegl/xegl_window.c index ab66314..cd2be46 100644 --- a/src/waffle/xegl/xegl_window.c +++ b/src/waffle/xegl/xegl_window.c @@ -67,6 +67,11 @@ xegl_window_create(struct wcore_platform *wc_plat, xcb_visualid_t visual; bool ok = true; + if (width == -1 && height == -1) { + width = DisplayWidth(dpy->x11.xlib, dpy->x11.screen); + height = DisplayHeight(dpy->x11.xlib, dpy->x11.screen); + } + if (wcore_attrib_list_length(attrib_list) > 0) { wcore_error_bad_attribute(attrib_list[0]); return NULL; |