@@ -176,7 +176,7 @@ _X_HIDDEN const __DRIsystemTimeExtension systemTimeExtension = {
176
176
};
177
177
178
178
#define __ATTRIB (attrib , field ) \
179
- { attrib, offsetof(__GLcontextModes , field) }
179
+ { attrib, offsetof(struct glx_config , field) }
180
180
181
181
static const struct
182
182
{
@@ -225,10 +225,8 @@ __ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGB, bindToTextureRgb),
225
225
bindToMipmapTexture ),
226
226
__ATTRIB (__DRI_ATTRIB_YINVERTED , yInverted ),};
227
227
228
- #define ARRAY_SIZE (a ) (sizeof (a) / sizeof ((a)[0]))
229
-
230
228
static int
231
- scalarEqual (__GLcontextModes * mode , unsigned int attrib , unsigned int value )
229
+ scalarEqual (struct glx_config * mode , unsigned int attrib , unsigned int value )
232
230
{
233
231
unsigned int glxValue ;
234
232
int i ;
@@ -243,8 +241,8 @@ scalarEqual(__GLcontextModes * mode, unsigned int attrib, unsigned int value)
243
241
}
244
242
245
243
static int
246
- driConfigEqual (const __DRIcoreExtension * core ,
247
- __GLcontextModes * modes , const __DRIconfig * driConfig )
244
+ driConfigEqual (const __DRIcoreExtension * core ,
245
+ struct glx_config * config , const __DRIconfig * driConfig )
248
246
{
249
247
unsigned int attrib , value , glxValue ;
250
248
int i ;
@@ -260,7 +258,7 @@ driConfigEqual(const __DRIcoreExtension * core,
260
258
else if (value & __DRI_ATTRIB_COLOR_INDEX_BIT ) {
261
259
glxValue |= GLX_COLOR_INDEX_BIT ;
262
260
}
263
- if (glxValue != modes -> renderType )
261
+ if (glxValue != config -> renderType )
264
262
return GL_FALSE ;
265
263
break ;
266
264
@@ -271,7 +269,7 @@ driConfigEqual(const __DRIcoreExtension * core,
271
269
glxValue = GLX_SLOW_CONFIG ;
272
270
else
273
271
glxValue = GLX_NONE ;
274
- if (glxValue != modes -> visualRating )
272
+ if (glxValue != config -> visualRating )
275
273
return GL_FALSE ;
276
274
break ;
277
275
@@ -283,55 +281,55 @@ driConfigEqual(const __DRIcoreExtension * core,
283
281
glxValue |= GLX_TEXTURE_2D_BIT_EXT ;
284
282
if (value & __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT )
285
283
glxValue |= GLX_TEXTURE_RECTANGLE_BIT_EXT ;
286
- if (modes -> bindToTextureTargets != GLX_DONT_CARE &&
287
- glxValue != modes -> bindToTextureTargets )
284
+ if (config -> bindToTextureTargets != GLX_DONT_CARE &&
285
+ glxValue != config -> bindToTextureTargets )
288
286
return GL_FALSE ;
289
287
break ;
290
288
291
289
default :
292
- if (!scalarEqual (modes , attrib , value ))
290
+ if (!scalarEqual (config , attrib , value ))
293
291
return GL_FALSE ;
294
292
}
295
293
}
296
294
297
295
return GL_TRUE ;
298
296
}
299
297
300
- static __GLcontextModes *
298
+ static struct glx_config *
301
299
createDriMode (const __DRIcoreExtension * core ,
302
- __GLcontextModes * modes , const __DRIconfig * * driConfigs )
300
+ struct glx_config * config , const __DRIconfig * * driConfigs )
303
301
{
304
- __GLXDRIconfigPrivate * config ;
302
+ __GLXDRIconfigPrivate * driConfig ;
305
303
int i ;
306
304
307
305
for (i = 0 ; driConfigs [i ]; i ++ ) {
308
- if (driConfigEqual (core , modes , driConfigs [i ]))
306
+ if (driConfigEqual (core , config , driConfigs [i ]))
309
307
break ;
310
308
}
311
309
312
310
if (driConfigs [i ] == NULL )
313
311
return NULL ;
314
312
315
- config = Xmalloc (sizeof * config );
316
- if (config == NULL )
313
+ driConfig = Xmalloc (sizeof * driConfig );
314
+ if (driConfig == NULL )
317
315
return NULL ;
318
316
319
- config -> modes = * modes ;
320
- config -> driConfig = driConfigs [i ];
317
+ driConfig -> base = * config ;
318
+ driConfig -> driConfig = driConfigs [i ];
321
319
322
- return & config -> modes ;
320
+ return & driConfig -> base ;
323
321
}
324
322
325
- _X_HIDDEN __GLcontextModes *
323
+ _X_HIDDEN struct glx_config *
326
324
driConvertConfigs (const __DRIcoreExtension * core ,
327
- __GLcontextModes * modes , const __DRIconfig * * configs )
325
+ struct glx_config * configs , const __DRIconfig * * driConfigs )
328
326
{
329
- __GLcontextModes head , * tail , * m ;
327
+ struct glx_config head , * tail , * m ;
330
328
331
329
tail = & head ;
332
330
head .next = NULL ;
333
- for (m = modes ; m ; m = m -> next ) {
334
- tail -> next = createDriMode (core , m , configs );
331
+ for (m = configs ; m ; m = m -> next ) {
332
+ tail -> next = createDriMode (core , m , driConfigs );
335
333
if (tail -> next == NULL ) {
336
334
/* no matching dri config for m */
337
335
continue ;
@@ -341,7 +339,7 @@ driConvertConfigs(const __DRIcoreExtension * core,
341
339
tail = tail -> next ;
342
340
}
343
341
344
- _gl_context_modes_destroy ( modes );
342
+ glx_config_destroy_list ( configs );
345
343
346
344
return head .next ;
347
345
}
0 commit comments