1 /**************************************************************************
3 * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
4 * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
5 * Copyright 2010-2011 LunarG, Inc.
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the
10 * "Software"), to deal in the Software without restriction, including
11 * without limitation the rights to use, copy, modify, merge, publish,
12 * distribute, sub license, and/or sell copies of the Software, and to
13 * permit persons to whom the Software is furnished to do so, subject to
14 * the following conditions:
16 * The above copyright notice and this permission notice (including the
17 * next paragraph) shall be included in all copies or substantial portions
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 * DEALINGS IN THE SOFTWARE.
28 **************************************************************************/
32 * EGL Configuration (pixel format) functions.
39 #include "eglconfig.h"
40 #include "egldisplay.h"
41 #include "eglcurrent.h"
45 #define MIN2(A, B) (((A) < (B)) ? (A) : (B))
49 * Init the given _EGLconfig to default values.
50 * \param id the configuration's ID.
52 * Note that id must be positive for the config to be valid.
53 * It is also recommended that when there are N configs, their
54 * IDs are from 1 to N respectively.
57 _eglInitConfig(_EGLConfig
*conf
, _EGLDisplay
*dpy
, EGLint id
)
59 memset(conf
, 0, sizeof(*conf
));
63 /* some attributes take non-zero default values */
65 conf
->ConfigCaveat
= EGL_NONE
;
66 conf
->TransparentType
= EGL_NONE
;
67 conf
->NativeVisualType
= EGL_NONE
;
68 conf
->ColorBufferType
= EGL_RGB_BUFFER
;
73 * Link a config to its display and return the handle of the link.
74 * The handle can be passed to client directly.
76 * Note that we just save the ptr to the config (we don't copy the config).
79 _eglLinkConfig(_EGLConfig
*conf
)
81 _EGLDisplay
*dpy
= conf
->Display
;
84 assert(dpy
&& conf
->ConfigID
> 0);
87 dpy
->Configs
= _eglCreateArray("Config", 16);
89 return (EGLConfig
) NULL
;
92 _eglAppendArray(dpy
->Configs
, (void *) conf
);
94 return (EGLConfig
) conf
;
99 * Lookup a handle to find the linked config.
100 * Return NULL if the handle has no corresponding linked config.
103 _eglLookupConfig(EGLConfig config
, _EGLDisplay
*dpy
)
110 conf
= (_EGLConfig
*) _eglFindArray(dpy
->Configs
, (void *) config
);
112 assert(conf
->Display
== dpy
);
124 ATTRIB_TYPE_PSEUDO
, /* non-queryable */
125 ATTRIB_TYPE_PLATFORM
, /* platform-dependent */
127 ATTRIB_CRITERION_EXACT
,
128 ATTRIB_CRITERION_ATLEAST
,
129 ATTRIB_CRITERION_MASK
,
130 ATTRIB_CRITERION_SPECIAL
,
131 ATTRIB_CRITERION_IGNORE
135 /* EGL spec Table 3.1 and 3.4 */
136 static const struct {
140 EGLint default_value
;
141 } _eglValidationTable
[] =
144 { EGL_BUFFER_SIZE
, ATTRIB_TYPE_INTEGER
,
145 ATTRIB_CRITERION_ATLEAST
,
147 { EGL_RED_SIZE
, ATTRIB_TYPE_INTEGER
,
148 ATTRIB_CRITERION_ATLEAST
,
150 { EGL_GREEN_SIZE
, ATTRIB_TYPE_INTEGER
,
151 ATTRIB_CRITERION_ATLEAST
,
153 { EGL_BLUE_SIZE
, ATTRIB_TYPE_INTEGER
,
154 ATTRIB_CRITERION_ATLEAST
,
156 { EGL_LUMINANCE_SIZE
, ATTRIB_TYPE_INTEGER
,
157 ATTRIB_CRITERION_ATLEAST
,
159 { EGL_ALPHA_SIZE
, ATTRIB_TYPE_INTEGER
,
160 ATTRIB_CRITERION_ATLEAST
,
162 { EGL_ALPHA_MASK_SIZE
, ATTRIB_TYPE_INTEGER
,
163 ATTRIB_CRITERION_ATLEAST
,
165 { EGL_BIND_TO_TEXTURE_RGB
, ATTRIB_TYPE_BOOLEAN
,
166 ATTRIB_CRITERION_EXACT
,
168 { EGL_BIND_TO_TEXTURE_RGBA
, ATTRIB_TYPE_BOOLEAN
,
169 ATTRIB_CRITERION_EXACT
,
171 { EGL_COLOR_BUFFER_TYPE
, ATTRIB_TYPE_ENUM
,
172 ATTRIB_CRITERION_EXACT
,
174 { EGL_CONFIG_CAVEAT
, ATTRIB_TYPE_ENUM
,
175 ATTRIB_CRITERION_EXACT
,
177 { EGL_CONFIG_ID
, ATTRIB_TYPE_INTEGER
,
178 ATTRIB_CRITERION_EXACT
,
180 { EGL_CONFORMANT
, ATTRIB_TYPE_BITMASK
,
181 ATTRIB_CRITERION_MASK
,
183 { EGL_DEPTH_SIZE
, ATTRIB_TYPE_INTEGER
,
184 ATTRIB_CRITERION_ATLEAST
,
186 { EGL_LEVEL
, ATTRIB_TYPE_PLATFORM
,
187 ATTRIB_CRITERION_EXACT
,
189 { EGL_MAX_PBUFFER_WIDTH
, ATTRIB_TYPE_INTEGER
,
190 ATTRIB_CRITERION_IGNORE
,
192 { EGL_MAX_PBUFFER_HEIGHT
, ATTRIB_TYPE_INTEGER
,
193 ATTRIB_CRITERION_IGNORE
,
195 { EGL_MAX_PBUFFER_PIXELS
, ATTRIB_TYPE_INTEGER
,
196 ATTRIB_CRITERION_IGNORE
,
198 { EGL_MAX_SWAP_INTERVAL
, ATTRIB_TYPE_INTEGER
,
199 ATTRIB_CRITERION_EXACT
,
201 { EGL_MIN_SWAP_INTERVAL
, ATTRIB_TYPE_INTEGER
,
202 ATTRIB_CRITERION_EXACT
,
204 { EGL_NATIVE_RENDERABLE
, ATTRIB_TYPE_BOOLEAN
,
205 ATTRIB_CRITERION_EXACT
,
207 { EGL_NATIVE_VISUAL_ID
, ATTRIB_TYPE_PLATFORM
,
208 ATTRIB_CRITERION_IGNORE
,
210 { EGL_NATIVE_VISUAL_TYPE
, ATTRIB_TYPE_PLATFORM
,
211 ATTRIB_CRITERION_EXACT
,
213 { EGL_RENDERABLE_TYPE
, ATTRIB_TYPE_BITMASK
,
214 ATTRIB_CRITERION_MASK
,
216 { EGL_SAMPLE_BUFFERS
, ATTRIB_TYPE_INTEGER
,
217 ATTRIB_CRITERION_ATLEAST
,
219 { EGL_SAMPLES
, ATTRIB_TYPE_INTEGER
,
220 ATTRIB_CRITERION_ATLEAST
,
222 { EGL_STENCIL_SIZE
, ATTRIB_TYPE_INTEGER
,
223 ATTRIB_CRITERION_ATLEAST
,
225 { EGL_SURFACE_TYPE
, ATTRIB_TYPE_BITMASK
,
226 ATTRIB_CRITERION_MASK
,
228 { EGL_TRANSPARENT_TYPE
, ATTRIB_TYPE_ENUM
,
229 ATTRIB_CRITERION_EXACT
,
231 { EGL_TRANSPARENT_RED_VALUE
, ATTRIB_TYPE_INTEGER
,
232 ATTRIB_CRITERION_EXACT
,
234 { EGL_TRANSPARENT_GREEN_VALUE
, ATTRIB_TYPE_INTEGER
,
235 ATTRIB_CRITERION_EXACT
,
237 { EGL_TRANSPARENT_BLUE_VALUE
, ATTRIB_TYPE_INTEGER
,
238 ATTRIB_CRITERION_EXACT
,
240 { EGL_MATCH_NATIVE_PIXMAP
, ATTRIB_TYPE_PSEUDO
,
241 ATTRIB_CRITERION_SPECIAL
,
244 { EGL_Y_INVERTED_NOK
, ATTRIB_TYPE_BOOLEAN
,
245 ATTRIB_CRITERION_EXACT
,
251 * Return true if a config is valid. When for_matching is true,
252 * EGL_DONT_CARE is accepted as a valid attribute value, and checks
253 * for conflicting attribute values are skipped.
255 * Note that some attributes are platform-dependent and are not
259 _eglValidateConfig(const _EGLConfig
*conf
, EGLBoolean for_matching
)
262 EGLBoolean valid
= EGL_TRUE
;
264 /* check attributes by their types */
265 for (i
= 0; i
< ARRAY_SIZE(_eglValidationTable
); i
++) {
268 attr
= _eglValidationTable
[i
].attr
;
269 val
= _eglGetConfigKey(conf
, attr
);
271 switch (_eglValidationTable
[i
].type
) {
272 case ATTRIB_TYPE_INTEGER
:
275 /* config id must be positive */
279 case EGL_SAMPLE_BUFFERS
:
280 /* there can be at most 1 sample buffer */
281 if (val
> 1 || val
< 0)
290 case ATTRIB_TYPE_BOOLEAN
:
291 if (val
!= EGL_TRUE
&& val
!= EGL_FALSE
)
294 case ATTRIB_TYPE_ENUM
:
296 case EGL_CONFIG_CAVEAT
:
297 if (val
!= EGL_NONE
&& val
!= EGL_SLOW_CONFIG
&&
298 val
!= EGL_NON_CONFORMANT_CONFIG
)
301 case EGL_TRANSPARENT_TYPE
:
302 if (val
!= EGL_NONE
&& val
!= EGL_TRANSPARENT_RGB
)
305 case EGL_COLOR_BUFFER_TYPE
:
306 if (val
!= EGL_RGB_BUFFER
&& val
!= EGL_LUMINANCE_BUFFER
)
314 case ATTRIB_TYPE_BITMASK
:
316 case EGL_SURFACE_TYPE
:
317 mask
= EGL_PBUFFER_BIT
|
320 EGL_VG_COLORSPACE_LINEAR_BIT
|
321 EGL_VG_ALPHA_FORMAT_PRE_BIT
|
322 EGL_MULTISAMPLE_RESOLVE_BOX_BIT
|
323 EGL_SWAP_BEHAVIOR_PRESERVED_BIT
;
324 #ifdef EGL_MESA_screen_surface
325 if (conf
->Display
->Extensions
.MESA_screen_surface
)
326 mask
|= EGL_SCREEN_BIT_MESA
;
329 case EGL_RENDERABLE_TYPE
:
331 mask
= EGL_OPENGL_ES_BIT
|
344 case ATTRIB_TYPE_PLATFORM
:
345 /* unable to check platform-dependent attributes here */
347 case ATTRIB_TYPE_PSEUDO
:
348 /* pseudo attributes should not be set */
357 if (!valid
&& for_matching
) {
358 /* accept EGL_DONT_CARE as a valid value */
359 if (val
== EGL_DONT_CARE
)
361 if (_eglValidationTable
[i
].criterion
== ATTRIB_CRITERION_SPECIAL
)
366 "attribute 0x%04x has an invalid value 0x%x", attr
, val
);
371 /* any invalid attribute value should have been catched */
372 if (!valid
|| for_matching
)
375 /* now check for conflicting attribute values */
377 switch (conf
->ColorBufferType
) {
379 if (conf
->LuminanceSize
)
381 if (conf
->RedSize
+ conf
->GreenSize
+
382 conf
->BlueSize
+ conf
->AlphaSize
!= conf
->BufferSize
)
385 case EGL_LUMINANCE_BUFFER
:
386 if (conf
->RedSize
|| conf
->GreenSize
|| conf
->BlueSize
)
388 if (conf
->LuminanceSize
+ conf
->AlphaSize
!= conf
->BufferSize
)
393 _eglLog(_EGL_DEBUG
, "conflicting color buffer type and channel sizes");
397 if (!conf
->SampleBuffers
&& conf
->Samples
)
400 _eglLog(_EGL_DEBUG
, "conflicting samples and sample buffers");
404 if (!(conf
->SurfaceType
& EGL_WINDOW_BIT
)) {
405 if (conf
->NativeVisualID
!= 0 || conf
->NativeVisualType
!= EGL_NONE
)
408 if (!(conf
->SurfaceType
& EGL_PBUFFER_BIT
)) {
409 if (conf
->BindToTextureRGB
|| conf
->BindToTextureRGBA
)
413 _eglLog(_EGL_DEBUG
, "conflicting surface type and native visual/texture binding");
422 * Return true if a config matches the criteria. This and
423 * _eglParseConfigAttribList together implement the algorithm
424 * described in "Selection of EGLConfigs".
426 * Note that attributes that are special (currently, only
427 * EGL_MATCH_NATIVE_PIXMAP) are ignored.
430 _eglMatchConfig(const _EGLConfig
*conf
, const _EGLConfig
*criteria
)
433 EGLBoolean matched
= EGL_TRUE
;
435 for (i
= 0; i
< ARRAY_SIZE(_eglValidationTable
); i
++) {
437 if (_eglValidationTable
[i
].criterion
== ATTRIB_CRITERION_IGNORE
)
440 attr
= _eglValidationTable
[i
].attr
;
441 cmp
= _eglGetConfigKey(criteria
, attr
);
442 if (cmp
== EGL_DONT_CARE
)
445 val
= _eglGetConfigKey(conf
, attr
);
446 switch (_eglValidationTable
[i
].criterion
) {
447 case ATTRIB_CRITERION_EXACT
:
451 case ATTRIB_CRITERION_ATLEAST
:
455 case ATTRIB_CRITERION_MASK
:
456 if ((val
& cmp
) != cmp
)
459 case ATTRIB_CRITERION_SPECIAL
:
469 /* only print the common errors when DEBUG is not defined */
470 if (attr
!= EGL_RENDERABLE_TYPE
)
474 "the value (0x%x) of attribute 0x%04x did not meet the criteria (0x%x)",
483 static INLINE EGLBoolean
484 _eglIsConfigAttribValid(_EGLConfig
*conf
, EGLint attr
)
486 if (_eglOffsetOfConfig(attr
) < 0)
490 case EGL_Y_INVERTED_NOK
:
491 return conf
->Display
->Extensions
.NOK_texture_from_pixmap
;
500 * Initialize a criteria config from the given attribute list.
501 * Return EGL_FALSE if any of the attribute is invalid.
504 _eglParseConfigAttribList(_EGLConfig
*conf
, _EGLDisplay
*dpy
,
505 const EGLint
*attrib_list
)
509 _eglInitConfig(conf
, dpy
, EGL_DONT_CARE
);
511 /* reset to default values */
512 for (i
= 0; i
< ARRAY_SIZE(_eglValidationTable
); i
++) {
513 attr
= _eglValidationTable
[i
].attr
;
514 val
= _eglValidationTable
[i
].default_value
;
515 _eglSetConfigKey(conf
, attr
, val
);
519 for (i
= 0; attrib_list
&& attrib_list
[i
] != EGL_NONE
; i
+= 2) {
520 attr
= attrib_list
[i
];
521 val
= attrib_list
[i
+ 1];
523 if (!_eglIsConfigAttribValid(conf
, attr
))
526 _eglSetConfigKey(conf
, attr
, val
);
529 if (!_eglValidateConfig(conf
, EGL_TRUE
))
532 /* EGL_LEVEL and EGL_MATCH_NATIVE_PIXMAP cannot be EGL_DONT_CARE */
533 if (conf
->Level
== EGL_DONT_CARE
||
534 conf
->MatchNativePixmap
== EGL_DONT_CARE
)
537 /* ignore other attributes when EGL_CONFIG_ID is given */
538 if (conf
->ConfigID
!= EGL_DONT_CARE
) {
539 for (i
= 0; i
< ARRAY_SIZE(_eglValidationTable
); i
++) {
540 attr
= _eglValidationTable
[i
].attr
;
541 if (attr
!= EGL_CONFIG_ID
)
542 _eglSetConfigKey(conf
, attr
, EGL_DONT_CARE
);
546 if (!(conf
->SurfaceType
& EGL_WINDOW_BIT
))
547 conf
->NativeVisualType
= EGL_DONT_CARE
;
549 if (conf
->TransparentType
== EGL_NONE
) {
550 conf
->TransparentRedValue
= EGL_DONT_CARE
;
551 conf
->TransparentGreenValue
= EGL_DONT_CARE
;
552 conf
->TransparentBlueValue
= EGL_DONT_CARE
;
561 * Decide the ordering of conf1 and conf2, under the given criteria.
562 * When compare_id is true, this implements the algorithm described
563 * in "Sorting of EGLConfigs". When compare_id is false,
564 * EGL_CONFIG_ID is not compared.
566 * It returns a negative integer if conf1 is considered to come
567 * before conf2; a positive integer if conf2 is considered to come
568 * before conf1; zero if the ordering cannot be decided.
570 * Note that EGL_NATIVE_VISUAL_TYPE is platform-dependent and is
574 _eglCompareConfigs(const _EGLConfig
*conf1
, const _EGLConfig
*conf2
,
575 const _EGLConfig
*criteria
, EGLBoolean compare_id
)
577 const EGLint compare_attribs
[] = {
591 /* the enum values have the desired ordering */
592 assert(EGL_NONE
< EGL_SLOW_CONFIG
);
593 assert(EGL_SLOW_CONFIG
< EGL_NON_CONFORMANT_CONFIG
);
594 val1
= conf1
->ConfigCaveat
- conf2
->ConfigCaveat
;
598 /* the enum values have the desired ordering */
599 assert(EGL_RGB_BUFFER
< EGL_LUMINANCE_BUFFER
);
600 val1
= conf1
->ColorBufferType
- conf2
->ColorBufferType
;
606 if (conf1
->ColorBufferType
== EGL_RGB_BUFFER
) {
607 if (criteria
->RedSize
> 0) {
608 val1
+= conf1
->RedSize
;
609 val2
+= conf2
->RedSize
;
611 if (criteria
->GreenSize
> 0) {
612 val1
+= conf1
->GreenSize
;
613 val2
+= conf2
->GreenSize
;
615 if (criteria
->BlueSize
> 0) {
616 val1
+= conf1
->BlueSize
;
617 val2
+= conf2
->BlueSize
;
621 if (criteria
->LuminanceSize
> 0) {
622 val1
+= conf1
->LuminanceSize
;
623 val2
+= conf2
->LuminanceSize
;
626 if (criteria
->AlphaSize
> 0) {
627 val1
+= conf1
->AlphaSize
;
628 val2
+= conf2
->AlphaSize
;
632 /* assume the default criteria, which gives no specific ordering */
636 /* for color bits, larger one is preferred */
638 return (val2
- val1
);
640 for (i
= 0; i
< ARRAY_SIZE(compare_attribs
); i
++) {
641 val1
= _eglGetConfigKey(conf1
, compare_attribs
[i
]);
642 val2
= _eglGetConfigKey(conf2
, compare_attribs
[i
]);
644 return (val1
- val2
);
647 /* EGL_NATIVE_VISUAL_TYPE cannot be compared here */
649 return (compare_id
) ? (conf1
->ConfigID
- conf2
->ConfigID
) : 0;
654 void _eglSwapConfigs(const _EGLConfig
**conf1
, const _EGLConfig
**conf2
)
656 const _EGLConfig
*tmp
= *conf1
;
663 * Quick sort an array of configs. This differs from the standard
664 * qsort() in that the compare function accepts an additional
668 _eglSortConfigs(const _EGLConfig
**configs
, EGLint count
,
669 EGLint (*compare
)(const _EGLConfig
*, const _EGLConfig
*,
673 const EGLint pivot
= 0;
679 _eglSwapConfigs(&configs
[pivot
], &configs
[count
/ 2]);
683 while (i
< count
&& compare(configs
[i
], configs
[pivot
], priv_data
) < 0)
685 while (compare(configs
[j
], configs
[pivot
], priv_data
) > 0)
688 _eglSwapConfigs(&configs
[i
], &configs
[j
]);
698 _eglSwapConfigs(&configs
[pivot
], &configs
[j
]);
700 _eglSortConfigs(configs
, j
, compare
, priv_data
);
701 _eglSortConfigs(configs
+ i
, count
- i
, compare
, priv_data
);
706 * A helper function for implementing eglChooseConfig. See _eglFilterArray and
707 * _eglSortConfigs for the meanings of match and compare.
710 _eglFilterConfigArray(_EGLArray
*array
, EGLConfig
*configs
,
711 EGLint config_size
, EGLint
*num_configs
,
712 EGLBoolean (*match
)(const _EGLConfig
*, void *),
713 EGLint (*compare
)(const _EGLConfig
*, const _EGLConfig
*,
717 _EGLConfig
**configList
;
721 return _eglError(EGL_BAD_PARAMETER
, "eglChooseConfigs");
723 /* get the number of matched configs */
724 count
= _eglFilterArray(array
, NULL
, 0,
725 (_EGLArrayForEach
) match
, priv_data
);
727 *num_configs
= count
;
731 configList
= malloc(sizeof(*configList
) * count
);
733 return _eglError(EGL_BAD_ALLOC
, "eglChooseConfig(out of memory)");
735 /* get the matched configs */
736 _eglFilterArray(array
, (void **) configList
, count
,
737 (_EGLArrayForEach
) match
, priv_data
);
739 /* perform sorting of configs */
740 if (configs
&& count
) {
741 _eglSortConfigs((const _EGLConfig
**) configList
, count
,
743 count
= MIN2(count
, config_size
);
744 for (i
= 0; i
< count
; i
++)
745 configs
[i
] = _eglGetConfigHandle(configList
[i
]);
750 *num_configs
= count
;
757 _eglFallbackMatch(const _EGLConfig
*conf
, void *priv_data
)
759 return _eglMatchConfig(conf
, (const _EGLConfig
*) priv_data
);
764 _eglFallbackCompare(const _EGLConfig
*conf1
, const _EGLConfig
*conf2
,
767 return _eglCompareConfigs(conf1
, conf2
,
768 (const _EGLConfig
*) priv_data
, EGL_TRUE
);
773 * Typical fallback routine for eglChooseConfig
776 _eglChooseConfig(_EGLDriver
*drv
, _EGLDisplay
*disp
, const EGLint
*attrib_list
,
777 EGLConfig
*configs
, EGLint config_size
, EGLint
*num_configs
)
781 if (!_eglParseConfigAttribList(&criteria
, disp
, attrib_list
))
782 return _eglError(EGL_BAD_ATTRIBUTE
, "eglChooseConfig");
784 return _eglFilterConfigArray(disp
->Configs
,
785 configs
, config_size
, num_configs
,
786 _eglFallbackMatch
, _eglFallbackCompare
,
792 * Fallback for eglGetConfigAttrib.
795 _eglGetConfigAttrib(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLConfig
*conf
,
796 EGLint attribute
, EGLint
*value
)
798 if (!_eglIsConfigAttribValid(conf
, attribute
))
799 return _eglError(EGL_BAD_ATTRIBUTE
, "eglGetConfigAttrib");
801 /* nonqueryable attributes */
803 case EGL_MATCH_NATIVE_PIXMAP
:
804 return _eglError(EGL_BAD_ATTRIBUTE
, "eglGetConfigAttrib");
811 return _eglError(EGL_BAD_PARAMETER
, "eglGetConfigAttrib");
813 *value
= _eglGetConfigKey(conf
, attribute
);
819 _eglFlattenConfig(void *elem
, void *buffer
)
821 _EGLConfig
*conf
= (_EGLConfig
*) elem
;
822 EGLConfig
*handle
= (EGLConfig
*) buffer
;
823 *handle
= _eglGetConfigHandle(conf
);
828 * Fallback for eglGetConfigs.
831 _eglGetConfigs(_EGLDriver
*drv
, _EGLDisplay
*disp
, EGLConfig
*configs
,
832 EGLint config_size
, EGLint
*num_config
)
835 return _eglError(EGL_BAD_PARAMETER
, "eglGetConfigs");
837 *num_config
= _eglFlattenArray(disp
->Configs
, (void *) configs
,
838 sizeof(configs
[0]), config_size
, _eglFlattenConfig
);