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

« back to all changes in this revision

Viewing changes to render/mipict.c

  • Committer: Package Import Robot
  • Author(s): Christopher James Halse Rogers
  • Date: 2012-01-23 16:09:29 UTC
  • mfrom: (1.1.46) (0.11.34 sid)
  • Revision ID: package-import@ubuntu.com-20120123160929-k4xdb9b7xeesiukp
Tags: 2:1.11.3-0ubuntu8
* debian/patches/224_return_BadWindow_not_BadMatch.diff:
  - Fix the error values of a whole slew of window-related calls.
    Fixes some gnome-settings-daemon aborts in XLib (LP: #903973)

Show diffs side-by-side

added added

removed removed

Lines of Context:
333
333
    return TRUE;
334
334
}
335
335
 
336
 
void
337
 
miCompositeSourceValidate (PicturePtr   pPicture,
338
 
                           INT16        x,
339
 
                           INT16        y,
340
 
                           CARD16       width,
341
 
                           CARD16       height)
 
336
static void
 
337
SourceValidateOnePicture (PicturePtr pPicture)
342
338
{
343
339
    DrawablePtr pDrawable = pPicture->pDrawable;
344
340
    ScreenPtr   pScreen;
347
343
        return;
348
344
 
349
345
    pScreen = pDrawable->pScreen;
350
 
    
 
346
 
351
347
    if (pScreen->SourceValidate)
352
348
    {
353
 
        if (pPicture->transform)
354
 
        {
355
 
            xPoint          points[4];
356
 
            int             i;
357
 
            int             xmin, ymin, xmax, ymax;
358
 
 
359
 
#define VectorSet(i,_x,_y) { points[i].x = _x; points[i].y = _y; }
360
 
            VectorSet (0, x, y);
361
 
            VectorSet (1, x + width, y);
362
 
            VectorSet (2, x, y + height);
363
 
            VectorSet (3, x + width, y + height);
364
 
            xmin = ymin = 32767;
365
 
            xmax = ymax = -32737;
366
 
            for (i = 0; i < 4; i++)
367
 
            {
368
 
                PictVector  t;
369
 
                t.vector[0] = IntToxFixed (points[i].x);
370
 
                t.vector[1] = IntToxFixed (points[i].y);
371
 
                t.vector[2] = xFixed1;
372
 
                if (pixman_transform_point (pPicture->transform, &t))
373
 
                {
374
 
                    int tx = xFixedToInt (t.vector[0]);
375
 
                    int ty = xFixedToInt (t.vector[1]);
376
 
                    if (tx < xmin) xmin = tx;
377
 
                    if (tx > xmax) xmax = tx;
378
 
                    if (ty < ymin) ymin = ty;
379
 
                    if (ty > ymax) ymax = ty;
380
 
                }
381
 
            }
382
 
            x = xmin;
383
 
            y = ymin;
384
 
            width = xmax - xmin;
385
 
            height = ymax - ymin;
386
 
        }
387
 
        x += pPicture->pDrawable->x;
388
 
        y += pPicture->pDrawable->y;
389
 
        (*pScreen->SourceValidate) (pDrawable, x, y, width, height,
390
 
                                    pPicture->subWindowMode);
 
349
        pScreen->SourceValidate (
 
350
            pDrawable, 0, 0, pDrawable->width, pDrawable->height, pPicture->subWindowMode);
391
351
    }
392
352
}
393
353
 
 
354
void
 
355
miCompositeSourceValidate (PicturePtr pPicture)
 
356
{
 
357
    SourceValidateOnePicture (pPicture);
 
358
    if (pPicture->alphaMap)
 
359
        SourceValidateOnePicture (pPicture->alphaMap);
 
360
}
 
361
 
394
362
/*
395
363
 * returns FALSE if the final region is empty.  Indistinguishable from
396
364
 * an allocation failure, but rendering ignores those anyways.
480
448
    }
481
449
 
482
450
    
483
 
    miCompositeSourceValidate (pSrc, xSrc, ySrc, width, height);
 
451
    miCompositeSourceValidate (pSrc);
484
452
    if (pMask)
485
 
        miCompositeSourceValidate (pMask, xMask, yMask, width, height);
 
453
        miCompositeSourceValidate (pMask);
486
454
 
487
455
    return TRUE;
488
456
}
631
599
    ps->Composite       = 0;                    /* requires DDX support */
632
600
    ps->Glyphs          = miGlyphs;
633
601
    ps->CompositeRects  = miCompositeRects;
634
 
    ps->Trapezoids      = miTrapezoids;
635
 
    ps->Triangles       = miTriangles;
636
 
    ps->TriStrip        = miTriStrip;
637
 
    ps->TriFan          = miTriFan;
 
602
    ps->Trapezoids      = 0;
 
603
    ps->Triangles       = 0;
638
604
    
639
605
    ps->RasterizeTrapezoid = 0;                 /* requires DDX support */
640
606
    ps->AddTraps        = 0;                    /* requires DDX support */