mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-01-06 16:40:12 +01:00
render: Brought in changes from xorg-server-1.4-apple
This commit is contained in:
parent
b1927d88d5
commit
1a3846bb3b
12 changed files with 290 additions and 445 deletions
|
|
@ -87,8 +87,8 @@ static CursorBits animCursorBits = {
|
|||
empty, empty, 2, 1, 1, 0, 0, 1
|
||||
};
|
||||
|
||||
int AnimCurScreenPrivateIndex = -1;
|
||||
int AnimCurGeneration;
|
||||
static int AnimCurScreenPrivateIndex = -1;
|
||||
static int AnimCurGeneration;
|
||||
|
||||
#define IsAnimCur(c) ((c)->bits == &animCursorBits)
|
||||
#define GetAnimCur(c) ((AnimCurPtr) ((c) + 1))
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright © 2002 Keith Packard
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
|
|
|
|||
|
|
@ -77,22 +77,22 @@ static GlyphHashSetRec glyphHashSets[] = {
|
|||
|
||||
#define NGLYPHHASHSETS (sizeof(glyphHashSets)/sizeof(glyphHashSets[0]))
|
||||
|
||||
const CARD8 glyphDepths[GlyphFormatNum] = { 1, 4, 8, 16, 32 };
|
||||
static const CARD8 glyphDepths[GlyphFormatNum] = { 1, 4, 8, 16, 32 };
|
||||
|
||||
GlyphHashRec globalGlyphs[GlyphFormatNum];
|
||||
static GlyphHashRec globalGlyphs[GlyphFormatNum];
|
||||
|
||||
int globalTotalGlyphPrivateSize = 0;
|
||||
static int globalTotalGlyphPrivateSize = 0;
|
||||
|
||||
static int glyphPrivateCount = 0;
|
||||
|
||||
void
|
||||
ResetGlyphPrivates ()
|
||||
ResetGlyphPrivates (void)
|
||||
{
|
||||
glyphPrivateCount = 0;
|
||||
}
|
||||
|
||||
int
|
||||
AllocateGlyphPrivateIndex ()
|
||||
AllocateGlyphPrivateIndex (void)
|
||||
{
|
||||
return glyphPrivateCount++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
#ifndef _GLYPHSTR_H_
|
||||
#define _GLYPHSTR_H_
|
||||
|
||||
#include <X11/Xdefs.h>
|
||||
#include <X11/extensions/renderproto.h>
|
||||
#include "picture.h"
|
||||
#include "screenint.h"
|
||||
|
|
@ -92,8 +91,6 @@ typedef struct _GlyphList {
|
|||
PictFormatPtr format;
|
||||
} GlyphListRec, *GlyphListPtr;
|
||||
|
||||
extern GlyphHashRec globalGlyphs[GlyphFormatNum];
|
||||
|
||||
GlyphHashSetPtr
|
||||
FindGlyphHashSet (CARD32 filled);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
/*
|
||||
*
|
||||
* Copyright © 1999 Keith Packard
|
||||
*
|
||||
|
|
@ -266,19 +266,19 @@ miChangePictureFilter (PicturePtr pPicture,
|
|||
|
||||
#define BOUND(v) (INT16) ((v) < MINSHORT ? MINSHORT : (v) > MAXSHORT ? MAXSHORT : (v))
|
||||
|
||||
static __inline Bool
|
||||
miClipPictureReg (RegionPtr pRegion,
|
||||
RegionPtr pClip,
|
||||
static inline pixman_bool_t
|
||||
miClipPictureReg (pixman_region16_t * pRegion,
|
||||
pixman_region16_t * pClip,
|
||||
int dx,
|
||||
int dy)
|
||||
{
|
||||
if (REGION_NUM_RECTS(pRegion) == 1 &&
|
||||
REGION_NUM_RECTS(pClip) == 1)
|
||||
if (pixman_region_n_rects(pRegion) == 1 &&
|
||||
pixman_region_n_rects(pClip) == 1)
|
||||
{
|
||||
BoxPtr pRbox = REGION_RECTS(pRegion);
|
||||
BoxPtr pCbox = REGION_RECTS(pClip);
|
||||
pixman_box16_t * pRbox = pixman_region_rectangles(pRegion, NULL);
|
||||
pixman_box16_t * pCbox = pixman_region_rectangles(pClip, NULL);
|
||||
int v;
|
||||
|
||||
|
||||
if (pRbox->x1 < (v = pCbox->x1 + dx))
|
||||
pRbox->x1 = BOUND(v);
|
||||
if (pRbox->x2 > (v = pCbox->x2 + dx))
|
||||
|
|
@ -290,23 +290,23 @@ miClipPictureReg (RegionPtr pRegion,
|
|||
if (pRbox->x1 >= pRbox->x2 ||
|
||||
pRbox->y1 >= pRbox->y2)
|
||||
{
|
||||
REGION_EMPTY(pScreen, pRegion);
|
||||
pixman_region_init (pRegion);
|
||||
}
|
||||
}
|
||||
else if (!REGION_NOTEMPTY (pScreen, pClip))
|
||||
else if (!pixman_region_not_empty (pClip))
|
||||
return FALSE;
|
||||
else
|
||||
{
|
||||
if (dx || dy)
|
||||
REGION_TRANSLATE(pScreen, pRegion, -dx, -dy);
|
||||
if (!REGION_INTERSECT (pScreen, pRegion, pRegion, pClip))
|
||||
pixman_region_translate (pRegion, -dx, -dy);
|
||||
if (!pixman_region_intersect (pRegion, pRegion, pClip))
|
||||
return FALSE;
|
||||
if (dx || dy)
|
||||
REGION_TRANSLATE(pScreen, pRegion, dx, dy);
|
||||
pixman_region_translate(pRegion, dx, dy);
|
||||
}
|
||||
return REGION_NOTEMPTY(pScreen, pRegion);
|
||||
return pixman_region_not_empty(pRegion);
|
||||
}
|
||||
|
||||
|
||||
static __inline Bool
|
||||
miClipPictureSrc (RegionPtr pRegion,
|
||||
PicturePtr pPicture,
|
||||
|
|
@ -320,13 +320,13 @@ miClipPictureSrc (RegionPtr pRegion,
|
|||
{
|
||||
if (pPicture->clientClipType != CT_NONE)
|
||||
{
|
||||
REGION_TRANSLATE(pScreen, pRegion,
|
||||
pixman_region_translate ( pRegion,
|
||||
dx - pPicture->clipOrigin.x,
|
||||
dy - pPicture->clipOrigin.y);
|
||||
if (!REGION_INTERSECT (pScreen, pRegion, pRegion,
|
||||
(RegionPtr) pPicture->clientClip))
|
||||
(RegionPtr) pPicture->pCompositeClip)) // clientClip))
|
||||
return FALSE;
|
||||
REGION_TRANSLATE(pScreen, pRegion,
|
||||
pixman_region_translate ( pRegion,
|
||||
- (dx - pPicture->clipOrigin.x),
|
||||
- (dy - pPicture->clipOrigin.y));
|
||||
}
|
||||
|
|
@ -341,7 +341,7 @@ miClipPictureSrc (RegionPtr pRegion,
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
miCompositeSourceValidate (PicturePtr pPicture,
|
||||
INT16 x,
|
||||
INT16 y,
|
||||
|
|
@ -417,6 +417,7 @@ miComputeCompositeRegion (RegionPtr pRegion,
|
|||
CARD16 width,
|
||||
CARD16 height)
|
||||
{
|
||||
|
||||
int v;
|
||||
|
||||
pRegion->extents.x1 = xDst;
|
||||
|
|
@ -430,13 +431,13 @@ miComputeCompositeRegion (RegionPtr pRegion,
|
|||
if (pRegion->extents.x1 >= pRegion->extents.x2 ||
|
||||
pRegion->extents.y1 >= pRegion->extents.y2)
|
||||
{
|
||||
REGION_EMPTY (pDst->pDrawable->pScreen, pRegion);
|
||||
pixman_region_init (pRegion);
|
||||
return FALSE;
|
||||
}
|
||||
/* clip against dst */
|
||||
if (!miClipPictureReg (pRegion, pDst->pCompositeClip, 0, 0))
|
||||
{
|
||||
REGION_UNINIT (pScreen, pRegion);
|
||||
pixman_region_fini (pRegion);
|
||||
return FALSE;
|
||||
}
|
||||
if (pDst->alphaMap)
|
||||
|
|
@ -445,14 +446,14 @@ miComputeCompositeRegion (RegionPtr pRegion,
|
|||
-pDst->alphaOrigin.x,
|
||||
-pDst->alphaOrigin.y))
|
||||
{
|
||||
REGION_UNINIT (pScreen, pRegion);
|
||||
pixman_region_fini (pRegion);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
/* clip against src */
|
||||
if (!miClipPictureSrc (pRegion, pSrc, xDst - xSrc, yDst - ySrc))
|
||||
{
|
||||
REGION_UNINIT (pScreen, pRegion);
|
||||
pixman_region_fini (pRegion);
|
||||
return FALSE;
|
||||
}
|
||||
if (pSrc->alphaMap)
|
||||
|
|
@ -461,7 +462,7 @@ miComputeCompositeRegion (RegionPtr pRegion,
|
|||
xDst - (xSrc + pSrc->alphaOrigin.x),
|
||||
yDst - (ySrc + pSrc->alphaOrigin.y)))
|
||||
{
|
||||
REGION_UNINIT (pScreen, pRegion);
|
||||
pixman_region_fini (pRegion);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -470,7 +471,7 @@ miComputeCompositeRegion (RegionPtr pRegion,
|
|||
{
|
||||
if (!miClipPictureSrc (pRegion, pMask, xDst - xMask, yDst - yMask))
|
||||
{
|
||||
REGION_UNINIT (pScreen, pRegion);
|
||||
pixman_region_fini (pRegion);
|
||||
return FALSE;
|
||||
}
|
||||
if (pMask->alphaMap)
|
||||
|
|
@ -479,14 +480,17 @@ miComputeCompositeRegion (RegionPtr pRegion,
|
|||
xDst - (xMask + pMask->alphaOrigin.x),
|
||||
yDst - (yMask + pMask->alphaOrigin.y)))
|
||||
{
|
||||
REGION_UNINIT (pScreen, pRegion);
|
||||
pixman_region_fini (pRegion);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
miCompositeSourceValidate (pSrc, xSrc, ySrc, width, height);
|
||||
if (pMask)
|
||||
miCompositeSourceValidate (pMask, xMask, yMask, width, height);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,6 +88,12 @@ miClipPicture (RegionPtr pRegion,
|
|||
INT16 xPict,
|
||||
INT16 yPict);
|
||||
|
||||
void
|
||||
miCompositeSourceValidate (PicturePtr pPicture,
|
||||
INT16 x,
|
||||
INT16 y,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
Bool
|
||||
miComputeCompositeRegion (RegionPtr pRegion,
|
||||
PicturePtr pSrc,
|
||||
|
|
|
|||
146
render/picture.c
146
render/picture.c
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
_X_EXPORT int PictureScreenPrivateIndex = -1;
|
||||
int PictureWindowPrivateIndex;
|
||||
int PictureGeneration;
|
||||
static int PictureGeneration;
|
||||
RESTYPE PictureType;
|
||||
RESTYPE PictFormatType;
|
||||
RESTYPE GlyphSetType;
|
||||
|
|
@ -890,54 +890,22 @@ static unsigned int INTERPOLATE_PIXEL_256(unsigned int x, unsigned int a,
|
|||
return x;
|
||||
}
|
||||
|
||||
static void initGradientColorTable(SourcePictPtr pGradient, int *error)
|
||||
CARD32
|
||||
PictureGradientColor (PictGradientStopPtr stop1,
|
||||
PictGradientStopPtr stop2,
|
||||
CARD32 x)
|
||||
{
|
||||
int begin_pos, end_pos;
|
||||
xFixed incr, dpos;
|
||||
int pos, current_stop;
|
||||
PictGradientStopPtr stops = pGradient->linear.stops;
|
||||
int nstops = pGradient->linear.nstops;
|
||||
CARD32 current_color, next_color;
|
||||
int dist, idist;
|
||||
|
||||
/* The position where the gradient begins and ends */
|
||||
begin_pos = (stops[0].x * PICT_GRADIENT_STOPTABLE_SIZE) >> 16;
|
||||
end_pos = (stops[nstops - 1].x * PICT_GRADIENT_STOPTABLE_SIZE) >> 16;
|
||||
current_color = xRenderColorToCard32 (stop1->color);
|
||||
next_color = xRenderColorToCard32 (stop2->color);
|
||||
|
||||
pos = 0; /* The position in the color table. */
|
||||
dist = (int) (256 * (x - stop1->x) / (stop2->x - stop1->x));
|
||||
idist = 256 - dist;
|
||||
|
||||
/* Up to first point */
|
||||
while (pos <= begin_pos) {
|
||||
pGradient->linear.colorTable[pos] = xRenderColorToCard32(stops[0].color);
|
||||
++pos;
|
||||
}
|
||||
|
||||
incr = (1<<16)/ PICT_GRADIENT_STOPTABLE_SIZE; /* the double increment. */
|
||||
dpos = incr * pos; /* The position in terms of 0-1. */
|
||||
|
||||
current_stop = 0; /* We always interpolate between current and current + 1. */
|
||||
|
||||
/* Gradient area */
|
||||
while (pos < end_pos) {
|
||||
unsigned int current_color = xRenderColorToCard32(stops[current_stop].color);
|
||||
unsigned int next_color = xRenderColorToCard32(stops[current_stop + 1].color);
|
||||
|
||||
int dist = (int)(256*(dpos - stops[current_stop].x)
|
||||
/ (stops[current_stop+1].x - stops[current_stop].x));
|
||||
int idist = 256 - dist;
|
||||
|
||||
pGradient->linear.colorTable[pos] = premultiply(INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist));
|
||||
|
||||
++pos;
|
||||
dpos += incr;
|
||||
|
||||
if (dpos > stops[current_stop + 1].x)
|
||||
++current_stop;
|
||||
}
|
||||
|
||||
/* After last point */
|
||||
while (pos < PICT_GRADIENT_STOPTABLE_SIZE) {
|
||||
pGradient->linear.colorTable[pos] = xRenderColorToCard32(stops[nstops - 1].color);
|
||||
++pos;
|
||||
}
|
||||
return premultiply (INTERPOLATE_PIXEL_256 (current_color, idist,
|
||||
next_color, dist));
|
||||
}
|
||||
|
||||
static void initGradient(SourcePictPtr pGradient, int stopCount,
|
||||
|
|
@ -953,26 +921,30 @@ static void initGradient(SourcePictPtr pGradient, int stopCount,
|
|||
|
||||
dpos = -1;
|
||||
for (i = 0; i < stopCount; ++i) {
|
||||
if (stopPoints[i] <= dpos || stopPoints[i] > (1<<16)) {
|
||||
if (stopPoints[i] < dpos || stopPoints[i] > (1<<16)) {
|
||||
*error = BadValue;
|
||||
return;
|
||||
}
|
||||
dpos = stopPoints[i];
|
||||
}
|
||||
|
||||
pGradient->linear.stops = xalloc(stopCount*sizeof(PictGradientStop));
|
||||
if (!pGradient->linear.stops) {
|
||||
pGradient->gradient.stops = xalloc(stopCount*sizeof(PictGradientStop));
|
||||
if (!pGradient->gradient.stops) {
|
||||
*error = BadAlloc;
|
||||
return;
|
||||
}
|
||||
|
||||
pGradient->linear.nstops = stopCount;
|
||||
pGradient->gradient.nstops = stopCount;
|
||||
|
||||
for (i = 0; i < stopCount; ++i) {
|
||||
pGradient->linear.stops[i].x = stopPoints[i];
|
||||
pGradient->linear.stops[i].color = stopColors[i];
|
||||
pGradient->gradient.stops[i].x = stopPoints[i];
|
||||
pGradient->gradient.stops[i].color = stopColors[i];
|
||||
}
|
||||
initGradientColorTable(pGradient, error);
|
||||
|
||||
pGradient->gradient.class = SourcePictClassUnknown;
|
||||
pGradient->gradient.stopRange = 0xffff;
|
||||
pGradient->gradient.colorTable = NULL;
|
||||
pGradient->gradient.colorTableSize = 0;
|
||||
}
|
||||
|
||||
static PicturePtr createSourcePicture(void)
|
||||
|
|
@ -980,9 +952,9 @@ static PicturePtr createSourcePicture(void)
|
|||
PicturePtr pPicture;
|
||||
pPicture = (PicturePtr) xalloc(sizeof(PictureRec));
|
||||
pPicture->pDrawable = 0;
|
||||
pPicture->format = PICT_a8r8g8b8;
|
||||
pPicture->pFormat = 0;
|
||||
pPicture->pNext = 0;
|
||||
pPicture->format = PICT_a8r8g8b8;
|
||||
pPicture->devPrivates = 0;
|
||||
|
||||
SetPictureToDefaults(pPicture);
|
||||
|
|
@ -1027,10 +999,6 @@ CreateLinearGradientPicture (Picture pid, xPointFixed *p1, xPointFixed *p2,
|
|||
*error = BadAlloc;
|
||||
return 0;
|
||||
}
|
||||
if (p1->x == p2->x && p1->y == p2->y) {
|
||||
*error = BadValue;
|
||||
return 0;
|
||||
}
|
||||
|
||||
pPicture->id = pid;
|
||||
pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictLinearGradient));
|
||||
|
|
@ -1072,14 +1040,6 @@ CreateRadialGradientPicture (Picture pid, xPointFixed *inner, xPointFixed *outer
|
|||
*error = BadAlloc;
|
||||
return 0;
|
||||
}
|
||||
{
|
||||
double dx = (double)(inner->x - outer->x);
|
||||
double dy = (double)(inner->y - outer->y);
|
||||
if (sqrt(dx*dx + dy*dy) + (double)(innerRadius) > (double)(outerRadius)) {
|
||||
*error = BadValue;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
pPicture->id = pid;
|
||||
pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictRadialGradient));
|
||||
|
|
@ -1091,22 +1051,19 @@ CreateRadialGradientPicture (Picture pid, xPointFixed *inner, xPointFixed *outer
|
|||
radial = &pPicture->pSourcePict->radial;
|
||||
|
||||
radial->type = SourcePictTypeRadial;
|
||||
{
|
||||
double x = (double)innerRadius / (double)outerRadius;
|
||||
radial->dx = (outer->x - inner->x);
|
||||
radial->dy = (outer->y - inner->y);
|
||||
radial->fx = (inner->x) - x*radial->dx;
|
||||
radial->fy = (inner->y) - x*radial->dy;
|
||||
radial->m = 1./(1+x);
|
||||
radial->b = -x*radial->m;
|
||||
radial->dx /= 65536.;
|
||||
radial->dy /= 65536.;
|
||||
radial->fx /= 65536.;
|
||||
radial->fy /= 65536.;
|
||||
x = outerRadius/65536.;
|
||||
radial->a = x*x - radial->dx*radial->dx - radial->dy*radial->dy;
|
||||
}
|
||||
|
||||
radial->c1.x = inner->x;
|
||||
radial->c1.y = inner->y;
|
||||
radial->c1.radius = innerRadius;
|
||||
radial->c2.x = outer->x;
|
||||
radial->c2.y = outer->y;
|
||||
radial->c2.radius = outerRadius;
|
||||
radial->cdx = (radial->c2.x - radial->c1.x) / 65536.;
|
||||
radial->cdy = (radial->c2.y - radial->c1.y) / 65536.;
|
||||
radial->dr = (radial->c2.radius - radial->c1.radius) / 65536.;
|
||||
radial->A = ( radial->cdx * radial->cdx
|
||||
+ radial->cdy * radial->cdy
|
||||
- radial->dr * radial->dr);
|
||||
|
||||
initGradient(pPicture->pSourcePict, nStops, stops, colors, error);
|
||||
if (*error) {
|
||||
xfree(pPicture);
|
||||
|
|
@ -1209,7 +1166,7 @@ ChangePicture (PicturePtr pPicture,
|
|||
pAlpha = (PicturePtr) SecurityLookupIDByType(client,
|
||||
pid,
|
||||
PictureType,
|
||||
SecurityWriteAccess|SecurityReadAccess);
|
||||
DixWriteAccess|DixReadAccess);
|
||||
if (!pAlpha)
|
||||
{
|
||||
client->errorValue = pid;
|
||||
|
|
@ -1271,7 +1228,7 @@ ChangePicture (PicturePtr pPicture,
|
|||
pPixmap = (PixmapPtr)SecurityLookupIDByType(client,
|
||||
pid,
|
||||
RT_PIXMAP,
|
||||
SecurityReadAccess);
|
||||
DixReadAccess);
|
||||
if (!pPixmap)
|
||||
{
|
||||
client->errorValue = pid;
|
||||
|
|
@ -1627,13 +1584,17 @@ FreePicture (pointer value,
|
|||
{
|
||||
if (pPicture->transform)
|
||||
xfree (pPicture->transform);
|
||||
if (!pPicture->pDrawable) {
|
||||
if (pPicture->pSourcePict) {
|
||||
if (pPicture->pSourcePict->type != SourcePictTypeSolidFill)
|
||||
xfree(pPicture->pSourcePict->linear.stops);
|
||||
xfree(pPicture->pSourcePict);
|
||||
}
|
||||
} else {
|
||||
|
||||
if (pPicture->pSourcePict)
|
||||
{
|
||||
if (pPicture->pSourcePict->type != SourcePictTypeSolidFill)
|
||||
xfree(pPicture->pSourcePict->linear.stops);
|
||||
|
||||
xfree(pPicture->pSourcePict);
|
||||
}
|
||||
|
||||
if (pPicture->pDrawable)
|
||||
{
|
||||
ScreenPtr pScreen = pPicture->pDrawable->pScreen;
|
||||
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
||||
|
||||
|
|
@ -1680,7 +1641,7 @@ FreePictFormat (pointer pPictFormat,
|
|||
* unnecessary. It may also avoid destination reads sometimes if apps aren't
|
||||
* being careful to avoid these cases.
|
||||
*/
|
||||
static Bool
|
||||
static CARD8
|
||||
ReduceCompositeOp (CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst)
|
||||
{
|
||||
Bool no_src_alpha, no_dst_alpha;
|
||||
|
|
@ -1918,9 +1879,6 @@ AddTraps (PicturePtr pPicture,
|
|||
(*ps->AddTraps) (pPicture, xOff, yOff, ntrap, traps);
|
||||
}
|
||||
|
||||
#define MAX_FIXED_48_16 ((xFixed_48_16) 0x7fffffff)
|
||||
#define MIN_FIXED_48_16 (-((xFixed_48_16) 1 << 31))
|
||||
|
||||
_X_EXPORT Bool
|
||||
PictureTransformPoint3d (PictTransformPtr transform,
|
||||
PictVectorPtr vector)
|
||||
|
|
|
|||
164
render/picture.h
164
render/picture.h
|
|
@ -25,6 +25,8 @@
|
|||
#ifndef _PICTURE_H_
|
||||
#define _PICTURE_H_
|
||||
|
||||
#include <pixman.h>
|
||||
|
||||
typedef struct _DirectFormat *DirectFormatPtr;
|
||||
typedef struct _PictFormat *PictFormatPtr;
|
||||
typedef struct _Picture *PicturePtr;
|
||||
|
|
@ -34,12 +36,7 @@ typedef struct _Picture *PicturePtr;
|
|||
* sample implementation allows only packed RGB and GBR
|
||||
* representations for data to simplify software rendering,
|
||||
*/
|
||||
#define PICT_FORMAT(bpp,type,a,r,g,b) (((bpp) << 24) | \
|
||||
((type) << 16) | \
|
||||
((a) << 12) | \
|
||||
((r) << 8) | \
|
||||
((g) << 4) | \
|
||||
((b)))
|
||||
#define PICT_FORMAT(bpp,type,a,r,g,b) PIXMAN_FORMAT(bpp, type, a, r, g, b)
|
||||
|
||||
/*
|
||||
* gray/color formats use a visual index instead of argb
|
||||
|
|
@ -48,77 +45,77 @@ typedef struct _Picture *PicturePtr;
|
|||
((type) << 16) | \
|
||||
((vi)))
|
||||
|
||||
#define PICT_FORMAT_BPP(f) (((f) >> 24) )
|
||||
#define PICT_FORMAT_TYPE(f) (((f) >> 16) & 0xff)
|
||||
#define PICT_FORMAT_A(f) (((f) >> 12) & 0x0f)
|
||||
#define PICT_FORMAT_R(f) (((f) >> 8) & 0x0f)
|
||||
#define PICT_FORMAT_G(f) (((f) >> 4) & 0x0f)
|
||||
#define PICT_FORMAT_B(f) (((f) ) & 0x0f)
|
||||
#define PICT_FORMAT_RGB(f) (((f) ) & 0xfff)
|
||||
#define PICT_FORMAT_VIS(f) (((f) ) & 0xffff)
|
||||
#define PICT_FORMAT_BPP(f) PIXMAN_FORMAT_BPP(f)
|
||||
#define PICT_FORMAT_TYPE(f) PIXMAN_FORMAT_TYPE(f)
|
||||
#define PICT_FORMAT_A(f) PIXMAN_FORMAT_A(f)
|
||||
#define PICT_FORMAT_R(f) PIXMAN_FORMAT_R(f)
|
||||
#define PICT_FORMAT_G(f) PIXMAN_FORMAT_G(f)
|
||||
#define PICT_FORMAT_B(f) PIXMAN_FORMAT_B(f)
|
||||
#define PICT_FORMAT_RGB(f) PIXMAN_FORMAT_RGB(f)
|
||||
#define PICT_FORMAT_VIS(f) PIXMAN_FORMAT_VIS(f)
|
||||
|
||||
#define PICT_TYPE_OTHER 0
|
||||
#define PICT_TYPE_A 1
|
||||
#define PICT_TYPE_ARGB 2
|
||||
#define PICT_TYPE_ABGR 3
|
||||
#define PICT_TYPE_COLOR 4
|
||||
#define PICT_TYPE_GRAY 5
|
||||
#define PICT_TYPE_OTHER PIXMAN_TYPE_OTHER
|
||||
#define PICT_TYPE_A PIXMAN_TYPE_A
|
||||
#define PICT_TYPE_ARGB PIXMAN_TYPE_ARGB
|
||||
#define PICT_TYPE_ABGR PIXMAN_TYPE_ABGR
|
||||
#define PICT_TYPE_COLOR PIXMAN_TYPE_COLOR
|
||||
#define PICT_TYPE_GRAY PIXMAN_TYPE_GRAY
|
||||
|
||||
#define PICT_FORMAT_COLOR(f) (PICT_FORMAT_TYPE(f) & 2)
|
||||
#define PICT_FORMAT_COLOR(f) PIXMAN_FORMAT_COLOR(f)
|
||||
|
||||
/* 32bpp formats */
|
||||
typedef enum _PictFormatShort {
|
||||
PICT_a8r8g8b8 = PICT_FORMAT(32,PICT_TYPE_ARGB,8,8,8,8),
|
||||
PICT_x8r8g8b8 = PICT_FORMAT(32,PICT_TYPE_ARGB,0,8,8,8),
|
||||
PICT_a8b8g8r8 = PICT_FORMAT(32,PICT_TYPE_ABGR,8,8,8,8),
|
||||
PICT_x8b8g8r8 = PICT_FORMAT(32,PICT_TYPE_ABGR,0,8,8,8),
|
||||
PICT_a8r8g8b8 = PIXMAN_a8r8g8b8,
|
||||
PICT_x8r8g8b8 = PIXMAN_x8r8g8b8,
|
||||
PICT_a8b8g8r8 = PIXMAN_a8b8g8r8,
|
||||
PICT_x8b8g8r8 = PIXMAN_x8b8g8r8,
|
||||
|
||||
/* 24bpp formats */
|
||||
PICT_r8g8b8 = PICT_FORMAT(24,PICT_TYPE_ARGB,0,8,8,8),
|
||||
PICT_b8g8r8 = PICT_FORMAT(24,PICT_TYPE_ABGR,0,8,8,8),
|
||||
PICT_r8g8b8 = PIXMAN_r8g8b8,
|
||||
PICT_b8g8r8 = PIXMAN_b8g8r8,
|
||||
|
||||
/* 16bpp formats */
|
||||
PICT_r5g6b5 = PICT_FORMAT(16,PICT_TYPE_ARGB,0,5,6,5),
|
||||
PICT_b5g6r5 = PICT_FORMAT(16,PICT_TYPE_ABGR,0,5,6,5),
|
||||
PICT_r5g6b5 = PIXMAN_r5g6b5,
|
||||
PICT_b5g6r5 = PIXMAN_b5g6r5,
|
||||
|
||||
PICT_a1r5g5b5 = PICT_FORMAT(16,PICT_TYPE_ARGB,1,5,5,5),
|
||||
PICT_x1r5g5b5 = PICT_FORMAT(16,PICT_TYPE_ARGB,0,5,5,5),
|
||||
PICT_a1b5g5r5 = PICT_FORMAT(16,PICT_TYPE_ABGR,1,5,5,5),
|
||||
PICT_x1b5g5r5 = PICT_FORMAT(16,PICT_TYPE_ABGR,0,5,5,5),
|
||||
PICT_a4r4g4b4 = PICT_FORMAT(16,PICT_TYPE_ARGB,4,4,4,4),
|
||||
PICT_x4r4g4b4 = PICT_FORMAT(16,PICT_TYPE_ARGB,0,4,4,4),
|
||||
PICT_a4b4g4r4 = PICT_FORMAT(16,PICT_TYPE_ABGR,4,4,4,4),
|
||||
PICT_x4b4g4r4 = PICT_FORMAT(16,PICT_TYPE_ABGR,0,4,4,4),
|
||||
PICT_a1r5g5b5 = PIXMAN_a1r5g5b5,
|
||||
PICT_x1r5g5b5 = PIXMAN_x1r5g5b5,
|
||||
PICT_a1b5g5r5 = PIXMAN_a1b5g5r5,
|
||||
PICT_x1b5g5r5 = PIXMAN_x1b5g5r5,
|
||||
PICT_a4r4g4b4 = PIXMAN_a4r4g4b4,
|
||||
PICT_x4r4g4b4 = PIXMAN_x4r4g4b4,
|
||||
PICT_a4b4g4r4 = PIXMAN_a4b4g4r4,
|
||||
PICT_x4b4g4r4 = PIXMAN_x4b4g4r4,
|
||||
|
||||
/* 8bpp formats */
|
||||
PICT_a8 = PICT_FORMAT(8,PICT_TYPE_A,8,0,0,0),
|
||||
PICT_r3g3b2 = PICT_FORMAT(8,PICT_TYPE_ARGB,0,3,3,2),
|
||||
PICT_b2g3r3 = PICT_FORMAT(8,PICT_TYPE_ABGR,0,3,3,2),
|
||||
PICT_a2r2g2b2 = PICT_FORMAT(8,PICT_TYPE_ARGB,2,2,2,2),
|
||||
PICT_a2b2g2r2 = PICT_FORMAT(8,PICT_TYPE_ABGR,2,2,2,2),
|
||||
PICT_a8 = PIXMAN_a8,
|
||||
PICT_r3g3b2 = PIXMAN_r3g3b2,
|
||||
PICT_b2g3r3 = PIXMAN_b2g3r3,
|
||||
PICT_a2r2g2b2 = PIXMAN_a2r2g2b2,
|
||||
PICT_a2b2g2r2 = PIXMAN_a2b2g2r2,
|
||||
|
||||
PICT_c8 = PICT_FORMAT(8,PICT_TYPE_COLOR,0,0,0,0),
|
||||
PICT_g8 = PICT_FORMAT(8,PICT_TYPE_GRAY,0,0,0,0),
|
||||
PICT_c8 = PIXMAN_c8,
|
||||
PICT_g8 = PIXMAN_g8,
|
||||
|
||||
PICT_x4a4 = PICT_FORMAT(8,PICT_TYPE_A,4,0,0,0),
|
||||
PICT_x4a4 = PIXMAN_x4a4,
|
||||
|
||||
PICT_x4c4 = PICT_FORMAT(8,PICT_TYPE_COLOR,0,0,0,0),
|
||||
PICT_x4g4 = PICT_FORMAT(8,PICT_TYPE_GRAY,0,0,0,0),
|
||||
PICT_x4c4 = PIXMAN_x4c4,
|
||||
PICT_x4g4 = PIXMAN_x4g4,
|
||||
|
||||
/* 4bpp formats */
|
||||
PICT_a4 = PICT_FORMAT(4,PICT_TYPE_A,4,0,0,0),
|
||||
PICT_r1g2b1 = PICT_FORMAT(4,PICT_TYPE_ARGB,0,1,2,1),
|
||||
PICT_b1g2r1 = PICT_FORMAT(4,PICT_TYPE_ABGR,0,1,2,1),
|
||||
PICT_a1r1g1b1 = PICT_FORMAT(4,PICT_TYPE_ARGB,1,1,1,1),
|
||||
PICT_a1b1g1r1 = PICT_FORMAT(4,PICT_TYPE_ABGR,1,1,1,1),
|
||||
PICT_a4 = PIXMAN_a4,
|
||||
PICT_r1g2b1 = PIXMAN_r1g2b1,
|
||||
PICT_b1g2r1 = PIXMAN_b1g2r1,
|
||||
PICT_a1r1g1b1 = PIXMAN_a1r1g1b1,
|
||||
PICT_a1b1g1r1 = PIXMAN_a1b1g1r1,
|
||||
|
||||
PICT_c4 = PICT_FORMAT(4,PICT_TYPE_COLOR,0,0,0,0),
|
||||
PICT_g4 = PICT_FORMAT(4,PICT_TYPE_GRAY,0,0,0,0),
|
||||
PICT_c4 = PIXMAN_c4,
|
||||
PICT_g4 = PIXMAN_g4,
|
||||
|
||||
/* 1bpp formats */
|
||||
PICT_a1 = PICT_FORMAT(1,PICT_TYPE_A,1,0,0,0),
|
||||
PICT_a1 = PIXMAN_a1,
|
||||
|
||||
PICT_g1 = PICT_FORMAT(1,PICT_TYPE_GRAY,0,0,0,0),
|
||||
PICT_g1 = PIXMAN_g1,
|
||||
} PictFormatShort;
|
||||
|
||||
/*
|
||||
|
|
@ -171,54 +168,35 @@ extern int RenderClientPrivateIndex;
|
|||
|
||||
/* Fixed point updates from Carl Worth, USC, Information Sciences Institute */
|
||||
|
||||
#if defined(WIN32) && !defined(__GNUC__)
|
||||
typedef __int64 xFixed_32_32;
|
||||
#else
|
||||
# if defined (_LP64) || \
|
||||
defined(__alpha__) || defined(__alpha) || \
|
||||
defined(ia64) || defined(__ia64__) || \
|
||||
defined(__sparc64__) || \
|
||||
defined(__s390x__) || \
|
||||
defined(amd64) || defined (__amd64__) || \
|
||||
(defined(sgi) && (_MIPS_SZLONG == 64))
|
||||
typedef long xFixed_32_32;
|
||||
# else
|
||||
# if defined(__GNUC__) && \
|
||||
((__GNUC__ > 2) || \
|
||||
((__GNUC__ == 2) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ > 7)))
|
||||
__extension__
|
||||
# endif
|
||||
typedef long long int xFixed_32_32;
|
||||
# endif
|
||||
#endif
|
||||
typedef pixman_fixed_32_32_t xFixed_32_32;
|
||||
|
||||
typedef xFixed_32_32 xFixed_48_16;
|
||||
typedef pixman_fixed_48_16_t xFixed_48_16;
|
||||
|
||||
#define MAX_FIXED_48_16 ((xFixed_48_16) 0x7fffffff)
|
||||
#define MIN_FIXED_48_16 (-((xFixed_48_16) 1 << 31))
|
||||
#define MAX_FIXED_48_16 pixman_max_fixed_48_16
|
||||
#define MIN_FIXED_48_16 pixman_min_fixed_48_16
|
||||
|
||||
typedef CARD32 xFixed_1_31;
|
||||
typedef CARD32 xFixed_1_16;
|
||||
typedef INT32 xFixed_16_16;
|
||||
typedef pixman_fixed_1_31_t xFixed_1_31;
|
||||
typedef pixman_fixed_1_16_t xFixed_1_16;
|
||||
typedef pixman_fixed_16_16_t xFixed_16_16;
|
||||
|
||||
/*
|
||||
* An unadorned "xFixed" is the same as xFixed_16_16,
|
||||
* (since it's quite common in the code)
|
||||
*/
|
||||
typedef xFixed_16_16 xFixed;
|
||||
typedef pixman_fixed_t xFixed;
|
||||
#define XFIXED_BITS 16
|
||||
|
||||
#define xFixedToInt(f) (int) ((f) >> XFIXED_BITS)
|
||||
#define IntToxFixed(i) ((xFixed) (i) << XFIXED_BITS)
|
||||
#define xFixedE ((xFixed) 1)
|
||||
#define xFixed1 (IntToxFixed(1))
|
||||
#define xFixed1MinusE (xFixed1 - xFixedE)
|
||||
#define xFixedFrac(f) ((f) & xFixed1MinusE)
|
||||
#define xFixedFloor(f) ((f) & ~xFixed1MinusE)
|
||||
#define xFixedCeil(f) xFixedFloor((f) + xFixed1MinusE)
|
||||
#define xFixedToInt(f) pixman_fixed_to_int(f)
|
||||
#define IntToxFixed(i) pixman_int_to_fixed(i)
|
||||
#define xFixedE pixman_fixed_e
|
||||
#define xFixed1 pixman_fixed_1
|
||||
#define xFixed1MinusE pixman_fixed_1_minus_e
|
||||
#define xFixedFrac(f) pixman_fixed_frac(f)
|
||||
#define xFixedFloor(f) pixman_fixed_floor(f)
|
||||
#define xFixedCeil(f) pixman_fixed_ceil(f)
|
||||
|
||||
#define xFixedFraction(f) ((f) & xFixed1MinusE)
|
||||
#define xFixedMod2(f) ((f) & (xFixed1 | xFixed1MinusE))
|
||||
#define xFixedFraction(f) pixman_fixed_fraction(f)
|
||||
#define xFixedMod2(f) pixman_fixed_mod2(f)
|
||||
|
||||
/* whether 't' is a well defined not obviously empty trapezoid */
|
||||
#define xTrapezoidValid(t) ((t)->left.p1.y != (t)->left.p2.y && \
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright © 2000 SuSE, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
|
|
@ -26,8 +24,8 @@
|
|||
#ifndef _PICTURESTR_H_
|
||||
#define _PICTURESTR_H_
|
||||
|
||||
#include "glyphstr.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "glyphstr.h"
|
||||
#include "resource.h"
|
||||
|
||||
typedef struct _DirectFormat {
|
||||
|
|
@ -54,13 +52,8 @@ typedef struct _PictFormat {
|
|||
IndexFormatRec index;
|
||||
} PictFormatRec;
|
||||
|
||||
typedef struct _PictVector {
|
||||
xFixed vector[3];
|
||||
} PictVector, *PictVectorPtr;
|
||||
|
||||
typedef struct _PictTransform {
|
||||
xFixed matrix[3][3];
|
||||
} PictTransform, *PictTransformPtr;
|
||||
typedef struct pixman_vector PictVector, *PictVectorPtr;
|
||||
typedef struct pixman_transform PictTransform, *PictTransformPtr;
|
||||
|
||||
#define PICT_GRADIENT_STOPTABLE_SIZE 1024
|
||||
#define SourcePictTypeSolidFill 0
|
||||
|
|
@ -68,8 +61,13 @@ typedef struct _PictTransform {
|
|||
#define SourcePictTypeRadial 2
|
||||
#define SourcePictTypeConical 3
|
||||
|
||||
#define SourcePictClassUnknown 0
|
||||
#define SourcePictClassHorizontal 1
|
||||
#define SourcePictClassVertical 2
|
||||
|
||||
typedef struct _PictSolidFill {
|
||||
unsigned int type;
|
||||
unsigned int class;
|
||||
CARD32 color;
|
||||
} PictSolidFill, *PictSolidFillPtr;
|
||||
|
||||
|
|
@ -80,39 +78,56 @@ typedef struct _PictGradientStop {
|
|||
|
||||
typedef struct _PictGradient {
|
||||
unsigned int type;
|
||||
unsigned int class;
|
||||
int nstops;
|
||||
PictGradientStopPtr stops;
|
||||
CARD32 colorTable[PICT_GRADIENT_STOPTABLE_SIZE];
|
||||
int stopRange;
|
||||
CARD32 *colorTable;
|
||||
int colorTableSize;
|
||||
} PictGradient, *PictGradientPtr;
|
||||
|
||||
typedef struct _PictLinearGradient {
|
||||
unsigned int type;
|
||||
unsigned int class;
|
||||
int nstops;
|
||||
PictGradientStopPtr stops;
|
||||
CARD32 colorTable[PICT_GRADIENT_STOPTABLE_SIZE];
|
||||
int stopRange;
|
||||
CARD32 *colorTable;
|
||||
int colorTableSize;
|
||||
xPointFixed p1;
|
||||
xPointFixed p2;
|
||||
} PictLinearGradient, *PictLinearGradientPtr;
|
||||
|
||||
typedef struct _PictCircle {
|
||||
xFixed x;
|
||||
xFixed y;
|
||||
xFixed radius;
|
||||
} PictCircle, *PictCirclePtr;
|
||||
|
||||
typedef struct _PictRadialGradient {
|
||||
unsigned int type;
|
||||
unsigned int class;
|
||||
int nstops;
|
||||
PictGradientStopPtr stops;
|
||||
CARD32 colorTable[PICT_GRADIENT_STOPTABLE_SIZE];
|
||||
double fx;
|
||||
double fy;
|
||||
double dx;
|
||||
double dy;
|
||||
double a;
|
||||
double m;
|
||||
double b;
|
||||
int stopRange;
|
||||
CARD32 *colorTable;
|
||||
int colorTableSize;
|
||||
PictCircle c1;
|
||||
PictCircle c2;
|
||||
double cdx;
|
||||
double cdy;
|
||||
double dr;
|
||||
double A;
|
||||
} PictRadialGradient, *PictRadialGradientPtr;
|
||||
|
||||
typedef struct _PictConicalGradient {
|
||||
unsigned int type;
|
||||
unsigned int class;
|
||||
int nstops;
|
||||
PictGradientStopPtr stops;
|
||||
CARD32 colorTable[PICT_GRADIENT_STOPTABLE_SIZE];
|
||||
int stopRange;
|
||||
CARD32 *colorTable;
|
||||
int colorTableSize;
|
||||
xPointFixed center;
|
||||
xFixed angle;
|
||||
} PictConicalGradient, *PictConicalGradientPtr;
|
||||
|
|
@ -624,6 +639,11 @@ Bool
|
|||
PictureTransformPoint3d (PictTransformPtr transform,
|
||||
PictVectorPtr vector);
|
||||
|
||||
CARD32
|
||||
PictureGradientColor (PictGradientStopPtr stop1,
|
||||
PictGradientStopPtr stop2,
|
||||
CARD32 x);
|
||||
|
||||
void RenderExtensionInit (void);
|
||||
|
||||
Bool
|
||||
|
|
@ -639,6 +659,10 @@ AddTraps (PicturePtr pPicture,
|
|||
int ntraps,
|
||||
xTrap *traps);
|
||||
|
||||
pixman_image_t *
|
||||
PixmanImageFromPicture (PicturePtr pPict,
|
||||
Bool hasClip);
|
||||
|
||||
PicturePtr
|
||||
CreateSolidPicture (Picture pid,
|
||||
xRenderColor *color,
|
||||
|
|
|
|||
139
render/render.c
139
render/render.c
|
|
@ -560,7 +560,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client)
|
|||
pFormat = (PictFormatPtr) SecurityLookupIDByType (client,
|
||||
stuff->format,
|
||||
PictFormatType,
|
||||
SecurityReadAccess);
|
||||
DixReadAccess);
|
||||
|
||||
if (!pFormat)
|
||||
{
|
||||
|
|
@ -620,19 +620,21 @@ ProcRenderCreatePicture (ClientPtr client)
|
|||
PicturePtr pPicture;
|
||||
DrawablePtr pDrawable;
|
||||
PictFormatPtr pFormat;
|
||||
int len;
|
||||
int error;
|
||||
int len, error, rc;
|
||||
REQUEST(xRenderCreatePictureReq);
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq);
|
||||
|
||||
LEGAL_NEW_RESOURCE(stuff->pid, client);
|
||||
SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client,
|
||||
SecurityWriteAccess);
|
||||
rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
|
||||
DixWriteAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
pFormat = (PictFormatPtr) SecurityLookupIDByType (client,
|
||||
stuff->format,
|
||||
PictFormatType,
|
||||
SecurityReadAccess);
|
||||
DixReadAccess);
|
||||
if (!pFormat)
|
||||
{
|
||||
client->errorValue = stuff->format;
|
||||
|
|
@ -666,7 +668,7 @@ ProcRenderChangePicture (ClientPtr client)
|
|||
int len;
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq);
|
||||
VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess,
|
||||
VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
|
||||
len = client->req_len - (sizeof(xRenderChangePictureReq) >> 2);
|
||||
|
|
@ -686,7 +688,7 @@ ProcRenderSetPictureClipRectangles (ClientPtr client)
|
|||
int result;
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq);
|
||||
VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess,
|
||||
VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
if (!pPicture->pDrawable)
|
||||
return BadDrawable;
|
||||
|
|
@ -712,7 +714,7 @@ ProcRenderFreePicture (ClientPtr client)
|
|||
|
||||
REQUEST_SIZE_MATCH(xRenderFreePictureReq);
|
||||
|
||||
VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityDestroyAccess,
|
||||
VERIFY_PICTURE (pPicture, stuff->picture, client, DixDestroyAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
FreeResource (stuff->picture, RT_NONE);
|
||||
return(client->noClientException);
|
||||
|
|
@ -742,13 +744,13 @@ ProcRenderComposite (ClientPtr client)
|
|||
client->errorValue = stuff->op;
|
||||
return BadValue;
|
||||
}
|
||||
VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess,
|
||||
VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
if (!pDst->pDrawable)
|
||||
return BadDrawable;
|
||||
VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess,
|
||||
VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess,
|
||||
VERIFY_ALPHA (pMask, stuff->mask, client, DixReadAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) ||
|
||||
(pMask && pMask->pDrawable && pDst->pDrawable->pScreen != pMask->pDrawable->pScreen))
|
||||
|
|
@ -788,9 +790,9 @@ ProcRenderTrapezoids (ClientPtr client)
|
|||
client->errorValue = stuff->op;
|
||||
return BadValue;
|
||||
}
|
||||
VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess,
|
||||
VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess,
|
||||
VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
if (!pDst->pDrawable)
|
||||
return BadDrawable;
|
||||
|
|
@ -801,7 +803,7 @@ ProcRenderTrapezoids (ClientPtr client)
|
|||
pFormat = (PictFormatPtr) SecurityLookupIDByType (client,
|
||||
stuff->maskFormat,
|
||||
PictFormatType,
|
||||
SecurityReadAccess);
|
||||
DixReadAccess);
|
||||
if (!pFormat)
|
||||
{
|
||||
client->errorValue = stuff->maskFormat;
|
||||
|
|
@ -835,9 +837,9 @@ ProcRenderTriangles (ClientPtr client)
|
|||
client->errorValue = stuff->op;
|
||||
return BadValue;
|
||||
}
|
||||
VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess,
|
||||
VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess,
|
||||
VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
if (!pDst->pDrawable)
|
||||
return BadDrawable;
|
||||
|
|
@ -848,7 +850,7 @@ ProcRenderTriangles (ClientPtr client)
|
|||
pFormat = (PictFormatPtr) SecurityLookupIDByType (client,
|
||||
stuff->maskFormat,
|
||||
PictFormatType,
|
||||
SecurityReadAccess);
|
||||
DixReadAccess);
|
||||
if (!pFormat)
|
||||
{
|
||||
client->errorValue = stuff->maskFormat;
|
||||
|
|
@ -882,9 +884,9 @@ ProcRenderTriStrip (ClientPtr client)
|
|||
client->errorValue = stuff->op;
|
||||
return BadValue;
|
||||
}
|
||||
VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess,
|
||||
VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess,
|
||||
VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
if (!pDst->pDrawable)
|
||||
return BadDrawable;
|
||||
|
|
@ -895,7 +897,7 @@ ProcRenderTriStrip (ClientPtr client)
|
|||
pFormat = (PictFormatPtr) SecurityLookupIDByType (client,
|
||||
stuff->maskFormat,
|
||||
PictFormatType,
|
||||
SecurityReadAccess);
|
||||
DixReadAccess);
|
||||
if (!pFormat)
|
||||
{
|
||||
client->errorValue = stuff->maskFormat;
|
||||
|
|
@ -929,9 +931,9 @@ ProcRenderTriFan (ClientPtr client)
|
|||
client->errorValue = stuff->op;
|
||||
return BadValue;
|
||||
}
|
||||
VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess,
|
||||
VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess,
|
||||
VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
if (!pDst->pDrawable)
|
||||
return BadDrawable;
|
||||
|
|
@ -942,7 +944,7 @@ ProcRenderTriFan (ClientPtr client)
|
|||
pFormat = (PictFormatPtr) SecurityLookupIDByType (client,
|
||||
stuff->maskFormat,
|
||||
PictFormatType,
|
||||
SecurityReadAccess);
|
||||
DixReadAccess);
|
||||
if (!pFormat)
|
||||
{
|
||||
client->errorValue = stuff->maskFormat;
|
||||
|
|
@ -994,7 +996,7 @@ ProcRenderCreateGlyphSet (ClientPtr client)
|
|||
format = (PictFormatPtr) SecurityLookupIDByType (client,
|
||||
stuff->format,
|
||||
PictFormatType,
|
||||
SecurityReadAccess);
|
||||
DixReadAccess);
|
||||
if (!format)
|
||||
{
|
||||
client->errorValue = stuff->format;
|
||||
|
|
@ -1042,7 +1044,7 @@ ProcRenderReferenceGlyphSet (ClientPtr client)
|
|||
glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
|
||||
stuff->existing,
|
||||
GlyphSetType,
|
||||
SecurityWriteAccess);
|
||||
DixWriteAccess);
|
||||
if (!glyphSet)
|
||||
{
|
||||
client->errorValue = stuff->existing;
|
||||
|
|
@ -1067,7 +1069,7 @@ ProcRenderFreeGlyphSet (ClientPtr client)
|
|||
glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
|
||||
stuff->glyphset,
|
||||
GlyphSetType,
|
||||
SecurityDestroyAccess);
|
||||
DixDestroyAccess);
|
||||
if (!glyphSet)
|
||||
{
|
||||
client->errorValue = stuff->glyphset;
|
||||
|
|
@ -1101,7 +1103,7 @@ ProcRenderAddGlyphs (ClientPtr client)
|
|||
glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
|
||||
stuff->glyphset,
|
||||
GlyphSetType,
|
||||
SecurityWriteAccess);
|
||||
DixWriteAccess);
|
||||
if (!glyphSet)
|
||||
{
|
||||
client->errorValue = stuff->glyphset;
|
||||
|
|
@ -1205,7 +1207,7 @@ ProcRenderFreeGlyphs (ClientPtr client)
|
|||
glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
|
||||
stuff->glyphset,
|
||||
GlyphSetType,
|
||||
SecurityWriteAccess);
|
||||
DixWriteAccess);
|
||||
if (!glyphSet)
|
||||
{
|
||||
client->errorValue = stuff->glyphset;
|
||||
|
|
@ -1260,9 +1262,9 @@ ProcRenderCompositeGlyphs (ClientPtr client)
|
|||
client->errorValue = stuff->op;
|
||||
return BadValue;
|
||||
}
|
||||
VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess,
|
||||
VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess,
|
||||
VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
if (!pDst->pDrawable)
|
||||
return BadDrawable;
|
||||
|
|
@ -1273,7 +1275,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
|
|||
pFormat = (PictFormatPtr) SecurityLookupIDByType (client,
|
||||
stuff->maskFormat,
|
||||
PictFormatType,
|
||||
SecurityReadAccess);
|
||||
DixReadAccess);
|
||||
if (!pFormat)
|
||||
{
|
||||
client->errorValue = stuff->maskFormat;
|
||||
|
|
@ -1286,7 +1288,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
|
|||
glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
|
||||
stuff->glyphset,
|
||||
GlyphSetType,
|
||||
SecurityReadAccess);
|
||||
DixReadAccess);
|
||||
if (!glyphSet)
|
||||
{
|
||||
client->errorValue = stuff->glyphset;
|
||||
|
|
@ -1348,7 +1350,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
|
|||
glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
|
||||
gs,
|
||||
GlyphSetType,
|
||||
SecurityReadAccess);
|
||||
DixReadAccess);
|
||||
if (!glyphSet)
|
||||
{
|
||||
client->errorValue = gs;
|
||||
|
|
@ -1429,7 +1431,7 @@ ProcRenderFillRectangles (ClientPtr client)
|
|||
client->errorValue = stuff->op;
|
||||
return BadValue;
|
||||
}
|
||||
VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess,
|
||||
VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
if (!pDst->pDrawable)
|
||||
return BadDrawable;
|
||||
|
|
@ -1495,7 +1497,7 @@ ProcRenderCreateCursor (ClientPtr client)
|
|||
REQUEST_SIZE_MATCH (xRenderCreateCursorReq);
|
||||
LEGAL_NEW_RESOURCE(stuff->cid, client);
|
||||
|
||||
VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess,
|
||||
VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
if (!pSrc->pDrawable)
|
||||
return BadDrawable;
|
||||
|
|
@ -1677,7 +1679,7 @@ ProcRenderSetPictureTransform (ClientPtr client)
|
|||
int result;
|
||||
|
||||
REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq);
|
||||
VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess,
|
||||
VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
result = SetPictureTransform (pPicture, (PictTransform *) &stuff->transform);
|
||||
if (client->noClientException != Success)
|
||||
|
|
@ -1696,14 +1698,15 @@ ProcRenderQueryFilters (ClientPtr client)
|
|||
int nnames;
|
||||
ScreenPtr pScreen;
|
||||
PictureScreenPtr ps;
|
||||
int i, j;
|
||||
int len;
|
||||
int total_bytes;
|
||||
int i, j, len, total_bytes, rc;
|
||||
INT16 *aliases;
|
||||
char *names;
|
||||
|
||||
REQUEST_SIZE_MATCH(xRenderQueryFiltersReq);
|
||||
SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, SecurityReadAccess);
|
||||
rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
|
||||
DixReadAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
pScreen = pDrawable->pScreen;
|
||||
nbytesName = 0;
|
||||
|
|
@ -1806,7 +1809,7 @@ ProcRenderSetPictureFilter (ClientPtr client)
|
|||
char *name;
|
||||
|
||||
REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq);
|
||||
VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess,
|
||||
VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
name = (char *) (stuff + 1);
|
||||
params = (xFixed *) (name + ((stuff->nbytes + 3) & ~3));
|
||||
|
|
@ -1840,7 +1843,7 @@ ProcRenderCreateAnimCursor (ClientPtr client)
|
|||
for (i = 0; i < ncursor; i++)
|
||||
{
|
||||
cursors[i] = (CursorPtr)SecurityLookupIDByType(client, elt->cursor,
|
||||
RT_CURSOR, SecurityReadAccess);
|
||||
RT_CURSOR, DixReadAccess);
|
||||
if (!cursors[i])
|
||||
{
|
||||
xfree (cursors);
|
||||
|
|
@ -1868,7 +1871,7 @@ ProcRenderAddTraps (ClientPtr client)
|
|||
REQUEST(xRenderAddTrapsReq);
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xRenderAddTrapsReq);
|
||||
VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess,
|
||||
VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
if (!pPicture->pDrawable)
|
||||
return BadDrawable;
|
||||
|
|
@ -2071,6 +2074,8 @@ SProcRenderSetPictureClipRectangles (ClientPtr client)
|
|||
REQUEST(xRenderSetPictureClipRectanglesReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->picture, n);
|
||||
swaps(&stuff->xOrigin, n);
|
||||
swaps(&stuff->yOrigin, n);
|
||||
SwapRestS(stuff);
|
||||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
|
@ -2623,7 +2628,7 @@ PanoramiXRenderCreatePicture (ClientPtr client)
|
|||
|
||||
REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq);
|
||||
if(!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass(
|
||||
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
|
||||
client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess)))
|
||||
return BadDrawable;
|
||||
if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
|
||||
return BadAlloc;
|
||||
|
|
@ -2665,7 +2670,7 @@ PanoramiXRenderChangePicture (ClientPtr client)
|
|||
|
||||
REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq);
|
||||
|
||||
VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess,
|
||||
VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
|
||||
FOR_NSCREENS_BACKWARD(j) {
|
||||
|
|
@ -2686,7 +2691,7 @@ PanoramiXRenderSetPictureClipRectangles (ClientPtr client)
|
|||
|
||||
REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq);
|
||||
|
||||
VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess,
|
||||
VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
|
||||
FOR_NSCREENS_BACKWARD(j) {
|
||||
|
|
@ -2707,7 +2712,7 @@ PanoramiXRenderSetPictureTransform (ClientPtr client)
|
|||
|
||||
REQUEST_AT_LEAST_SIZE(xRenderSetPictureTransformReq);
|
||||
|
||||
VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess,
|
||||
VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
|
||||
FOR_NSCREENS_BACKWARD(j) {
|
||||
|
|
@ -2728,7 +2733,7 @@ PanoramiXRenderSetPictureFilter (ClientPtr client)
|
|||
|
||||
REQUEST_AT_LEAST_SIZE(xRenderSetPictureFilterReq);
|
||||
|
||||
VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess,
|
||||
VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
|
||||
FOR_NSCREENS_BACKWARD(j) {
|
||||
|
|
@ -2751,7 +2756,7 @@ PanoramiXRenderFreePicture (ClientPtr client)
|
|||
|
||||
client->errorValue = stuff->picture;
|
||||
|
||||
VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityDestroyAccess,
|
||||
VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixDestroyAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
|
||||
|
||||
|
|
@ -2777,11 +2782,11 @@ PanoramiXRenderComposite (ClientPtr client)
|
|||
|
||||
REQUEST_SIZE_MATCH(xRenderCompositeReq);
|
||||
|
||||
VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess,
|
||||
VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
VERIFY_XIN_ALPHA (msk, stuff->mask, client, SecurityReadAccess,
|
||||
VERIFY_XIN_ALPHA (msk, stuff->mask, client, DixReadAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess,
|
||||
VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
|
||||
orig = *stuff;
|
||||
|
|
@ -2825,9 +2830,9 @@ PanoramiXRenderCompositeGlyphs (ClientPtr client)
|
|||
INT16 xSrc, ySrc;
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq);
|
||||
VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess,
|
||||
VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess,
|
||||
VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
|
||||
if (client->req_len << 2 >= (sizeof (xRenderCompositeGlyphsReq) +
|
||||
|
|
@ -2868,7 +2873,7 @@ PanoramiXRenderFillRectangles (ClientPtr client)
|
|||
int extra_len;
|
||||
|
||||
REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq);
|
||||
VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess,
|
||||
VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
extra_len = (client->req_len << 2) - sizeof (xRenderFillRectanglesReq);
|
||||
if (extra_len &&
|
||||
|
|
@ -2915,9 +2920,9 @@ PanoramiXRenderTrapezoids(ClientPtr client)
|
|||
|
||||
REQUEST_AT_LEAST_SIZE (xRenderTrapezoidsReq);
|
||||
|
||||
VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess,
|
||||
VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess,
|
||||
VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
|
||||
extra_len = (client->req_len << 2) - sizeof (xRenderTrapezoidsReq);
|
||||
|
|
@ -2977,9 +2982,9 @@ PanoramiXRenderTriangles(ClientPtr client)
|
|||
|
||||
REQUEST_AT_LEAST_SIZE (xRenderTrianglesReq);
|
||||
|
||||
VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess,
|
||||
VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess,
|
||||
VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
|
||||
extra_len = (client->req_len << 2) - sizeof (xRenderTrianglesReq);
|
||||
|
|
@ -3035,9 +3040,9 @@ PanoramiXRenderTriStrip(ClientPtr client)
|
|||
|
||||
REQUEST_AT_LEAST_SIZE (xRenderTriStripReq);
|
||||
|
||||
VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess,
|
||||
VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess,
|
||||
VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
|
||||
extra_len = (client->req_len << 2) - sizeof (xRenderTriStripReq);
|
||||
|
|
@ -3089,9 +3094,9 @@ PanoramiXRenderTriFan(ClientPtr client)
|
|||
|
||||
REQUEST_AT_LEAST_SIZE (xRenderTriFanReq);
|
||||
|
||||
VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess,
|
||||
VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess,
|
||||
VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
|
||||
extra_len = (client->req_len << 2) - sizeof (xRenderTriFanReq);
|
||||
|
|
@ -3145,7 +3150,7 @@ PanoramiXRenderColorTrapezoids(ClientPtr client)
|
|||
|
||||
REQUEST_AT_LEAST_SIZE (xRenderColorTrapezoidsReq);
|
||||
|
||||
VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess,
|
||||
VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
|
||||
extra_len = (client->req_len << 2) - sizeof (xRenderColorTrapezoidsReq);
|
||||
|
|
@ -3189,7 +3194,7 @@ PanoramiXRenderColorTriangles(ClientPtr client)
|
|||
|
||||
REQUEST_AT_LEAST_SIZE (xRenderColorTrianglesReq);
|
||||
|
||||
VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess,
|
||||
VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
|
||||
extra_len = (client->req_len << 2) - sizeof (xRenderColorTrianglesReq);
|
||||
|
|
@ -3235,7 +3240,7 @@ PanoramiXRenderAddTraps (ClientPtr client)
|
|||
INT16 x_off, y_off;
|
||||
|
||||
REQUEST_AT_LEAST_SIZE (xRenderAddTrapsReq);
|
||||
VERIFY_XIN_PICTURE (picture, stuff->picture, client, SecurityWriteAccess,
|
||||
VERIFY_XIN_PICTURE (picture, stuff->picture, client, DixWriteAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
extra_len = (client->req_len << 2) - sizeof (xRenderAddTrapsReq);
|
||||
if (extra_len &&
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright © 2004 Keith Packard
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
|
|
@ -36,16 +34,7 @@
|
|||
_X_EXPORT xFixed
|
||||
RenderSampleCeilY (xFixed y, int n)
|
||||
{
|
||||
xFixed f = xFixedFrac(y);
|
||||
xFixed i = xFixedFloor(y);
|
||||
|
||||
f = ((f + Y_FRAC_FIRST(n)) / STEP_Y_SMALL(n)) * STEP_Y_SMALL(n) + Y_FRAC_FIRST(n);
|
||||
if (f > Y_FRAC_LAST(n))
|
||||
{
|
||||
f = Y_FRAC_FIRST(n);
|
||||
i += xFixed1;
|
||||
}
|
||||
return (i | f);
|
||||
return pixman_sample_ceil_y (y, n);
|
||||
}
|
||||
|
||||
#define _div(a,b) ((a) >= 0 ? (a) / (b) : -((-(a) + (b) - 1) / (b)))
|
||||
|
|
@ -57,16 +46,7 @@ RenderSampleCeilY (xFixed y, int n)
|
|||
_X_EXPORT xFixed
|
||||
RenderSampleFloorY (xFixed y, int n)
|
||||
{
|
||||
xFixed f = xFixedFrac(y);
|
||||
xFixed i = xFixedFloor (y);
|
||||
|
||||
f = _div(f - Y_FRAC_FIRST(n), STEP_Y_SMALL(n)) * STEP_Y_SMALL(n) + Y_FRAC_FIRST(n);
|
||||
if (f < Y_FRAC_FIRST(n))
|
||||
{
|
||||
f = Y_FRAC_LAST(n);
|
||||
i -= xFixed1;
|
||||
}
|
||||
return (i | f);
|
||||
return pixman_sample_floor_y (y, n);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -75,52 +55,7 @@ RenderSampleFloorY (xFixed y, int n)
|
|||
_X_EXPORT void
|
||||
RenderEdgeStep (RenderEdge *e, int n)
|
||||
{
|
||||
xFixed_48_16 ne;
|
||||
|
||||
e->x += n * e->stepx;
|
||||
|
||||
ne = e->e + n * (xFixed_48_16) e->dx;
|
||||
|
||||
if (n >= 0)
|
||||
{
|
||||
if (ne > 0)
|
||||
{
|
||||
int nx = (ne + e->dy - 1) / e->dy;
|
||||
e->e = ne - nx * (xFixed_48_16) e->dy;
|
||||
e->x += nx * e->signdx;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ne <= -e->dy)
|
||||
{
|
||||
int nx = (-ne) / e->dy;
|
||||
e->e = ne + nx * (xFixed_48_16) e->dy;
|
||||
e->x -= nx * e->signdx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* A private routine to initialize the multi-step
|
||||
* elements of an edge structure
|
||||
*/
|
||||
static void
|
||||
_RenderEdgeMultiInit (RenderEdge *e, int n, xFixed *stepx_p, xFixed *dx_p)
|
||||
{
|
||||
xFixed stepx;
|
||||
xFixed_48_16 ne;
|
||||
|
||||
ne = n * (xFixed_48_16) e->dx;
|
||||
stepx = n * e->stepx;
|
||||
if (ne > 0)
|
||||
{
|
||||
int nx = ne / e->dy;
|
||||
ne -= nx * e->dy;
|
||||
stepx += nx * e->signdx;
|
||||
}
|
||||
*dx_p = ne;
|
||||
*stepx_p = stepx;
|
||||
pixman_edge_step (e, n);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -136,34 +71,7 @@ RenderEdgeInit (RenderEdge *e,
|
|||
xFixed x_bot,
|
||||
xFixed y_bot)
|
||||
{
|
||||
xFixed dx, dy;
|
||||
|
||||
e->x = x_top;
|
||||
e->e = 0;
|
||||
dx = x_bot - x_top;
|
||||
dy = y_bot - y_top;
|
||||
e->dy = dy;
|
||||
if (dy)
|
||||
{
|
||||
if (dx >= 0)
|
||||
{
|
||||
e->signdx = 1;
|
||||
e->stepx = dx / dy;
|
||||
e->dx = dx % dy;
|
||||
e->e = -dy;
|
||||
}
|
||||
else
|
||||
{
|
||||
e->signdx = -1;
|
||||
e->stepx = -(-dx / dy);
|
||||
e->dx = -dx % dy;
|
||||
e->e = 0;
|
||||
}
|
||||
|
||||
_RenderEdgeMultiInit (e, STEP_Y_SMALL(n), &e->stepx_small, &e->dx_small);
|
||||
_RenderEdgeMultiInit (e, STEP_Y_BIG(n), &e->stepx_big, &e->dx_big);
|
||||
}
|
||||
RenderEdgeStep (e, y_start - y_top);
|
||||
pixman_edge_init (e, n, y_start, x_top, y_top, x_bot, y_bot);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -178,24 +86,6 @@ RenderLineFixedEdgeInit (RenderEdge *e,
|
|||
int x_off,
|
||||
int y_off)
|
||||
{
|
||||
xFixed x_off_fixed = IntToxFixed(x_off);
|
||||
xFixed y_off_fixed = IntToxFixed(y_off);
|
||||
xPointFixed *top, *bot;
|
||||
|
||||
if (line->p1.y <= line->p2.y)
|
||||
{
|
||||
top = &line->p1;
|
||||
bot = &line->p2;
|
||||
}
|
||||
else
|
||||
{
|
||||
top = &line->p2;
|
||||
bot = &line->p1;
|
||||
}
|
||||
RenderEdgeInit (e, n, y,
|
||||
top->x + x_off_fixed,
|
||||
top->y + y_off_fixed,
|
||||
bot->x + x_off_fixed,
|
||||
bot->y + y_off_fixed);
|
||||
pixman_line_fixed_edge_init (e, n, y, (pixman_line_fixed_t *)line, x_off, y_off);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright © 2004 Keith Packard
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
|
|
@ -50,20 +48,7 @@
|
|||
* and can be quickly stepped across small or large gaps in the
|
||||
* sample grid
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
xFixed x;
|
||||
xFixed e;
|
||||
xFixed stepx;
|
||||
xFixed signdx;
|
||||
xFixed dy;
|
||||
xFixed dx;
|
||||
|
||||
xFixed stepx_small;
|
||||
xFixed stepx_big;
|
||||
xFixed dx_small;
|
||||
xFixed dx_big;
|
||||
} RenderEdge;
|
||||
typedef pixman_edge_t RenderEdge;
|
||||
|
||||
/*
|
||||
* Step across a small sample grid gap
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue