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
|
334 EGL_OPENGL_ES3_BIT_KHR
|
345 case ATTRIB_TYPE_PLATFORM
:
346 /* unable to check platform-dependent attributes here */
348 case ATTRIB_TYPE_PSEUDO
:
349 /* pseudo attributes should not be set */
358 if (!valid
&& for_matching
) {
359 /* accept EGL_DONT_CARE as a valid value */
360 if (val
== EGL_DONT_CARE
)
362 if (_eglValidationTable
[i
].criterion
== ATTRIB_CRITERION_SPECIAL
)
367 "attribute 0x%04x has an invalid value 0x%x", attr
, val
);
372 /* any invalid attribute value should have been catched */
373 if (!valid
|| for_matching
)
376 /* now check for conflicting attribute values */
378 switch (conf
->ColorBufferType
) {
380 if (conf
->LuminanceSize
)
382 if (conf
->RedSize
+ conf
->GreenSize
+
383 conf
->BlueSize
+ conf
->AlphaSize
!= conf
->BufferSize
)
386 case EGL_LUMINANCE_BUFFER
:
387 if (conf
->RedSize
|| conf
->GreenSize
|| conf
->BlueSize
)
389 if (conf
->LuminanceSize
+ conf
->AlphaSize
!= conf
->BufferSize
)
394 _eglLog(_EGL_DEBUG
, "conflicting color buffer type and channel sizes");
398 if (!conf
->SampleBuffers
&& conf
->Samples
)
401 _eglLog(_EGL_DEBUG
, "conflicting samples and sample buffers");
405 if (!(conf
->SurfaceType
& EGL_WINDOW_BIT
)) {
406 if (conf
->NativeVisualID
!= 0 || conf
->NativeVisualType
!= EGL_NONE
)
409 if (!(conf
->SurfaceType
& EGL_PBUFFER_BIT
)) {
410 if (conf
->BindToTextureRGB
|| conf
->BindToTextureRGBA
)
414 _eglLog(_EGL_DEBUG
, "conflicting surface type and native visual/texture binding");
423 * Return true if a config matches the criteria. This and
424 * _eglParseConfigAttribList together implement the algorithm
425 * described in "Selection of EGLConfigs".
427 * Note that attributes that are special (currently, only
428 * EGL_MATCH_NATIVE_PIXMAP) are ignored.
431 _eglMatchConfig(const _EGLConfig
*conf
, const _EGLConfig
*criteria
)
434 EGLBoolean matched
= EGL_TRUE
;
436 for (i
= 0; i
< ARRAY_SIZE(_eglValidationTable
); i
++) {
438 if (_eglValidationTable
[i
].criterion
== ATTRIB_CRITERION_IGNORE
)
441 attr
= _eglValidationTable
[i
].attr
;
442 cmp
= _eglGetConfigKey(criteria
, attr
);
443 if (cmp
== EGL_DONT_CARE
)
446 val
= _eglGetConfigKey(conf
, attr
);
447 switch (_eglValidationTable
[i
].criterion
) {
448 case ATTRIB_CRITERION_EXACT
:
452 case ATTRIB_CRITERION_ATLEAST
:
456 case ATTRIB_CRITERION_MASK
:
457 if ((val
& cmp
) != cmp
)
460 case ATTRIB_CRITERION_SPECIAL
:
470 /* only print the common errors when DEBUG is not defined */
471 if (attr
!= EGL_RENDERABLE_TYPE
)
475 "the value (0x%x) of attribute 0x%04x did not meet the criteria (0x%x)",
484 static INLINE EGLBoolean
485 _eglIsConfigAttribValid(_EGLConfig
*conf
, EGLint attr
)
487 if (_eglOffsetOfConfig(attr
) < 0)
491 case EGL_Y_INVERTED_NOK
:
492 return conf
->Display
->Extensions
.NOK_texture_from_pixmap
;
501 * Initialize a criteria config from the given attribute list.
502 * Return EGL_FALSE if any of the attribute is invalid.
505 _eglParseConfigAttribList(_EGLConfig
*conf
, _EGLDisplay
*dpy
,
506 const EGLint
*attrib_list
)
510 _eglInitConfig(conf
, dpy
, EGL_DONT_CARE
);
512 /* reset to default values */
513 for (i
= 0; i
< ARRAY_SIZE(_eglValidationTable
); i
++) {
514 attr
= _eglValidationTable
[i
].attr
;
515 val
= _eglValidationTable
[i
].default_value
;
516 _eglSetConfigKey(conf
, attr
, val
);
520 for (i
= 0; attrib_list
&& attrib_list
[i
] != EGL_NONE
; i
+= 2) {
521 attr
= attrib_list
[i
];
522 val
= attrib_list
[i
+ 1];
524 if (!_eglIsConfigAttribValid(conf
, attr
))
527 _eglSetConfigKey(conf
, attr
, val
);
530 if (!_eglValidateConfig(conf
, EGL_TRUE
))
533 /* EGL_LEVEL and EGL_MATCH_NATIVE_PIXMAP cannot be EGL_DONT_CARE */
534 if (conf
->Level
== EGL_DONT_CARE
||
535 conf
->MatchNativePixmap
== EGL_DONT_CARE
)
538 /* ignore other attributes when EGL_CONFIG_ID is given */
539 if (conf
->ConfigID
!= EGL_DONT_CARE
) {
540 for (i
= 0; i
< ARRAY_SIZE(_eglValidationTable
); i
++) {
541 attr
= _eglValidationTable
[i
].attr
;
542 if (attr
!= EGL_CONFIG_ID
)
543 _eglSetConfigKey(conf
, attr
, EGL_DONT_CARE
);
547 if (!(conf
->SurfaceType
& EGL_WINDOW_BIT
))
548 conf
->NativeVisualType
= EGL_DONT_CARE
;
550 if (conf
->TransparentType
== EGL_NONE
) {
551 conf
->TransparentRedValue
= EGL_DONT_CARE
;
552 conf
->TransparentGreenValue
= EGL_DONT_CARE
;
553 conf
->TransparentBlueValue
= EGL_DONT_CARE
;
562 * Decide the ordering of conf1 and conf2, under the given criteria.
563 * When compare_id is true, this implements the algorithm described
564 * in "Sorting of EGLConfigs". When compare_id is false,
565 * EGL_CONFIG_ID is not compared.
567 * It returns a negative integer if conf1 is considered to come
568 * before conf2; a positive integer if conf2 is considered to come
569 * before conf1; zero if the ordering cannot be decided.
571 * Note that EGL_NATIVE_VISUAL_TYPE is platform-dependent and is
575 _eglCompareConfigs(const _EGLConfig
*conf1
, const _EGLConfig
*conf2
,
576 const _EGLConfig
*criteria
, EGLBoolean compare_id
)
578 const EGLint compare_attribs
[] = {
592 /* the enum values have the desired ordering */
593 assert(EGL_NONE
< EGL_SLOW_CONFIG
);
594 assert(EGL_SLOW_CONFIG
< EGL_NON_CONFORMANT_CONFIG
);
595 val1
= conf1
->ConfigCaveat
- conf2
->ConfigCaveat
;
599 /* the enum values have the desired ordering */
600 assert(EGL_RGB_BUFFER
< EGL_LUMINANCE_BUFFER
);
601 val1
= conf1
->ColorBufferType
- conf2
->ColorBufferType
;
607 if (conf1
->ColorBufferType
== EGL_RGB_BUFFER
) {
608 if (criteria
->RedSize
> 0) {
609 val1
+= conf1
->RedSize
;
610 val2
+= conf2
->RedSize
;
612 if (criteria
->GreenSize
> 0) {
613 val1
+= conf1
->GreenSize
;
614 val2
+= conf2
->GreenSize
;
616 if (criteria
->BlueSize
> 0) {
617 val1
+= conf1
->BlueSize
;
618 val2
+= conf2
->BlueSize
;
622 if (criteria
->LuminanceSize
> 0) {
623 val1
+= conf1
->LuminanceSize
;
624 val2
+= conf2
->LuminanceSize
;
627 if (criteria
->AlphaSize
> 0) {
628 val1
+= conf1
->AlphaSize
;
629 val2
+= conf2
->AlphaSize
;
633 /* assume the default criteria, which gives no specific ordering */
637 /* for color bits, larger one is preferred */
639 return (val2
- val1
);
641 for (i
= 0; i
< ARRAY_SIZE(compare_attribs
); i
++) {
642 val1
= _eglGetConfigKey(conf1
, compare_attribs
[i
]);
643 val2
= _eglGetConfigKey(conf2
, compare_attribs
[i
]);
645 return (val1
- val2
);
648 /* EGL_NATIVE_VISUAL_TYPE cannot be compared here */
650 return (compare_id
) ? (conf1
->ConfigID
- conf2
->ConfigID
) : 0;
655 void _eglSwapConfigs(const _EGLConfig
**conf1
, const _EGLConfig
**conf2
)
657 const _EGLConfig
*tmp
= *conf1
;
664 * Quick sort an array of configs. This differs from the standard
665 * qsort() in that the compare function accepts an additional
669 _eglSortConfigs(const _EGLConfig
**configs
, EGLint count
,
670 EGLint (*compare
)(const _EGLConfig
*, const _EGLConfig
*,
674 const EGLint pivot
= 0;
680 _eglSwapConfigs(&configs
[pivot
], &configs
[count
/ 2]);
684 while (i
< count
&& compare(configs
[i
], configs
[pivot
], priv_data
) < 0)
686 while (compare(configs
[j
], configs
[pivot
], priv_data
) > 0)
689 _eglSwapConfigs(&configs
[i
], &configs
[j
]);
699 _eglSwapConfigs(&configs
[pivot
], &configs
[j
]);
701 _eglSortConfigs(configs
, j
, compare
, priv_data
);
702 _eglSortConfigs(configs
+ i
, count
- i
, compare
, priv_data
);
707 * A helper function for implementing eglChooseConfig. See _eglFilterArray and
708 * _eglSortConfigs for the meanings of match and compare.
711 _eglFilterConfigArray(_EGLArray
*array
, EGLConfig
*configs
,
712 EGLint config_size
, EGLint
*num_configs
,
713 EGLBoolean (*match
)(const _EGLConfig
*, void *),
714 EGLint (*compare
)(const _EGLConfig
*, const _EGLConfig
*,
718 _EGLConfig
**configList
;
722 return _eglError(EGL_BAD_PARAMETER
, "eglChooseConfigs");
724 /* get the number of matched configs */
725 count
= _eglFilterArray(array
, NULL
, 0,
726 (_EGLArrayForEach
) match
, priv_data
);
728 *num_configs
= count
;
732 configList
= malloc(sizeof(*configList
) * count
);
734 return _eglError(EGL_BAD_ALLOC
, "eglChooseConfig(out of memory)");
736 /* get the matched configs */
737 _eglFilterArray(array
, (void **) configList
, count
,
738 (_EGLArrayForEach
) match
, priv_data
);
740 /* perform sorting of configs */
741 if (configs
&& count
) {
742 _eglSortConfigs((const _EGLConfig
**) configList
, count
,
744 count
= MIN2(count
, config_size
);
745 for (i
= 0; i
< count
; i
++)
746 configs
[i
] = _eglGetConfigHandle(configList
[i
]);
751 *num_configs
= count
;
758 _eglFallbackMatch(const _EGLConfig
*conf
, void *priv_data
)
760 return _eglMatchConfig(conf
, (const _EGLConfig
*) priv_data
);
765 _eglFallbackCompare(const _EGLConfig
*conf1
, const _EGLConfig
*conf2
,
768 return _eglCompareConfigs(conf1
, conf2
,
769 (const _EGLConfig
*) priv_data
, EGL_TRUE
);
774 * Typical fallback routine for eglChooseConfig
777 _eglChooseConfig(_EGLDriver
*drv
, _EGLDisplay
*disp
, const EGLint
*attrib_list
,
778 EGLConfig
*configs
, EGLint config_size
, EGLint
*num_configs
)
782 if (!_eglParseConfigAttribList(&criteria
, disp
, attrib_list
))
783 return _eglError(EGL_BAD_ATTRIBUTE
, "eglChooseConfig");
785 return _eglFilterConfigArray(disp
->Configs
,
786 configs
, config_size
, num_configs
,
787 _eglFallbackMatch
, _eglFallbackCompare
,
793 * Fallback for eglGetConfigAttrib.
796 _eglGetConfigAttrib(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLConfig
*conf
,
797 EGLint attribute
, EGLint
*value
)
799 if (!_eglIsConfigAttribValid(conf
, attribute
))
800 return _eglError(EGL_BAD_ATTRIBUTE
, "eglGetConfigAttrib");
802 /* nonqueryable attributes */
804 case EGL_MATCH_NATIVE_PIXMAP
:
805 return _eglError(EGL_BAD_ATTRIBUTE
, "eglGetConfigAttrib");
812 return _eglError(EGL_BAD_PARAMETER
, "eglGetConfigAttrib");
814 *value
= _eglGetConfigKey(conf
, attribute
);
820 _eglFlattenConfig(void *elem
, void *buffer
)
822 _EGLConfig
*conf
= (_EGLConfig
*) elem
;
823 EGLConfig
*handle
= (EGLConfig
*) buffer
;
824 *handle
= _eglGetConfigHandle(conf
);
829 * Fallback for eglGetConfigs.
832 _eglGetConfigs(_EGLDriver
*drv
, _EGLDisplay
*disp
, EGLConfig
*configs
,
833 EGLint config_size
, EGLint
*num_config
)
836 return _eglError(EGL_BAD_PARAMETER
, "eglGetConfigs");
838 *num_config
= _eglFlattenArray(disp
->Configs
, (void *) configs
,
839 sizeof(configs
[0]), config_size
, _eglFlattenConfig
);