Merge branch 'master' into mpx
Conflicts: dix/devices.c hw/xfree86/common/xf86Xinput.c hw/xfree86/loader/xf86sym.c mi/mieq.c
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -1879,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/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 && \
|
||||
|
||||
@@ -54,13 +54,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
|
||||
@@ -666,6 +661,10 @@ AddTraps (PicturePtr pPicture,
|
||||
int ntraps,
|
||||
xTrap *traps);
|
||||
|
||||
pixman_image_t *
|
||||
PixmanImageFromPicture (PicturePtr pPict,
|
||||
Bool hasClip);
|
||||
|
||||
PicturePtr
|
||||
CreateSolidPicture (Picture pid,
|
||||
xRenderColor *color,
|
||||
|
||||
@@ -2074,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);
|
||||
}
|
||||
|
||||
@@ -36,16 +36,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 +48,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 +57,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 +73,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 +88,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);
|
||||
}
|
||||
|
||||
|
||||
@@ -50,20 +50,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
|
||||
|
||||
Reference in New Issue
Block a user