~ubuntu-branches/ubuntu/precise/xorg-server/precise-updates

« back to all changes in this revision

Viewing changes to hw/dmx/glxProxy/glxext.c

Tags: 2:1.10.1-2
* Build xserver-xorg-core-udeb on hurd-i386.  Thanks, Samuel Thibault!
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
    Display **keep_be_displays;
78
78
    int i;
79
79
 
80
 
    if (cl->returnBuf) __glXFree(cl->returnBuf);
81
 
    if (cl->currentContexts) __glXFree(cl->currentContexts);
82
 
    if (cl->currentDrawables) __glXFree(cl->currentDrawables);
83
 
    if (cl->largeCmdBuf) __glXFree(cl->largeCmdBuf);
 
80
    free(cl->returnBuf);
 
81
    free(cl->currentContexts);
 
82
    free(cl->currentDrawables);
 
83
    free(cl->largeCmdBuf);
84
84
 
85
85
    for (i=0; i< screenInfo.numScreens; i++) {
86
86
       if (cl->be_displays[i])
97
97
    */
98
98
    cl->GLClientmajorVersion = 1;
99
99
    cl->GLClientminorVersion = 0;
100
 
    if (cl->GLClientextensions) __glXFree(cl->GLClientextensions);
 
100
    free(cl->GLClientextensions);
101
101
 
102
102
    memset(cl->be_displays, 0, screenInfo.numScreens * sizeof(Display *));
103
103
}
167
167
        ** only if it's zero.
168
168
        */
169
169
        (*pGlxPixmap->pScreen->DestroyPixmap)(pPixmap);
170
 
        __glXFree(pGlxPixmap->be_xids);
171
 
        __glXFree(pGlxPixmap);
 
170
        free(pGlxPixmap->be_xids);
 
171
        free(pGlxPixmap);
172
172
    }
173
173
 
174
174
}
186
186
{
187
187
    if (!pGlxWindow->idExists && !pGlxWindow->refcnt) {
188
188
        WindowPtr pWindow = (WindowPtr) pGlxWindow->pDraw;
 
189
        WindowPtr ret;
189
190
 
190
 
        if (LookupIDByType(pWindow->drawable.id, RT_WINDOW) == pWindow) {
 
191
        dixLookupResourceByType((pointer) &ret,
 
192
                                pWindow->drawable.id, RT_WINDOW,
 
193
                                NullClient, DixUnknownAccess);
 
194
        if (ret == pWindow) {
191
195
            (*pGlxWindow->pScreen->DestroyWindow)(pWindow);
192
196
        }
193
197
 
222
226
{
223
227
    if (cx->idExists || cx->isCurrent) return GL_FALSE;
224
228
    
225
 
    if (cx->feedbackBuf) __glXFree(cx->feedbackBuf);
226
 
    if (cx->selectBuf) __glXFree(cx->selectBuf);
227
 
    if (cx->real_ids) __glXFree(cx->real_ids);
228
 
    if (cx->real_vids) __glXFree(cx->real_vids);
 
229
    free(cx->feedbackBuf);
 
230
    free(cx->selectBuf);
 
231
    free(cx->real_ids);
 
232
    free(cx->real_vids);
229
233
 
230
234
    if (cx->pGlxPixmap) {
231
235
       /*
263
267
       cx->pGlxReadWindow = 0;   
264
268
    }
265
269
 
266
 
    __glXFree(cx);
 
270
    free(cx);
267
271
 
268
272
    if (cx == __glXLastContext) {
269
273
        __glXFlushContextCache();
367
371
 
368
372
/************************************************************************/
369
373
 
370
 
void GlxSetVisualConfigs(int nconfigs, 
371
 
                         __GLXvisualConfig *configs, void **privates)
372
 
{
373
 
    glxSetVisualConfigs(nconfigs, configs, privates);
374
 
}
375
 
 
376
 
static miInitVisualsProcPtr saveInitVisualsProc;
377
 
 
378
 
Bool GlxInitVisuals(VisualPtr *visualp, DepthPtr *depthp,
379
 
                    int *nvisualp, int *ndepthp,
380
 
                    int *rootDepthp, VisualID *defaultVisp,
381
 
                    unsigned long sizes, int bitsPerRGB,
382
 
                    int preferredVis)
383
 
{
384
 
    Bool ret;
385
 
 
386
 
    if (saveInitVisualsProc) {
387
 
        ret = saveInitVisualsProc(visualp, depthp, nvisualp, ndepthp,
388
 
                                  rootDepthp, defaultVisp, sizes, bitsPerRGB,
389
 
                                  preferredVis);
390
 
        if (!ret)
391
 
            return False;
392
 
    }
393
 
 
394
 
    glxInitVisuals(nvisualp, visualp, defaultVisp, *ndepthp, *depthp,*rootDepthp);
395
 
 
396
 
    return True;
397
 
}
398
 
 
399
 
void
400
 
GlxWrapInitVisuals(miInitVisualsProcPtr *initVisProc)
401
 
{
402
 
    if (dmxGLXProxy) {
403
 
        saveInitVisualsProc = *initVisProc;
404
 
        *initVisProc = GlxInitVisuals;
405
 
    }
406
 
}
407
 
 
408
 
/************************************************************************/
409
 
 
410
374
void __glXFlushContextCache(void)
411
375
{
412
376
    __glXLastContext = 0;
427
391
    opcode = stuff->glxCode;
428
392
    cl = __glXClients[client->index];
429
393
    if (!cl) {
430
 
        cl = __glXCalloc(1, sizeof(__GLXclientState));
 
394
        cl = calloc(1, sizeof(__GLXclientState));
431
395
         __glXClients[client->index] = cl;
432
396
        if (!cl) {
433
397
            return BadAlloc;
434
398
        }
435
399
 
436
 
        cl->be_displays = __glXCalloc(screenInfo.numScreens, sizeof(Display *));
 
400
        cl->be_displays = calloc(screenInfo.numScreens, sizeof(Display *));
437
401
        if (!cl->be_displays) {
438
 
            __glXFree( cl );
 
402
            free( cl );
439
403
            return BadAlloc;
440
404
        }
441
405
    }
479
443
    opcode = stuff->glxCode;
480
444
    cl = __glXClients[client->index];
481
445
    if (!cl) {
482
 
        cl = __glXCalloc(1, sizeof(__GLXclientState));
 
446
        cl = calloc(1, sizeof(__GLXclientState));
483
447
         __glXClients[client->index] = cl;
484
448
        if (!cl) {
485
449
            return BadAlloc;
486
450
        }
487
451
 
488
 
        cl->be_displays = __glXCalloc(screenInfo.numScreens, sizeof(Display *));
 
452
        cl->be_displays = calloc(screenInfo.numScreens, sizeof(Display *));
489
453
        if (!cl->be_displays) {
490
 
            __glXFree( cl );
 
454
            free( cl );
491
455
            return BadAlloc;
492
456
        }
493
457
    }