mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 16:58:01 +02:00
Patch from Bryan Worth <bryan@theworths.org> to eliminate lots of leftover, undesired dependencies on X header files.
This commit is contained in:
parent
cf882f5d73
commit
ece5507937
14 changed files with 271 additions and 192 deletions
|
|
@ -1,3 +1,44 @@
|
|||
2003-10-29 Carl Worth <cworth@east.isi.edu>
|
||||
|
||||
* Everywhere: A large patch from Bryan Worth <bryan@theworths.org>
|
||||
to eliminate lots of leftover, undesired dependencies on X header
|
||||
files. More details below:
|
||||
|
||||
* src/ictransform.c:
|
||||
* src/ictrap.c:
|
||||
* src/ictri.c:
|
||||
* src/icrect.c:
|
||||
* src/iccompose.c:
|
||||
* src/iccolor.c:
|
||||
* src/icbltone.c:
|
||||
* src/icblt.c:
|
||||
* src/icimage.h:
|
||||
* src/icimage.c:
|
||||
* src/ic.c:
|
||||
Replace CARD8/16/32 with uint8/16/32_t.
|
||||
Replace INT16 with int16_t.
|
||||
Use IcOperator in place of char or uint8_t.
|
||||
Replace Bool/FALSE/TRUE with int/0/1.
|
||||
|
||||
* src/icint.h: Remove includes of X11/X.h, X11/Xmd.h,
|
||||
X11/Xprotostr.h and X11/extensions/Xrender.h. Add IcPoint. Lift
|
||||
definitions from X headers for Mask, GXor, ClipByChildren,
|
||||
PolyEdgeSharp, PolyModePrecise, CPClipMask, and CPLastBit.
|
||||
|
||||
* src/icimage.h: Remove includes of X11/Xdefs.h and X11/Xprotostr.h.
|
||||
Replace "pointer" with "void *".
|
||||
Remove include of X11/Xutil.h.
|
||||
Replace DDXPointRec with IcPoint.
|
||||
Replace Atom/XID with unsigned long.
|
||||
|
||||
* src/icimage.c: Remove instances of BadAlloc and Success.
|
||||
Replace XID with unsigned int.
|
||||
Replace "pointer" with "void *".
|
||||
Replace Atom with unsigned long.
|
||||
|
||||
* src/ic.h: Introduce new IcOperator enum, rather than using char
|
||||
or uint8_t.
|
||||
|
||||
2003-09-09 Carl Worth <cworth@isi.edu>
|
||||
|
||||
* configure.in (SLIM_REQUIRED): Updated calls to slim_hidden_def
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ IcIn (uint32_t x, uint8_t y)
|
|||
*/
|
||||
|
||||
static void
|
||||
IcCompositeSolidMask_nx8x8888 (uint8_t op,
|
||||
IcCompositeSolidMask_nx8x8888 (IcOperator op,
|
||||
IcImage *iSrc,
|
||||
IcImage *iMask,
|
||||
IcImage *iDst,
|
||||
|
|
@ -198,7 +198,7 @@ IcCompositeSolidMask_nx8x8888 (uint8_t op,
|
|||
}
|
||||
|
||||
static void
|
||||
IcCompositeSolidMask_nx8888x8888C (uint8_t op,
|
||||
IcCompositeSolidMask_nx8888x8888C (IcOperator op,
|
||||
IcImage *iSrc,
|
||||
IcImage *iMask,
|
||||
IcImage *iDst,
|
||||
|
|
@ -271,7 +271,7 @@ IcCompositeSolidMask_nx8888x8888C (uint8_t op,
|
|||
}
|
||||
|
||||
static void
|
||||
IcCompositeSolidMask_nx8x0888 (uint8_t op,
|
||||
IcCompositeSolidMask_nx8x0888 (IcOperator op,
|
||||
IcImage *iSrc,
|
||||
IcImage *iMask,
|
||||
IcImage *iDst,
|
||||
|
|
@ -333,7 +333,7 @@ IcCompositeSolidMask_nx8x0888 (uint8_t op,
|
|||
}
|
||||
|
||||
static void
|
||||
IcCompositeSolidMask_nx8x0565 (uint8_t op,
|
||||
IcCompositeSolidMask_nx8x0565 (IcOperator op,
|
||||
IcImage *iSrc,
|
||||
IcImage *iMask,
|
||||
IcImage *iDst,
|
||||
|
|
@ -396,7 +396,7 @@ IcCompositeSolidMask_nx8x0565 (uint8_t op,
|
|||
}
|
||||
|
||||
static void
|
||||
IcCompositeSolidMask_nx8888x0565C (uint8_t op,
|
||||
IcCompositeSolidMask_nx8888x0565C (IcOperator op,
|
||||
IcImage *iSrc,
|
||||
IcImage *iMask,
|
||||
IcImage *iDst,
|
||||
|
|
@ -469,7 +469,7 @@ IcCompositeSolidMask_nx8888x0565C (uint8_t op,
|
|||
}
|
||||
|
||||
static void
|
||||
IcCompositeSrc_8888x8888 (uint8_t op,
|
||||
IcCompositeSrc_8888x8888 (IcOperator op,
|
||||
IcImage *iSrc,
|
||||
IcImage *iMask,
|
||||
IcImage *iDst,
|
||||
|
|
@ -515,7 +515,7 @@ IcCompositeSrc_8888x8888 (uint8_t op,
|
|||
}
|
||||
|
||||
static void
|
||||
IcCompositeSrc_8888x0888 (uint8_t op,
|
||||
IcCompositeSrc_8888x0888 (IcOperator op,
|
||||
IcImage *iSrc,
|
||||
IcImage *iMask,
|
||||
IcImage *iDst,
|
||||
|
|
@ -564,7 +564,7 @@ IcCompositeSrc_8888x0888 (uint8_t op,
|
|||
}
|
||||
|
||||
static void
|
||||
IcCompositeSrc_8888x0565 (uint8_t op,
|
||||
IcCompositeSrc_8888x0565 (IcOperator op,
|
||||
IcImage *iSrc,
|
||||
IcImage *iMask,
|
||||
IcImage *iDst,
|
||||
|
|
@ -616,7 +616,7 @@ IcCompositeSrc_8888x0565 (uint8_t op,
|
|||
}
|
||||
|
||||
static void
|
||||
IcCompositeSrc_0565x0565 (uint8_t op,
|
||||
IcCompositeSrc_0565x0565 (IcOperator op,
|
||||
IcImage *iSrc,
|
||||
IcImage *iMask,
|
||||
IcImage *iDst,
|
||||
|
|
@ -652,7 +652,7 @@ IcCompositeSrc_0565x0565 (uint8_t op,
|
|||
}
|
||||
|
||||
static void
|
||||
IcCompositeSrcAdd_8000x8000 (uint8_t op,
|
||||
IcCompositeSrcAdd_8000x8000 (IcOperator op,
|
||||
IcImage *iSrc,
|
||||
IcImage *iMask,
|
||||
IcImage *iDst,
|
||||
|
|
@ -698,7 +698,7 @@ IcCompositeSrcAdd_8000x8000 (uint8_t op,
|
|||
}
|
||||
|
||||
static void
|
||||
IcCompositeSrcAdd_8888x8888 (uint8_t op,
|
||||
IcCompositeSrcAdd_8888x8888 (IcOperator op,
|
||||
IcImage *iSrc,
|
||||
IcImage *iMask,
|
||||
IcImage *iDst,
|
||||
|
|
@ -751,7 +751,7 @@ IcCompositeSrcAdd_8888x8888 (uint8_t op,
|
|||
}
|
||||
|
||||
static void
|
||||
IcCompositeSrcAdd_1000x1000 (uint8_t op,
|
||||
IcCompositeSrcAdd_1000x1000 (IcOperator op,
|
||||
IcImage *iSrc,
|
||||
IcImage *iMask,
|
||||
IcImage *iDst,
|
||||
|
|
@ -789,12 +789,12 @@ IcCompositeSrcAdd_1000x1000 (uint8_t op,
|
|||
IC_ALLONES,
|
||||
srcBpp,
|
||||
|
||||
FALSE,
|
||||
FALSE);
|
||||
0,
|
||||
0);
|
||||
}
|
||||
|
||||
static void
|
||||
IcCompositeSolidMask_nx1xn (uint8_t op,
|
||||
IcCompositeSolidMask_nx1xn (IcOperator op,
|
||||
IcImage *iSrc,
|
||||
IcImage *iMask,
|
||||
IcImage *iDst,
|
||||
|
|
@ -860,7 +860,7 @@ IcCompositeSolidMask_nx1xn (uint8_t op,
|
|||
# define mod(a,b) ((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-a) % (b))
|
||||
|
||||
void
|
||||
IcComposite (char op,
|
||||
IcComposite (IcOperator op,
|
||||
IcImage *iSrc,
|
||||
IcImage *iMask,
|
||||
IcImage *iDst,
|
||||
|
|
@ -877,11 +877,11 @@ IcComposite (char op,
|
|||
int n;
|
||||
PixRegionBox *pbox;
|
||||
CompositeFunc func;
|
||||
Bool srcRepeat = iSrc->repeat;
|
||||
Bool maskRepeat = FALSE;
|
||||
Bool srcAlphaMap = iSrc->alphaMap != 0;
|
||||
Bool maskAlphaMap = FALSE;
|
||||
Bool dstAlphaMap = iDst->alphaMap != 0;
|
||||
int srcRepeat = iSrc->repeat;
|
||||
int maskRepeat = 0;
|
||||
int srcAlphaMap = iSrc->alphaMap != 0;
|
||||
int maskAlphaMap = 0;
|
||||
int dstAlphaMap = iDst->alphaMap != 0;
|
||||
int x_msk, y_msk, x_src, y_src, x_dst, y_dst;
|
||||
int w, h, w_this, h_this;
|
||||
|
||||
|
|
@ -918,14 +918,14 @@ IcComposite (char op,
|
|||
if (!iSrc->transform && !(iMask && iMask->transform))
|
||||
if (!maskAlphaMap && !srcAlphaMap && !dstAlphaMap)
|
||||
switch (op) {
|
||||
case PictOpOver:
|
||||
case IcOperatorOver:
|
||||
if (iMask)
|
||||
{
|
||||
if (srcRepeat &&
|
||||
iSrc->pixels->width == 1 &&
|
||||
iSrc->pixels->height == 1)
|
||||
{
|
||||
srcRepeat = FALSE;
|
||||
srcRepeat = 0;
|
||||
if (PICT_FORMAT_COLOR(iSrc->format_code)) {
|
||||
switch (iMask->format_code) {
|
||||
case PICT_a8:
|
||||
|
|
@ -1039,7 +1039,7 @@ IcComposite (char op,
|
|||
}
|
||||
}
|
||||
break;
|
||||
case PictOpAdd:
|
||||
case IcOperatorAdd:
|
||||
if (iMask == 0)
|
||||
{
|
||||
switch (iSrc->format_code) {
|
||||
|
|
@ -1074,6 +1074,9 @@ IcComposite (char op,
|
|||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
func = IcCompositeGeneral;
|
||||
break;
|
||||
}
|
||||
n = PixRegionNumRects (region);
|
||||
pbox = PixRegionRects (region);
|
||||
|
|
|
|||
|
|
@ -52,6 +52,25 @@ extern "C" {
|
|||
|
||||
/* icformat.c */
|
||||
|
||||
|
||||
typedef enum _IcOperator {
|
||||
IcOperatorClear,
|
||||
IcOperatorSrc,
|
||||
IcOperatorDst,
|
||||
IcOperatorOver,
|
||||
IcOperatorOverReverse,
|
||||
IcOperatorIn,
|
||||
IcOperatorInReverse,
|
||||
IcOperatorOut,
|
||||
IcOperatorOutReverse,
|
||||
IcOperatorAtop,
|
||||
IcOperatorAtopReverse,
|
||||
IcOperatorXor,
|
||||
IcOperatorAdd,
|
||||
IcOperatorSaturate,
|
||||
} IcOperator;
|
||||
|
||||
|
||||
typedef enum _IcFormatName {
|
||||
IcFormatNameARGB32,
|
||||
IcFormatNameRGB24,
|
||||
|
|
@ -205,7 +224,7 @@ IcPixelToColor (const IcFormat *format,
|
|||
/* icrect.c */
|
||||
|
||||
extern void __external_linkage
|
||||
IcFillRectangle (char op,
|
||||
IcFillRectangle (IcOperator op,
|
||||
IcImage *dst,
|
||||
const IcColor *color,
|
||||
int x,
|
||||
|
|
@ -214,7 +233,7 @@ IcFillRectangle (char op,
|
|||
unsigned int height);
|
||||
|
||||
extern void __external_linkage
|
||||
IcFillRectangles (char op,
|
||||
IcFillRectangles (IcOperator op,
|
||||
IcImage *dst,
|
||||
const IcColor *color,
|
||||
const IcRectangle *rects,
|
||||
|
|
@ -224,7 +243,7 @@ IcFillRectangles (char op,
|
|||
|
||||
/* XXX: Switch to enum for op */
|
||||
extern void __external_linkage
|
||||
IcCompositeTrapezoids (char op,
|
||||
IcCompositeTrapezoids (IcOperator op,
|
||||
IcImage *src,
|
||||
IcImage *dst,
|
||||
int xSrc,
|
||||
|
|
@ -235,7 +254,7 @@ IcCompositeTrapezoids (char op,
|
|||
/* ictri.c */
|
||||
|
||||
extern void __external_linkage
|
||||
IcCompositeTriangles (char op,
|
||||
IcCompositeTriangles (IcOperator op,
|
||||
IcImage *src,
|
||||
IcImage *dst,
|
||||
int xSrc,
|
||||
|
|
@ -244,7 +263,7 @@ IcCompositeTriangles (char op,
|
|||
int ntris);
|
||||
|
||||
extern void __external_linkage
|
||||
IcCompositeTriStrip (char op,
|
||||
IcCompositeTriStrip (IcOperator op,
|
||||
IcImage *src,
|
||||
IcImage *dst,
|
||||
int xSrc,
|
||||
|
|
@ -254,7 +273,7 @@ IcCompositeTriStrip (char op,
|
|||
|
||||
|
||||
extern void __external_linkage
|
||||
IcCompositeTriFan (char op,
|
||||
IcCompositeTriFan (IcOperator op,
|
||||
IcImage *src,
|
||||
IcImage *dst,
|
||||
int xSrc,
|
||||
|
|
@ -265,7 +284,7 @@ IcCompositeTriFan (char op,
|
|||
/* ic.c */
|
||||
|
||||
extern void __external_linkage
|
||||
IcComposite (char op,
|
||||
IcComposite (IcOperator op,
|
||||
IcImage *iSrc,
|
||||
IcImage *iMask,
|
||||
IcImage *iDst,
|
||||
|
|
|
|||
|
|
@ -52,15 +52,15 @@ IcBlt (IcBits *srcLine,
|
|||
IcBits pm,
|
||||
int bpp,
|
||||
|
||||
Bool reverse,
|
||||
Bool upsidedown)
|
||||
int reverse,
|
||||
int upsidedown)
|
||||
{
|
||||
IcBits *src, *dst;
|
||||
int leftShift, rightShift;
|
||||
IcBits startmask, endmask;
|
||||
IcBits bits, bits1;
|
||||
int n, nmiddle;
|
||||
Bool destInvarient;
|
||||
int destInvarient;
|
||||
int startbyte, endbyte;
|
||||
IcDeclareMergeRop ();
|
||||
|
||||
|
|
@ -337,7 +337,7 @@ IcBlt24Line (IcBits *src,
|
|||
int alu,
|
||||
IcBits pm,
|
||||
|
||||
Bool reverse)
|
||||
int reverse)
|
||||
{
|
||||
#ifdef DEBUG_BLT24
|
||||
char *origDst = (char *) dst;
|
||||
|
|
@ -554,8 +554,8 @@ IcBlt24 (IcBits *srcLine,
|
|||
int alu,
|
||||
IcBits pm,
|
||||
|
||||
Bool reverse,
|
||||
Bool upsidedown)
|
||||
int reverse,
|
||||
int upsidedown)
|
||||
{
|
||||
if (upsidedown)
|
||||
{
|
||||
|
|
@ -622,8 +622,8 @@ IcBltOdd (IcBits *srcLine,
|
|||
IcBits bits, bits1;
|
||||
int n;
|
||||
|
||||
Bool destInvarient;
|
||||
Bool even;
|
||||
int destInvarient;
|
||||
int even;
|
||||
IcDeclareMergeRop ();
|
||||
|
||||
IcInitializeMergeRop (alu, pm);
|
||||
|
|
@ -639,7 +639,7 @@ IcBltOdd (IcBits *srcLine,
|
|||
IcMaskBits(dstXEven, width, startmaskEven, nmiddleEven, endmaskEven);
|
||||
IcMaskBits(dstXOdd, width, startmaskOdd, nmiddleOdd, endmaskOdd);
|
||||
|
||||
even = TRUE;
|
||||
even = 1;
|
||||
InitializeShifts(srcXEven, dstXEven, leftShiftEven, rightShiftEven);
|
||||
InitializeShifts(srcXOdd, dstXOdd, leftShiftOdd, rightShiftOdd);
|
||||
while (height--)
|
||||
|
|
@ -657,7 +657,7 @@ IcBltOdd (IcBits *srcLine,
|
|||
rightShift = rightShiftEven;
|
||||
srcLine += srcStrideEven;
|
||||
dstLine += dstStrideEven;
|
||||
even = FALSE;
|
||||
even = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -670,7 +670,7 @@ IcBltOdd (IcBits *srcLine,
|
|||
rightShift = rightShiftOdd;
|
||||
srcLine += srcStrideOdd;
|
||||
dstLine += dstStrideOdd;
|
||||
even = TRUE;
|
||||
even = 1;
|
||||
}
|
||||
if (srcX == dstX)
|
||||
{
|
||||
|
|
@ -775,25 +775,25 @@ IcBltOdd24 (IcBits *srcLine,
|
|||
int alu,
|
||||
IcBits pm)
|
||||
{
|
||||
Bool even = TRUE;
|
||||
int even = 1;
|
||||
|
||||
while (height--)
|
||||
{
|
||||
if (even)
|
||||
{
|
||||
IcBlt24Line (srcLine, srcXEven, dstLine, dstXEven,
|
||||
width, alu, pm, FALSE);
|
||||
width, alu, pm, 0);
|
||||
srcLine += srcStrideEven;
|
||||
dstLine += dstStrideEven;
|
||||
even = FALSE;
|
||||
even = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
IcBlt24Line (srcLine, srcXOdd, dstLine, dstXOdd,
|
||||
width, alu, pm, FALSE);
|
||||
width, alu, pm, 0);
|
||||
srcLine += srcStrideOdd;
|
||||
dstLine += dstStrideOdd;
|
||||
even = TRUE;
|
||||
even = 1;
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
|
|
@ -920,6 +920,6 @@ IcBltStip (IcStip *src,
|
|||
(IcBits *) dst, IcStipStrideToBitsStride (dstStride),
|
||||
dstX,
|
||||
width, height,
|
||||
alu, pm, bpp, FALSE, FALSE);
|
||||
alu, pm, bpp, 0, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@
|
|||
#endif
|
||||
|
||||
#if IC_SHIFT == 6
|
||||
static CARD8 const Ic8Lane[256] = {
|
||||
static uint8_t const Ic8Lane[256] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
|
||||
22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
|
||||
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
|
||||
|
|
@ -93,33 +93,33 @@ static CARD8 const Ic8Lane[256] = {
|
|||
242, 243, 244,245,246,247,248,249,250,251,252,253,254,255,
|
||||
};
|
||||
|
||||
static CARD8 const Ic16Lane[256] = {
|
||||
static uint8_t const Ic16Lane[256] = {
|
||||
0x00, 0x03, 0x0c, 0x0f,
|
||||
0x30, 0x33, 0x3c, 0x3f,
|
||||
0xc0, 0xc3, 0xcc, 0xcf,
|
||||
0xf0, 0xf3, 0xfc, 0xff,
|
||||
};
|
||||
|
||||
static CARD8 const Ic32Lane[16] = {
|
||||
static uint8_t const Ic32Lane[16] = {
|
||||
0x00, 0x0f, 0xf0, 0xff,
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IC_SHIFT == 5
|
||||
static CARD8 const Ic8Lane[16] = {
|
||||
static uint8_t const Ic8Lane[16] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
};
|
||||
|
||||
static CARD8 const Ic16Lane[16] = {
|
||||
static uint8_t const Ic16Lane[16] = {
|
||||
0, 3, 12, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
|
||||
static CARD8 const Ic32Lane[16] = {
|
||||
static uint8_t const Ic32Lane[16] = {
|
||||
0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
#endif
|
||||
|
||||
static const CARD8 *
|
||||
static const uint8_t *
|
||||
IcLaneTable(int bpp)
|
||||
{
|
||||
switch (bpp) {
|
||||
|
|
@ -163,12 +163,12 @@ IcBltOne (IcStip *src,
|
|||
int w;
|
||||
int n, nmiddle;
|
||||
int dstS; /* stipple-relative dst X coordinate */
|
||||
Bool copy; /* accelerate dest-invariant */
|
||||
Bool transparent; /* accelerate 0 nop */
|
||||
int copy; /* accelerate dest-invariant */
|
||||
int transparent; /* accelerate 0 nop */
|
||||
int srcinc; /* source units consumed */
|
||||
Bool endNeedsLoad = FALSE; /* need load for endmask */
|
||||
int endNeedsLoad = 0; /* need load for endmask */
|
||||
#ifndef ICNOPIXADDR
|
||||
const CARD8 *IcLane;
|
||||
const uint8_t *IcLane;
|
||||
#endif
|
||||
int startbyte, endbyte;
|
||||
|
||||
|
|
@ -194,12 +194,12 @@ IcBltOne (IcStip *src,
|
|||
*/
|
||||
unitsPerSrc = IC_STIP_UNIT / pixelsPerDst;
|
||||
|
||||
copy = FALSE;
|
||||
transparent = FALSE;
|
||||
copy = 0;
|
||||
transparent = 0;
|
||||
if (bgand == 0 && fgand == 0)
|
||||
copy = TRUE;
|
||||
copy = 1;
|
||||
else if (bgand == IC_ALLONES && bgxor == 0)
|
||||
transparent = TRUE;
|
||||
transparent = 1;
|
||||
|
||||
/*
|
||||
* Adjust source and dest to nearest IcBits boundary
|
||||
|
|
@ -347,7 +347,7 @@ IcBltOne (IcStip *src,
|
|||
while (bits && n)
|
||||
{
|
||||
switch (IcLane[IcLeftStipBits(bits,pixelsPerDst)]) {
|
||||
LaneCases((CARD8 *) dst);
|
||||
LaneCases((uint8_t *) dst);
|
||||
}
|
||||
bits = IcStipLeft(bits,pixelsPerDst);
|
||||
dst++;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ IcColorToPixel (const IcFormat *format,
|
|||
const IcColor *color,
|
||||
IcBits *pixel)
|
||||
{
|
||||
CARD32 r, g, b, a;
|
||||
uint32_t r, g, b, a;
|
||||
|
||||
r = color->red >> (16 - _IcOnes (format->redMask));
|
||||
g = color->green >> (16 - _IcOnes (format->greenMask));
|
||||
|
|
@ -55,15 +55,15 @@ IcColorToPixel (const IcFormat *format,
|
|||
}
|
||||
slim_hidden_def(IcColorToPixel);
|
||||
|
||||
static CARD16
|
||||
IcFillColor (CARD32 pixel, int bits)
|
||||
static uint16_t
|
||||
IcFillColor (uint32_t pixel, int bits)
|
||||
{
|
||||
while (bits < 16)
|
||||
{
|
||||
pixel |= pixel << bits;
|
||||
bits <<= 1;
|
||||
}
|
||||
return (CARD16) pixel;
|
||||
return (uint16_t) pixel;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -71,7 +71,7 @@ IcPixelToColor (const IcFormat *format,
|
|||
const IcBits pixel,
|
||||
IcColor *color)
|
||||
{
|
||||
CARD32 r, g, b, a;
|
||||
uint32_t r, g, b, a;
|
||||
|
||||
r = (pixel >> format->red) & format->redMask;
|
||||
g = (pixel >> format->green) & format->greenMask;
|
||||
|
|
|
|||
|
|
@ -2517,19 +2517,19 @@ IcSet_transform (IcCompositeOperand *op, int x, int y)
|
|||
}
|
||||
|
||||
|
||||
Bool
|
||||
int
|
||||
IcBuildCompositeOperand (IcImage *image,
|
||||
IcCompositeOperand op[4],
|
||||
int16_t x,
|
||||
int16_t y,
|
||||
Bool transform,
|
||||
Bool alpha)
|
||||
int transform,
|
||||
int alpha)
|
||||
{
|
||||
/* Check for transform */
|
||||
if (transform && image->transform)
|
||||
{
|
||||
if (!IcBuildCompositeOperand (image, &op[1], 0, 0, FALSE, alpha))
|
||||
return FALSE;
|
||||
if (!IcBuildCompositeOperand (image, &op[1], 0, 0, 0, alpha))
|
||||
return 0;
|
||||
|
||||
op->u.transform.top_y = image->pixels->y;
|
||||
op->u.transform.left_x = image->pixels->x;
|
||||
|
|
@ -2549,18 +2549,18 @@ IcBuildCompositeOperand (IcImage *image,
|
|||
|
||||
op->clip = op[1].clip;
|
||||
|
||||
return TRUE;
|
||||
return 1;
|
||||
}
|
||||
/* Check for external alpha */
|
||||
else if (alpha && image->alphaMap)
|
||||
{
|
||||
if (!IcBuildCompositeOperand (image, &op[1], x, y, FALSE, FALSE))
|
||||
return FALSE;
|
||||
if (!IcBuildCompositeOperand (image, &op[1], x, y, 0, 0))
|
||||
return 0;
|
||||
if (!IcBuildCompositeOperand (image->alphaMap, &op[2],
|
||||
x - image->alphaOrigin.x,
|
||||
y - image->alphaOrigin.y,
|
||||
FALSE, FALSE))
|
||||
return FALSE;
|
||||
0, 0))
|
||||
return 0;
|
||||
op->u.external.alpha_dx = image->alphaOrigin.x;
|
||||
op->u.external.alpha_dy = image->alphaOrigin.y;
|
||||
|
||||
|
|
@ -2573,7 +2573,7 @@ IcBuildCompositeOperand (IcImage *image,
|
|||
|
||||
op->clip = op[1].clip;
|
||||
|
||||
return TRUE;
|
||||
return 1;
|
||||
}
|
||||
/* Build simple operand */
|
||||
else
|
||||
|
|
@ -2620,14 +2620,14 @@ IcBuildCompositeOperand (IcImage *image,
|
|||
|
||||
op->u.drawable.stride = stride;
|
||||
op->u.drawable.bpp = bpp;
|
||||
return TRUE;
|
||||
return 1;
|
||||
}
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
IcCompositeGeneral (uint8_t op,
|
||||
IcCompositeGeneral (IcOperator op,
|
||||
IcImage *iSrc,
|
||||
IcImage *iMask,
|
||||
IcImage *iDst,
|
||||
|
|
@ -2647,9 +2647,9 @@ IcCompositeGeneral (uint8_t op,
|
|||
IcCombineFunc f;
|
||||
int w;
|
||||
|
||||
if (!IcBuildCompositeOperand (iSrc, src, xSrc, ySrc, TRUE, TRUE))
|
||||
if (!IcBuildCompositeOperand (iSrc, src, xSrc, ySrc, 1, 1))
|
||||
return;
|
||||
if (!IcBuildCompositeOperand (iDst, dst, xDst, yDst, FALSE, TRUE))
|
||||
if (!IcBuildCompositeOperand (iDst, dst, xDst, yDst, 0, 1))
|
||||
return;
|
||||
if (iSrc->alphaMap)
|
||||
{
|
||||
|
|
@ -2674,7 +2674,7 @@ IcCompositeGeneral (uint8_t op,
|
|||
f = IcCombineFuncU[op];
|
||||
if (iMask)
|
||||
{
|
||||
if (!IcBuildCompositeOperand (iMask, msk, xMask, yMask, TRUE, TRUE))
|
||||
if (!IcBuildCompositeOperand (iMask, msk, xMask, yMask, 1, 1))
|
||||
return;
|
||||
pmsk = msk;
|
||||
if (iMask->componentAlpha)
|
||||
|
|
|
|||
|
|
@ -106,14 +106,14 @@ IcImageInit (IcImage *image)
|
|||
{
|
||||
image->refcnt = 1;
|
||||
image->repeat = 0;
|
||||
image->graphicsExposures = FALSE;
|
||||
image->graphicsExposures = 0;
|
||||
image->subWindowMode = ClipByChildren;
|
||||
image->polyEdge = PolyEdgeSharp;
|
||||
image->polyMode = PolyModePrecise;
|
||||
/* XXX: In the server this was FALSE. Why? */
|
||||
image->freeCompClip = TRUE;
|
||||
/* XXX: In the server this was 0. Why? */
|
||||
image->freeCompClip = 1;
|
||||
image->clientClipType = CT_NONE;
|
||||
image->componentAlpha = FALSE;
|
||||
image->componentAlpha = 0;
|
||||
|
||||
image->alphaMap = 0;
|
||||
image->alphaOrigin.x = 0;
|
||||
|
|
@ -123,7 +123,7 @@ IcImageInit (IcImage *image)
|
|||
image->clipOrigin.y = 0;
|
||||
image->clientClip = 0;
|
||||
|
||||
image->dither = None;
|
||||
image->dither = 0L;
|
||||
|
||||
image->stateChanges = (1 << (CPLastBit+1)) - 1;
|
||||
/* XXX: What to lodge here?
|
||||
|
|
@ -163,7 +163,7 @@ IcImageSetTransform (IcImage *image,
|
|||
{
|
||||
image->transform = malloc (sizeof (IcTransform));
|
||||
if (!image->transform)
|
||||
return BadAlloc;
|
||||
return 1;
|
||||
}
|
||||
*image->transform = *transform;
|
||||
}
|
||||
|
|
@ -175,7 +175,7 @@ IcImageSetTransform (IcImage *image,
|
|||
image->transform = 0;
|
||||
}
|
||||
}
|
||||
return Success;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -257,12 +257,12 @@ IcImageSetClipRegion (IcImage *image,
|
|||
image->clientClip = region;
|
||||
image->clientClipType = CT_REGION;
|
||||
image->stateChanges |= CPClipMask;
|
||||
return Success;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define BOUND(v) (INT16) ((v) < MINSHORT ? MINSHORT : (v) > MAXSHORT ? MAXSHORT : (v))
|
||||
#define BOUND(v) (int16_t) ((v) < MINSHORT ? MINSHORT : (v) > MAXSHORT ? MAXSHORT : (v))
|
||||
|
||||
static __inline Bool
|
||||
static __inline int
|
||||
IcClipImageReg (PixRegion *region,
|
||||
PixRegion *clip,
|
||||
int dx,
|
||||
|
|
@ -295,10 +295,10 @@ IcClipImageReg (PixRegion *region,
|
|||
PixRegionIntersect (region, clip, region);
|
||||
PixRegionTranslate (region, -dx, -dy);
|
||||
}
|
||||
return TRUE;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static __inline Bool
|
||||
static __inline int
|
||||
IcClipImageSrc (PixRegion *region,
|
||||
IcImage *image,
|
||||
int dx,
|
||||
|
|
@ -306,7 +306,7 @@ IcClipImageSrc (PixRegion *region,
|
|||
{
|
||||
/* XXX what to do with clipping from transformed pictures? */
|
||||
if (image->transform)
|
||||
return TRUE;
|
||||
return 1;
|
||||
if (image->repeat)
|
||||
{
|
||||
if (image->clientClipType != CT_NONE)
|
||||
|
|
@ -319,7 +319,7 @@ IcClipImageSrc (PixRegion *region,
|
|||
- (dx - image->clipOrigin.x),
|
||||
- (dy - image->clipOrigin.y));
|
||||
}
|
||||
return TRUE;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -328,7 +328,7 @@ IcClipImageSrc (PixRegion *region,
|
|||
dx,
|
||||
dy);
|
||||
}
|
||||
return TRUE;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* XXX: Need to decide what to do with this
|
||||
|
|
@ -339,7 +339,7 @@ IcClipImageSrc (PixRegion *region,
|
|||
int
|
||||
IcImageChange (IcImage *image,
|
||||
Mask vmask,
|
||||
XID *vlist,
|
||||
unsigned int *vlist,
|
||||
DevUnion *ulist,
|
||||
int *error_value)
|
||||
{
|
||||
|
|
@ -376,21 +376,21 @@ IcImageChange (IcImage *image,
|
|||
if (iAlpha)
|
||||
iAlpha->refcnt++;
|
||||
if (image->alphaMap)
|
||||
IcImageDestroy ((pointer) image->alphaMap);
|
||||
IcImageDestroy ((void *) image->alphaMap);
|
||||
image->alphaMap = iAlpha;
|
||||
}
|
||||
break;
|
||||
case CPAlphaXOrigin:
|
||||
image->alphaOrigin.x = NEXT_VAL(INT16);
|
||||
image->alphaOrigin.x = NEXT_VAL(int16_t);
|
||||
break;
|
||||
case CPAlphaYOrigin:
|
||||
image->alphaOrigin.y = NEXT_VAL(INT16);
|
||||
image->alphaOrigin.y = NEXT_VAL(int16_t);
|
||||
break;
|
||||
case CPClipXOrigin:
|
||||
image->clipOrigin.x = NEXT_VAL(INT16);
|
||||
image->clipOrigin.x = NEXT_VAL(int16_t);
|
||||
break;
|
||||
case CPClipYOrigin:
|
||||
image->clipOrigin.y = NEXT_VAL(INT16);
|
||||
image->clipOrigin.y = NEXT_VAL(int16_t);
|
||||
break;
|
||||
case CPClipMask:
|
||||
{
|
||||
|
|
@ -405,7 +405,7 @@ IcImageChange (IcImage *image,
|
|||
clipType = CT_NONE;
|
||||
}
|
||||
error = IcImageChangeClip (image, clipType,
|
||||
(pointer)mask, 0);
|
||||
(void *)mask, 0);
|
||||
break;
|
||||
}
|
||||
case CPGraphicsExposure:
|
||||
|
|
@ -461,7 +461,7 @@ IcImageChange (IcImage *image,
|
|||
}
|
||||
break;
|
||||
case CPDither:
|
||||
image->dither = NEXT_VAL(Atom);
|
||||
image->dither = NEXT_VAL(unsigned long);
|
||||
break;
|
||||
case CPComponentAlpha:
|
||||
{
|
||||
|
|
@ -503,10 +503,10 @@ SetPictureClipRects (PicturePtr pPicture,
|
|||
clientClip = RECTS_TO_REGION(pScreen,
|
||||
nRect, rects, CT_UNSORTED);
|
||||
if (!clientClip)
|
||||
return BadAlloc;
|
||||
return 1;
|
||||
result =(*ps->ChangePictureClip) (pPicture, CT_REGION,
|
||||
(pointer) clientClip, 0);
|
||||
if (result == Success)
|
||||
(void *) clientClip, 0);
|
||||
if (result == 0)
|
||||
{
|
||||
pPicture->clipOrigin.x = xOrigin;
|
||||
pPicture->clipOrigin.y = yOrigin;
|
||||
|
|
@ -517,19 +517,19 @@ SetPictureClipRects (PicturePtr pPicture,
|
|||
}
|
||||
*/
|
||||
|
||||
Bool
|
||||
int
|
||||
IcComputeCompositeRegion (PixRegion *region,
|
||||
IcImage *iSrc,
|
||||
IcImage *iMask,
|
||||
IcImage *iDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height)
|
||||
int16_t xSrc,
|
||||
int16_t ySrc,
|
||||
int16_t xMask,
|
||||
int16_t yMask,
|
||||
int16_t xDst,
|
||||
int16_t yDst,
|
||||
uint16_t width,
|
||||
uint16_t height)
|
||||
{
|
||||
int v;
|
||||
int x1, y1, x2, y2;
|
||||
|
|
@ -550,13 +550,13 @@ IcComputeCompositeRegion (PixRegion *region,
|
|||
y1 >= y2)
|
||||
{
|
||||
PixRegionEmpty (region);
|
||||
return TRUE;
|
||||
return 1;
|
||||
}
|
||||
/* clip against src */
|
||||
if (!IcClipImageSrc (region, iSrc, xDst - xSrc, yDst - ySrc))
|
||||
{
|
||||
PixRegionDestroy (region);
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
if (iSrc->alphaMap)
|
||||
{
|
||||
|
|
@ -565,7 +565,7 @@ IcComputeCompositeRegion (PixRegion *region,
|
|||
yDst - (ySrc + iSrc->alphaOrigin.y)))
|
||||
{
|
||||
PixRegionDestroy (region);
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
/* clip against mask */
|
||||
|
|
@ -574,7 +574,7 @@ IcComputeCompositeRegion (PixRegion *region,
|
|||
if (!IcClipImageSrc (region, iMask, xDst - xMask, yDst - yMask))
|
||||
{
|
||||
PixRegionDestroy (region);
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
if (iMask->alphaMap)
|
||||
{
|
||||
|
|
@ -583,14 +583,14 @@ IcComputeCompositeRegion (PixRegion *region,
|
|||
yDst - (yMask + iMask->alphaOrigin.y)))
|
||||
{
|
||||
PixRegionDestroy (region);
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!IcClipImageReg (region, iDst->pCompositeClip, 0, 0))
|
||||
{
|
||||
PixRegionDestroy (region);
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
if (iDst->alphaMap)
|
||||
{
|
||||
|
|
@ -599,9 +599,9 @@ IcComputeCompositeRegion (PixRegion *region,
|
|||
-iDst->alphaOrigin.y))
|
||||
{
|
||||
PixRegionDestroy (region);
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,16 +26,14 @@
|
|||
#ifndef _ICIMAGE_H_
|
||||
#define _ICIMAGE_H_
|
||||
|
||||
#include <X11/Xdefs.h>
|
||||
|
||||
#include "X11/Xprotostr.h"
|
||||
|
||||
typedef xPoint DDXPointRec;
|
||||
|
||||
typedef union _DevUnion {
|
||||
pointer ptr;
|
||||
void *ptr;
|
||||
long val;
|
||||
unsigned long uval;
|
||||
pointer (*fptr)(
|
||||
void *(*fptr)(
|
||||
#if NeedFunctionPrototypes
|
||||
void
|
||||
#endif
|
||||
|
|
@ -49,7 +47,6 @@ typedef union _DevUnion {
|
|||
#include "resource.h"
|
||||
*/
|
||||
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
#define IcIntMult(a,b,t) ( (t) = (a) * (b) + 0x80, ( ( ( (t)>>8 ) + (t) )>>8 ) )
|
||||
#define IcIntDiv(a,b) (((uint16_t) (a) * 255) / (b))
|
||||
|
|
@ -121,12 +118,12 @@ struct _IcImage {
|
|||
unsigned int unused : 23;
|
||||
|
||||
struct _IcImage *alphaMap;
|
||||
DDXPointRec alphaOrigin;
|
||||
IcPoint alphaOrigin;
|
||||
|
||||
DDXPointRec clipOrigin;
|
||||
pointer clientClip;
|
||||
IcPoint clipOrigin;
|
||||
void *clientClip;
|
||||
|
||||
Atom dither;
|
||||
unsigned long dither;
|
||||
|
||||
unsigned long stateChanges;
|
||||
unsigned long serialNumber;
|
||||
|
|
@ -155,7 +152,7 @@ typedef uint8_t IcIndexType;
|
|||
|
||||
/* XXX: We're not supporting indexed operations, right?
|
||||
typedef struct _IcIndexed {
|
||||
Bool color;
|
||||
int color;
|
||||
uint32_t rgba[IC_MAX_INDEXED];
|
||||
IcIndexType ent[32768];
|
||||
} IcIndexedRec, *IcIndexedPtr;
|
||||
|
|
@ -180,7 +177,7 @@ IcImageInit (IcImage *image);
|
|||
extern int __internal_linkage
|
||||
IcImageChange (IcImage *image,
|
||||
Mask vmask,
|
||||
XID *vlist,
|
||||
unsigned int *vlist,
|
||||
DevUnion *ulist,
|
||||
int *error_value);
|
||||
|
||||
|
|
@ -195,7 +192,7 @@ IcValidatePicture (PicturePtr pPicture,
|
|||
|
||||
|
||||
/* XXX: What should this be?
|
||||
extern Bool __internal_linkage
|
||||
extern int __internal_linkage
|
||||
IcClipPicture (PixRegion *region,
|
||||
IcImage *image,
|
||||
int16_t xReg,
|
||||
|
|
@ -204,7 +201,7 @@ IcClipPicture (PixRegion *region,
|
|||
int16_t yPict);
|
||||
*/
|
||||
|
||||
extern Bool __internal_linkage
|
||||
extern int __internal_linkage
|
||||
IcComputeCompositeRegion (PixRegion *region,
|
||||
IcImage *iSrc,
|
||||
IcImage *iMask,
|
||||
|
|
@ -219,13 +216,13 @@ IcComputeCompositeRegion (PixRegion *region,
|
|||
uint16_t height);
|
||||
|
||||
/*
|
||||
extern Bool __internal_linkage
|
||||
extern int __internal_linkage
|
||||
IcPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats);
|
||||
*/
|
||||
|
||||
/*
|
||||
extern void __internal_linkage
|
||||
IcGlyphs (uint8_t op,
|
||||
IcGlyphs (IcOperator op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
|
|
@ -238,7 +235,7 @@ IcGlyphs (uint8_t op,
|
|||
|
||||
/*
|
||||
extern void __internal_linkage
|
||||
IcCompositeRects (uint8_t op,
|
||||
IcCompositeRects (IcOperator op,
|
||||
PicturePtr pDst,
|
||||
xRenderColor *color,
|
||||
int nRect,
|
||||
|
|
@ -251,7 +248,7 @@ IcCreateAlphaPicture (IcImage *dst,
|
|||
uint16_t width,
|
||||
uint16_t height);
|
||||
|
||||
typedef void (*CompositeFunc) (uint8_t op,
|
||||
typedef void (*CompositeFunc) (IcOperator op,
|
||||
IcImage *iSrc,
|
||||
IcImage *iMask,
|
||||
IcImage *iDst,
|
||||
|
|
@ -328,16 +325,16 @@ typedef struct _IcCompSrc {
|
|||
uint32_t alpha;
|
||||
} IcCompSrc;
|
||||
|
||||
extern Bool __internal_linkage
|
||||
extern int __internal_linkage
|
||||
IcBuildCompositeOperand (IcImage *image,
|
||||
IcCompositeOperand op[4],
|
||||
int16_t x,
|
||||
int16_t y,
|
||||
Bool transform,
|
||||
Bool alpha);
|
||||
int transform,
|
||||
int alpha);
|
||||
|
||||
extern void __internal_linkage
|
||||
IcCompositeGeneral (uint8_t op,
|
||||
IcCompositeGeneral (IcOperator op,
|
||||
IcImage *iSrc,
|
||||
IcImage *iMask,
|
||||
IcImage *iDst,
|
||||
|
|
|
|||
|
|
@ -29,11 +29,31 @@
|
|||
#include <string.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xmd.h>
|
||||
|
||||
|
||||
#include <slim_internal.h>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct _IcPoint {
|
||||
int16_t x,y ;
|
||||
} IcPoint;
|
||||
|
||||
typedef unsigned int Mask;
|
||||
|
||||
|
||||
#define GXor 0x7
|
||||
#define ClipByChildren 0
|
||||
#define PolyEdgeSharp 0
|
||||
#define PolyModePrecise 0
|
||||
#define CPClipMask (1 << 6)
|
||||
#define CPLastBit 11
|
||||
|
||||
|
||||
|
||||
|
||||
/* These few definitions avoid me needing to include servermd.h and misc.h from Xserver/include */
|
||||
#ifndef BITMAP_SCANLINE_PAD
|
||||
#define BITMAP_SCANLINE_PAD 32
|
||||
|
|
@ -41,8 +61,8 @@
|
|||
#define LOG2_BYTES_PER_SCANLINE_PAD 2
|
||||
#endif
|
||||
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
|
||||
|
||||
#define MAXSHORT SHRT_MAX
|
||||
#define MINSHORT SHRT_MIN
|
||||
|
|
@ -51,8 +71,7 @@
|
|||
#include "picture.h"
|
||||
*/
|
||||
|
||||
#include "X11/Xprotostr.h"
|
||||
#include "X11/extensions/Xrender.h"
|
||||
|
||||
|
||||
#include "ic.h"
|
||||
|
||||
|
|
@ -533,8 +552,8 @@ IcBlt (IcBits *src,
|
|||
IcBits pm,
|
||||
int bpp,
|
||||
|
||||
Bool reverse,
|
||||
Bool upsidedown);
|
||||
int reverse,
|
||||
int upsidedown);
|
||||
|
||||
extern void __internal_linkage
|
||||
IcBlt24 (IcBits *srcLine,
|
||||
|
|
@ -551,8 +570,8 @@ IcBlt24 (IcBits *srcLine,
|
|||
int alu,
|
||||
IcBits pm,
|
||||
|
||||
Bool reverse,
|
||||
Bool upsidedown);
|
||||
int reverse,
|
||||
int upsidedown);
|
||||
|
||||
extern void __internal_linkage
|
||||
IcBltStip (IcStip *src,
|
||||
|
|
@ -675,7 +694,7 @@ IcStipple (IcBits *dst,
|
|||
IcStride stipStride,
|
||||
int stipWidth,
|
||||
int stipHeight,
|
||||
Bool even,
|
||||
int even,
|
||||
|
||||
IcBits fgand,
|
||||
IcBits fgxor,
|
||||
|
|
@ -768,7 +787,7 @@ IcPixelsDestroy (IcPixels *pixels);
|
|||
|
||||
/* ictransform.c */
|
||||
|
||||
extern Bool __internal_linkage
|
||||
extern int __internal_linkage
|
||||
IcTransformPoint (IcTransform *transform,
|
||||
IcVector *vector);
|
||||
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ IcColorRects (IcImage *dst,
|
|||
int xoff,
|
||||
int yoff)
|
||||
{
|
||||
CARD32 pixel;
|
||||
CARD32 tmpval[4];
|
||||
uint32_t pixel;
|
||||
uint32_t tmpval[4];
|
||||
Region *clip;
|
||||
unsigned long mask;
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ IcColorRects (IcImage *dst,
|
|||
}
|
||||
*/
|
||||
|
||||
void IcFillRectangle (char op,
|
||||
void IcFillRectangle (IcOperator op,
|
||||
IcImage *dst,
|
||||
const IcColor *color,
|
||||
int x,
|
||||
|
|
@ -91,7 +91,7 @@ void IcFillRectangle (char op,
|
|||
}
|
||||
|
||||
void
|
||||
IcFillRectangles (char op,
|
||||
IcFillRectangles (IcOperator op,
|
||||
IcImage *dst,
|
||||
const IcColor *color,
|
||||
const IcRectangle *rects,
|
||||
|
|
@ -101,14 +101,14 @@ IcFillRectangles (char op,
|
|||
|
||||
if (color_s.alpha == 0xffff)
|
||||
{
|
||||
if (op == PictOpOver)
|
||||
op = PictOpSrc;
|
||||
if (op == IcOperatorOver)
|
||||
op = IcOperatorSrc;
|
||||
}
|
||||
if (op == PictOpClear)
|
||||
if (op == IcOperatorClear)
|
||||
color_s.red = color_s.green = color_s.blue = color_s.alpha = 0;
|
||||
|
||||
/* XXX: Really need this to optimize solid rectangles
|
||||
if (op == PictOpSrc || op == PictOpClear)
|
||||
if (op == IcOperatorSource || op == IcOperatorClear)
|
||||
{
|
||||
IcColorRects (dst, dst, &color_s, nRects, rects, 0, 0);
|
||||
if (dst->alphaMap)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ typedef xFixed_32_32 xFixed_48_16;
|
|||
#define MAX_FIXED_48_16 ((xFixed_48_16) 0x7fffffff)
|
||||
#define MIN_FIXED_48_16 (-((xFixed_48_16) 1 << 31))
|
||||
|
||||
Bool
|
||||
int
|
||||
IcTransformPoint (IcTransform *transform,
|
||||
IcVector *vector)
|
||||
{
|
||||
|
|
@ -47,20 +47,20 @@ IcTransformPoint (IcTransform *transform,
|
|||
v += partial >> 16;
|
||||
}
|
||||
if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16)
|
||||
return FALSE;
|
||||
return 0;
|
||||
result.vector[j] = (xFixed) v;
|
||||
}
|
||||
if (!result.vector[2])
|
||||
return FALSE;
|
||||
return 0;
|
||||
for (j = 0; j < 2; j++)
|
||||
{
|
||||
partial = (xFixed_48_16) result.vector[j] << 16;
|
||||
v = partial / result.vector[2];
|
||||
if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16)
|
||||
return FALSE;
|
||||
return 0;
|
||||
vector->vector[j] = (xFixed) v;
|
||||
}
|
||||
vector->vector[2] = xFixed1;
|
||||
return TRUE;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@
|
|||
IcImage *
|
||||
IcCreateAlphaPicture (IcImage *dst,
|
||||
IcFormat *format,
|
||||
CARD16 width,
|
||||
CARD16 height)
|
||||
uint16_t width,
|
||||
uint16_t height)
|
||||
{
|
||||
IcImage *image;
|
||||
int own_format = 0;
|
||||
|
|
@ -66,7 +66,7 @@ IcCreateAlphaPicture (IcImage *dst,
|
|||
}
|
||||
|
||||
static IcFixed16_16
|
||||
IcLineFixedX (const IcLineFixed *l, IcFixed16_16 y, Bool ceil)
|
||||
IcLineFixedX (const IcLineFixed *l, IcFixed16_16 y, int ceil)
|
||||
{
|
||||
IcFixed16_16 dx = l->p2.x - l->p1.x;
|
||||
xFixed_32_32 ex = (xFixed_32_32) (y - l->p1.y) * dx;
|
||||
|
|
@ -85,7 +85,7 @@ IcTrapezoidBounds (int ntrap, const IcTrapezoid *traps, PixRegionBox *box)
|
|||
box->x2 = MINSHORT;
|
||||
for (; ntrap; ntrap--, traps++)
|
||||
{
|
||||
INT16 x1, y1, x2, y2;
|
||||
int16_t x1, y1, x2, y2;
|
||||
|
||||
if (!xTrapezoidValid(traps))
|
||||
continue;
|
||||
|
|
@ -97,20 +97,20 @@ IcTrapezoidBounds (int ntrap, const IcTrapezoid *traps, PixRegionBox *box)
|
|||
if (y2 > box->y2)
|
||||
box->y2 = y2;
|
||||
|
||||
x1 = xFixedToInt (MIN (IcLineFixedX (&traps->left, traps->top, FALSE),
|
||||
IcLineFixedX (&traps->left, traps->bottom, FALSE)));
|
||||
x1 = xFixedToInt (MIN (IcLineFixedX (&traps->left, traps->top, 0),
|
||||
IcLineFixedX (&traps->left, traps->bottom, 0)));
|
||||
if (x1 < box->x1)
|
||||
box->x1 = x1;
|
||||
|
||||
x2 = xFixedToInt (xFixedCeil (MAX (IcLineFixedX (&traps->right, traps->top, TRUE),
|
||||
IcLineFixedX (&traps->right, traps->bottom, TRUE))));
|
||||
x2 = xFixedToInt (xFixedCeil (MAX (IcLineFixedX (&traps->right, traps->top, 1),
|
||||
IcLineFixedX (&traps->right, traps->bottom, 1))));
|
||||
if (x2 > box->x2)
|
||||
box->x2 = x2;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
IcCompositeTrapezoids (char op,
|
||||
IcCompositeTrapezoids (IcOperator op,
|
||||
IcImage *src,
|
||||
IcImage *dst,
|
||||
int xSrc,
|
||||
|
|
@ -120,8 +120,8 @@ IcCompositeTrapezoids (char op,
|
|||
{
|
||||
IcImage *image = NULL;
|
||||
PixRegionBox bounds;
|
||||
INT16 xDst, yDst;
|
||||
INT16 xRel, yRel;
|
||||
int16_t xDst, yDst;
|
||||
int16_t xRel, yRel;
|
||||
IcFormat *format;
|
||||
|
||||
if (ntraps == 0)
|
||||
|
|
@ -1132,7 +1132,7 @@ PixelAlpha(xFixed pixel_x,
|
|||
}
|
||||
|
||||
#define saturateAdd(t, a, b) (((t) = (a) + (b)), \
|
||||
((CARD8) ((t) | (0 - ((t) >> 8)))))
|
||||
((uint8_t) ((t) | (0 - ((t) >> 8)))))
|
||||
|
||||
#define addAlpha(mask, depth, alpha, temp) (\
|
||||
(*(mask)->store) ((mask), (alpha == (1 << depth) - 1) ? \
|
||||
|
|
@ -1186,7 +1186,7 @@ IcRasterizeTrapezoid (IcImage *pMask,
|
|||
pixelWalkInit(&left, &trap.left, trap.top, trap.bottom);
|
||||
pixelWalkInit(&right, &trap.right, trap.top, trap.bottom);
|
||||
|
||||
if (!IcBuildCompositeOperand (pMask, &mask, 0, xFixedToInt (trap.top), FALSE, FALSE))
|
||||
if (!IcBuildCompositeOperand (pMask, &mask, 0, xFixedToInt (trap.top), 0, 0))
|
||||
return;
|
||||
|
||||
for (y = trap.top; y < trap.bottom; y = y_next)
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ IcRasterizeTriangle (IcImage *image,
|
|||
}
|
||||
|
||||
void
|
||||
IcCompositeTriangles (char op,
|
||||
IcCompositeTriangles (IcOperator op,
|
||||
IcImage *src,
|
||||
IcImage *dst,
|
||||
int xSrc,
|
||||
|
|
@ -206,7 +206,7 @@ IcCompositeTriangles (char op,
|
|||
}
|
||||
|
||||
void
|
||||
IcCompositeTriStrip (char op,
|
||||
IcCompositeTriStrip (IcOperator op,
|
||||
IcImage *src,
|
||||
IcImage *dst,
|
||||
int xSrc,
|
||||
|
|
@ -282,7 +282,7 @@ IcCompositeTriStrip (char op,
|
|||
}
|
||||
|
||||
void
|
||||
IcCompositeTriFan (char op,
|
||||
IcCompositeTriFan (IcOperator op,
|
||||
IcImage *src,
|
||||
IcImage *dst,
|
||||
int xSrc,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue