+/**************************************************************************
+ *
+ * Copyright 2008 VMware, Inc.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010-2011 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
#ifndef EGLCONFIG_INCLUDED
#define EGLCONFIG_INCLUDED
#include <assert.h>
+#include <stddef.h>
+#include "c99_compat.h"
+
#include "egltypedefs.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* update _eglValidationTable and _eglOffsetOfConfig before updating this
* struct */
struct _egl_config
/* extensions */
EGLint YInvertedNOK;
+ EGLint FramebufferTargetAndroid;
+ EGLint RecordableAndroid;
+ EGLint ComponentType;
};
/**
* Map an EGL attribute enum to the offset of the member in _EGLConfig.
*/
-static INLINE EGLint
+static inline EGLint
_eglOffsetOfConfig(EGLint attr)
{
switch (attr) {
ATTRIB_MAP(EGL_CONFORMANT, Conformant);
/* extensions */
ATTRIB_MAP(EGL_Y_INVERTED_NOK, YInvertedNOK);
+ ATTRIB_MAP(EGL_FRAMEBUFFER_TARGET_ANDROID, FramebufferTargetAndroid);
+ ATTRIB_MAP(EGL_RECORDABLE_ANDROID, RecordableAndroid);
+ ATTRIB_MAP(EGL_COLOR_COMPONENT_TYPE_EXT, ComponentType);
#undef ATTRIB_MAP
default:
return -1;
* in the attribute enums. The separation is to catch application errors.
* Drivers should never set a key that is an invalid attribute.
*/
-static INLINE void
+static inline void
_eglSetConfigKey(_EGLConfig *conf, EGLint key, EGLint val)
{
EGLint offset = _eglOffsetOfConfig(key);
/**
* Return the value for a given key.
*/
-static INLINE EGLint
+static inline EGLint
_eglGetConfigKey(const _EGLConfig *conf, EGLint key)
{
EGLint offset = _eglOffsetOfConfig(key);
}
-PUBLIC void
+extern void
_eglInitConfig(_EGLConfig *config, _EGLDisplay *dpy, EGLint id);
-PUBLIC EGLConfig
+extern EGLConfig
_eglLinkConfig(_EGLConfig *conf);
/**
* Return the handle of a linked config.
*/
-static INLINE EGLConfig
+static inline EGLConfig
_eglGetConfigHandle(_EGLConfig *conf)
{
return (EGLConfig) conf;
}
-PUBLIC EGLBoolean
+extern EGLBoolean
_eglValidateConfig(const _EGLConfig *conf, EGLBoolean for_matching);
-PUBLIC EGLBoolean
+extern EGLBoolean
_eglMatchConfig(const _EGLConfig *conf, const _EGLConfig *criteria);
-PUBLIC EGLBoolean
+extern EGLBoolean
_eglParseConfigAttribList(_EGLConfig *conf, _EGLDisplay *dpy,
const EGLint *attrib_list);
-PUBLIC EGLint
+extern EGLint
_eglCompareConfigs(const _EGLConfig *conf1, const _EGLConfig *conf2,
const _EGLConfig *criteria, EGLBoolean compare_id);
-PUBLIC void
-_eglSortConfigs(const _EGLConfig **configs, EGLint count,
- EGLint (*compare)(const _EGLConfig *, const _EGLConfig *,
- void *),
- void *priv_data);
+extern EGLBoolean
+_eglFilterConfigArray(_EGLArray *array, EGLConfig *configs,
+ EGLint config_size, EGLint *num_configs,
+ EGLBoolean (*match)(const _EGLConfig *, void *),
+ EGLint (*compare)(const _EGLConfig *, const _EGLConfig *,
+ void *),
+ void *filter_data);
extern EGLBoolean
_eglGetConfigs(_EGLDriver *drv, _EGLDisplay *dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* EGLCONFIG_INCLUDED */