~ubuntu-branches/debian/wheezy/xserver-xorg-video-intel/wheezy

« back to all changes in this revision

Viewing changes to uxa/uxa-unaccel.c

  • Committer: Package Import Robot
  • Author(s): Cyril Brulebois, Timo Aaltonen
  • Date: 2011-11-19 12:46:57 UTC
  • mfrom: (26.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20111119124657-zpht20ygj578uqwn
Tags: 2:2.17.0-1
[ Timo Aaltonen ]
New upstream release. (Closes: #635953)

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
                uxa_finish_access(&pGC->stipple->drawable);
68
68
}
69
69
 
 
70
Bool uxa_picture_prepare_access(PicturePtr picture, int mode)
 
71
{
 
72
        if (picture->pDrawable == NULL)
 
73
                return TRUE;
 
74
 
 
75
        if (!uxa_prepare_access(picture->pDrawable, mode))
 
76
                return FALSE;
 
77
 
 
78
        if (picture->alphaMap &&
 
79
            !uxa_prepare_access(picture->alphaMap->pDrawable, mode)) {
 
80
                uxa_finish_access(picture->pDrawable);
 
81
                return FALSE;
 
82
        }
 
83
 
 
84
        return TRUE;
 
85
}
 
86
 
 
87
void uxa_picture_finish_access(PicturePtr picture)
 
88
{
 
89
        if (picture->pDrawable == NULL)
 
90
                return;
 
91
 
 
92
        uxa_finish_access(picture->pDrawable);
 
93
        if (picture->alphaMap)
 
94
                uxa_finish_access(picture->alphaMap->pDrawable);
 
95
}
 
96
 
 
97
 
70
98
char uxa_drawable_location(DrawablePtr pDrawable)
71
99
{
72
100
        return uxa_drawable_is_offscreen(pDrawable) ? 's' : 'm';
362
390
 
363
391
        UXA_FALLBACK(("from picts %p/%p to pict %p\n", pSrc, pMask, pDst));
364
392
 
365
 
        if (uxa_prepare_access(pDst->pDrawable, UXA_ACCESS_RW)) {
366
 
                if (pSrc->pDrawable == NULL ||
367
 
                    uxa_prepare_access(pSrc->pDrawable, UXA_ACCESS_RO)) {
368
 
                        if (!pMask || pMask->pDrawable == NULL ||
369
 
                            uxa_prepare_access(pMask->pDrawable, UXA_ACCESS_RO))
370
 
                        {
 
393
        if (uxa_picture_prepare_access(pDst, UXA_ACCESS_RW)) {
 
394
                if (uxa_picture_prepare_access(pSrc, UXA_ACCESS_RO)) {
 
395
                        if (!pMask || uxa_picture_prepare_access(pMask, UXA_ACCESS_RO)) {
371
396
                                fbComposite(op, pSrc, pMask, pDst,
372
397
                                            xSrc, ySrc,
373
398
                                            xMask, yMask,
374
399
                                            xDst, yDst,
375
400
                                            width, height);
376
 
                                if (pMask && pMask->pDrawable != NULL)
377
 
                                        uxa_finish_access(pMask->pDrawable);
 
401
                                if (pMask)
 
402
                                        uxa_picture_finish_access(pMask);
378
403
                        }
379
 
                        if (pSrc->pDrawable != NULL)
380
 
                                uxa_finish_access(pSrc->pDrawable);
 
404
                        uxa_picture_finish_access(pSrc);
381
405
                }
382
 
                uxa_finish_access(pDst->pDrawable);
 
406
                uxa_picture_finish_access(pDst);
383
407
        }
384
408
}
385
409
 
391
415
 
392
416
        UXA_FALLBACK(("to pict %p (%c)\n", pPicture,
393
417
                      uxa_drawable_location(pPicture->pDrawable)));
394
 
        if (uxa_prepare_access(pPicture->pDrawable, UXA_ACCESS_RW)) {
 
418
        if (uxa_picture_prepare_access(pPicture, UXA_ACCESS_RW)) {
395
419
                fbAddTraps(pPicture, x_off, y_off, ntrap, traps);
396
 
                uxa_finish_access(pPicture->pDrawable);
 
420
                uxa_picture_finish_access(pPicture);
397
421
        }
398
422
}
399
423