mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-04-26 07:50:44 +02:00
Some reorganization and cruft removal
This commit is contained in:
parent
18edad04ed
commit
8bb4eb1beb
10 changed files with 1468 additions and 2924 deletions
|
|
@ -1,3 +1,8 @@
|
|||
2003-02-21 Carl Worth <cworth@isi.edu>
|
||||
|
||||
* src/ic.h: Started cleaning up the public interface of
|
||||
libic. Moved most of the cruft into icint.h.
|
||||
|
||||
2003-02-20 Carl Worth <cworth@isi.edu>
|
||||
|
||||
* AUTHORS: Added AUTHORS, NEWS, ChangeLog.
|
||||
|
|
|
|||
2145
pixman/src/ic.c
2145
pixman/src/ic.c
File diff suppressed because it is too large
Load diff
|
|
@ -735,133 +735,3 @@ IcBltOne24 (IcStip *srcLine,
|
|||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Not very efficient, but simple -- copy a single plane
|
||||
* from an N bit image to a 1 bit image
|
||||
*/
|
||||
|
||||
/* XXX: Do we need this?
|
||||
void
|
||||
IcBltPlane (IcBits *src,
|
||||
IcStride srcStride,
|
||||
int srcX,
|
||||
int srcBpp,
|
||||
|
||||
IcStip *dst,
|
||||
IcStride dstStride,
|
||||
int dstX,
|
||||
|
||||
int width,
|
||||
int height,
|
||||
|
||||
IcStip fgand,
|
||||
IcStip fgxor,
|
||||
IcStip bgand,
|
||||
IcStip bgxor,
|
||||
Pixel planeMask)
|
||||
{
|
||||
IcBits *s;
|
||||
IcBits pm;
|
||||
IcBits srcMask;
|
||||
IcBits srcMaskFirst;
|
||||
IcBits srcMask0 = 0;
|
||||
IcBits srcBits;
|
||||
|
||||
IcStip dstBits;
|
||||
IcStip *d;
|
||||
IcStip dstMask;
|
||||
IcStip dstMaskFirst;
|
||||
IcStip dstUnion;
|
||||
int w;
|
||||
int wt;
|
||||
int rot0;
|
||||
|
||||
if (!width)
|
||||
return;
|
||||
|
||||
src += srcX >> IC_SHIFT;
|
||||
srcX &= IC_MASK;
|
||||
|
||||
dst += dstX >> IC_STIP_SHIFT;
|
||||
dstX &= IC_STIP_MASK;
|
||||
|
||||
w = width / srcBpp;
|
||||
|
||||
pm = IcReplicatePixel (planeMask, srcBpp);
|
||||
#ifdef IC_24BIT
|
||||
if (srcBpp == 24)
|
||||
{
|
||||
int w = 24;
|
||||
|
||||
rot0 = IcFirst24Rot (srcX);
|
||||
if (srcX + w > IC_UNIT)
|
||||
w = IC_UNIT - srcX;
|
||||
srcMaskFirst = IcRot24(pm,rot0) & IcBitsMask(srcX,w);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
rot0 = 0;
|
||||
srcMaskFirst = pm & IcBitsMask(srcX, srcBpp);
|
||||
srcMask0 = pm & IcBitsMask(0, srcBpp);
|
||||
}
|
||||
|
||||
dstMaskFirst = IcStipMask(dstX,1);
|
||||
while (height--)
|
||||
{
|
||||
d = dst;
|
||||
dst += dstStride;
|
||||
s = src;
|
||||
src += srcStride;
|
||||
|
||||
srcMask = srcMaskFirst;
|
||||
#ifdef IC_24BIT
|
||||
if (srcBpp == 24)
|
||||
srcMask0 = IcRot24(pm,rot0) & IcBitsMask(0, srcBpp);
|
||||
#endif
|
||||
srcBits = *s++;
|
||||
|
||||
dstMask = dstMaskFirst;
|
||||
dstUnion = 0;
|
||||
dstBits = 0;
|
||||
|
||||
wt = w;
|
||||
|
||||
while (wt--)
|
||||
{
|
||||
if (!srcMask)
|
||||
{
|
||||
srcBits = *s++;
|
||||
#ifdef IC_24BIT
|
||||
if (srcBpp == 24)
|
||||
srcMask0 = IcNext24Pix(srcMask0) & IcBitsMask(0,24);
|
||||
#endif
|
||||
srcMask = srcMask0;
|
||||
}
|
||||
if (!dstMask)
|
||||
{
|
||||
*d = IcStippleRRopMask(*d, dstBits,
|
||||
fgand, fgxor, bgand, bgxor,
|
||||
dstUnion);
|
||||
d++;
|
||||
dstMask = IcStipMask(0,1);
|
||||
dstUnion = 0;
|
||||
dstBits = 0;
|
||||
}
|
||||
if (srcBits & srcMask)
|
||||
dstBits |= dstMask;
|
||||
dstUnion |= dstMask;
|
||||
if (srcBpp == IC_UNIT)
|
||||
srcMask = 0;
|
||||
else
|
||||
srcMask = IcScrRight(srcMask,srcBpp);
|
||||
dstMask = IcStipRight(dstMask,1);
|
||||
}
|
||||
if (dstUnion)
|
||||
*d = IcStippleRRopMask(*d,dstBits,
|
||||
fgand, fgxor, bgand, bgxor,
|
||||
dstUnion);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -2898,3 +2898,4 @@ IcCompositeGeneral (CARD8 op,
|
|||
(*pmsk->down) (pmsk);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,26 +24,6 @@
|
|||
*/
|
||||
|
||||
#include "icint.h"
|
||||
#include "icimage.h"
|
||||
|
||||
/* XXX: Need to trim down (eliminate?) these includes. */
|
||||
|
||||
#include "misc.h"
|
||||
/*
|
||||
#include "scrnintstr.h"
|
||||
#include "regionstr.h"
|
||||
#include "validate.h"
|
||||
#include "windowstr.h"
|
||||
#include "input.h"
|
||||
#include "colormapst.h"
|
||||
#include "cursorstr.h"
|
||||
#include "dixstruct.h"
|
||||
#include "gcstruct.h"
|
||||
#include "picturestr.h"
|
||||
*/
|
||||
#include "os.h"
|
||||
#include "resource.h"
|
||||
#include "servermd.h"
|
||||
|
||||
void
|
||||
IcFormatInit (IcFormat *format, IcFormatName name);
|
||||
|
|
|
|||
1701
pixman/src/icimage.c
1701
pixman/src/icimage.c
File diff suppressed because it is too large
Load diff
|
|
@ -88,8 +88,6 @@ typedef union _DevUnion {
|
|||
/* XXX: I'm not sure about several things here:
|
||||
|
||||
Do we want data to be IcBits * or unsigned char *?
|
||||
|
||||
I don't think I'm currently initializing depth or bpp anywhere...
|
||||
*/
|
||||
typedef struct _DirectFormat {
|
||||
CARD16 red, redMask;
|
||||
|
|
@ -324,22 +322,6 @@ IcCreateAlphaPicture (IcImage *dst,
|
|||
CARD16 width,
|
||||
CARD16 height);
|
||||
|
||||
/* XXX: Do we need these?
|
||||
Bool
|
||||
IcInitIndexed (ScreenPtr pScreen,
|
||||
PictFormatPtr pFormat);
|
||||
|
||||
void
|
||||
IcCloseIndexed (ScreenPtr pScreen,
|
||||
PictFormatPtr pFormat);
|
||||
|
||||
void
|
||||
IcUpdateIndexed (ScreenPtr pScreen,
|
||||
PictFormatPtr pFormat,
|
||||
int ndef,
|
||||
xColorItem *pdef);
|
||||
*/
|
||||
|
||||
typedef void (*CompositeFunc) (CARD8 op,
|
||||
IcImage *iSrc,
|
||||
IcImage *iMask,
|
||||
|
|
|
|||
|
|
@ -163,10 +163,6 @@ extern void IcSetBits (IcStip *bits, int stride, IcStip data);
|
|||
#define IcPatternOffsetBits (sizeof (IcBits) - 1)
|
||||
#endif
|
||||
|
||||
/* XXX: Don't think we need this
|
||||
#include "micoord.h"
|
||||
*/
|
||||
|
||||
#define IcStipLeft(x,n) IcScrLeft(x,n)
|
||||
#define IcStipRight(x,n) IcScrRight(x,n)
|
||||
|
||||
|
|
@ -522,100 +518,6 @@ extern void IcSetBits (IcStip *bits, int stride, IcStip data);
|
|||
/* Whether 24-bit specific code is needed for this filled pixel value */
|
||||
#define IcCheck24Pix(p) ((p) == IcNext24Pix(p))
|
||||
|
||||
/* Macros for dealing with dashing */
|
||||
|
||||
#define IcDashDeclare \
|
||||
unsigned char *__dash, *__firstDash, *__lastDash
|
||||
|
||||
#define IcDashInit(pGC,pPriv,dashOffset,dashlen,even) { \
|
||||
(even) = TRUE; \
|
||||
__firstDash = (pGC)->dash; \
|
||||
__lastDash = __firstDash + (pGC)->numInDashList; \
|
||||
(dashOffset) %= (pPriv)->dashLength; \
|
||||
\
|
||||
__dash = __firstDash; \
|
||||
while ((dashOffset) >= ((dashlen) = *__dash)) \
|
||||
{ \
|
||||
(dashOffset) -= (dashlen); \
|
||||
(even) = 1-(even); \
|
||||
if (++__dash == __lastDash) \
|
||||
__dash = __firstDash; \
|
||||
} \
|
||||
(dashlen) -= (dashOffset); \
|
||||
}
|
||||
|
||||
#define IcDashNext(dashlen) { \
|
||||
if (++__dash == __lastDash) \
|
||||
__dash = __firstDash; \
|
||||
(dashlen) = *__dash; \
|
||||
}
|
||||
|
||||
/* as numInDashList is always even, this case can skip a test */
|
||||
|
||||
#define IcDashNextEven(dashlen) { \
|
||||
(dashlen) = *++__dash; \
|
||||
}
|
||||
|
||||
#define IcDashNextOdd(dashlen) IcDashNext(dashlen)
|
||||
|
||||
#define IcDashStep(dashlen,even) { \
|
||||
if (!--(dashlen)) { \
|
||||
IcDashNext(dashlen); \
|
||||
(even) = 1-(even); \
|
||||
} \
|
||||
}
|
||||
|
||||
extern int IcGCPrivateIndex;
|
||||
#ifndef IC_NO_WINDOW_PIXMAPS
|
||||
extern int IcWinPrivateIndex;
|
||||
#endif
|
||||
|
||||
#ifdef TEKX11
|
||||
#define IC_OLD_GC
|
||||
#define IC_OLD_SCREEN
|
||||
#endif
|
||||
|
||||
#ifdef IC_OLD_SCREEN
|
||||
extern WindowPtr *WindowTable;
|
||||
#endif
|
||||
|
||||
#ifdef IC_24_32BIT
|
||||
#define IC_SCREEN_PRIVATE
|
||||
#endif
|
||||
|
||||
#ifdef IC_SCREEN_PRIVATE
|
||||
extern int IcScreenPrivateIndex;
|
||||
|
||||
/* private field of a screen */
|
||||
typedef struct {
|
||||
unsigned char win32bpp; /* window bpp for 32-bpp images */
|
||||
unsigned char pix32bpp; /* pixmap bpp for 32-bpp images */
|
||||
} IcScreenPrivRec, *IcScreenPrivPtr;
|
||||
|
||||
#define IcGetScreenPrivate(pScreen) ((icScreenPrivPtr) \
|
||||
(pScreen)->devPrivates[icScreenPrivateIndex].ptr)
|
||||
#endif
|
||||
|
||||
/* private field of GC */
|
||||
typedef struct {
|
||||
#ifdef IC_OLD_GC
|
||||
unsigned char pad1;
|
||||
unsigned char pad2;
|
||||
unsigned char pad3;
|
||||
unsigned fExpose:1;
|
||||
unsigned freeCompClip:1;
|
||||
PixmapPtr pRotatedPixmap;
|
||||
RegionPtr pCompositeClip;
|
||||
#endif
|
||||
IcBits and, xor; /* reduced rop values */
|
||||
IcBits bgand, bgxor; /* for stipples */
|
||||
IcBits fg, bg, pm; /* expanded and filled */
|
||||
unsigned int dashLength; /* total of all dash elements */
|
||||
unsigned char oneRect; /* clip list is single rectangle */
|
||||
unsigned char evenStipple; /* stipple is even */
|
||||
unsigned char bpp; /* current drawable bpp */
|
||||
} IcGCPrivRec, *IcGCPrivPtr;
|
||||
|
||||
#define IcGetPixels(icpixels, pointer, _stride_, _bpp_, xoff, yoff) { \
|
||||
(pointer) = icpixels->data; \
|
||||
(_stride_) = icpixels->stride / sizeof(IcBits); \
|
||||
|
|
@ -757,67 +659,6 @@ IcBltOne24 (IcStip *src,
|
|||
IcBits bgxor);
|
||||
#endif
|
||||
|
||||
/* XXX: Do we need this?
|
||||
void
|
||||
IcBltPlane (IcBits *src,
|
||||
IcStride srcStride,
|
||||
int srcX,
|
||||
int srcBpp,
|
||||
|
||||
IcStip *dst,
|
||||
IcStride dstStride,
|
||||
int dstX,
|
||||
|
||||
int width,
|
||||
int height,
|
||||
|
||||
IcStip fgand,
|
||||
IcStip fgxor,
|
||||
IcStip bgand,
|
||||
IcStip bgxor,
|
||||
Pixel planeMask);
|
||||
*/
|
||||
|
||||
/*
|
||||
* icpict.c
|
||||
*/
|
||||
|
||||
/* XXX: Name clash...
|
||||
Bool
|
||||
IcImageInit (ScreenPtr pScreen,
|
||||
PictFormatPtr formats,
|
||||
int nformats);
|
||||
*/
|
||||
|
||||
/*
|
||||
* icsolid.c
|
||||
*/
|
||||
|
||||
void
|
||||
IcSolid (IcBits *dst,
|
||||
IcStride dstStride,
|
||||
int dstX,
|
||||
int bpp,
|
||||
|
||||
int width,
|
||||
int height,
|
||||
|
||||
IcBits and,
|
||||
IcBits xor);
|
||||
|
||||
#ifdef IC_24BIT
|
||||
void
|
||||
IcSolid24 (IcBits *dst,
|
||||
IcStride dstStride,
|
||||
int dstX,
|
||||
|
||||
int width,
|
||||
int height,
|
||||
|
||||
IcBits and,
|
||||
IcBits xor);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* icstipple.c
|
||||
*/
|
||||
|
|
@ -894,68 +735,6 @@ IcStipple (IcBits *dst,
|
|||
int xRot,
|
||||
int yRot);
|
||||
|
||||
/*
|
||||
* ictile.c
|
||||
*/
|
||||
|
||||
/* XXX: I screwed this up somehow in the fb->Ic rename
|
||||
void
|
||||
IcEvenTile (IcBits *dst,
|
||||
IcStride dstStride,
|
||||
int dstX,
|
||||
|
||||
int width,
|
||||
int height,
|
||||
|
||||
IcBits *tile,
|
||||
int tileHeight,
|
||||
|
||||
int alu,
|
||||
IcBits pm,
|
||||
int xRot,
|
||||
int yRot);
|
||||
*/
|
||||
|
||||
void
|
||||
IcOddTile (IcBits *dst,
|
||||
IcStride dstStride,
|
||||
int dstX,
|
||||
|
||||
int width,
|
||||
int height,
|
||||
|
||||
IcBits *tile,
|
||||
IcStride tileStride,
|
||||
int tileWidth,
|
||||
int tileHeight,
|
||||
|
||||
int alu,
|
||||
IcBits pm,
|
||||
int bpp,
|
||||
|
||||
int xRot,
|
||||
int yRot);
|
||||
|
||||
void
|
||||
IcTile (IcBits *dst,
|
||||
IcStride dstStride,
|
||||
int dstX,
|
||||
|
||||
int width,
|
||||
int height,
|
||||
|
||||
IcBits *tile,
|
||||
IcStride tileStride,
|
||||
int tileWidth,
|
||||
int tileHeight,
|
||||
|
||||
int alu,
|
||||
IcBits pm,
|
||||
int bpp,
|
||||
|
||||
int xRot,
|
||||
int yRot);
|
||||
|
||||
struct _IcPixels {
|
||||
IcBits *data;
|
||||
unsigned int width;
|
||||
|
|
|
|||
70
pixman/src/ictransform.c
Normal file
70
pixman/src/ictransform.c
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
* $XFree86: $
|
||||
*
|
||||
* Copyright © 2000 SuSE, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of SuSE not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. SuSE makes no representations about the
|
||||
* suitability of this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*
|
||||
* SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
|
||||
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
* Author: Keith Packard, SuSE, Inc.
|
||||
*/
|
||||
|
||||
#include "icint.h"
|
||||
|
||||
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))
|
||||
|
||||
/* XXX: Still need to port this
|
||||
Bool
|
||||
IcTransformPoint (IcTransform *transform,
|
||||
PictVectorPtr vector)
|
||||
{
|
||||
PictVector result;
|
||||
int i, j;
|
||||
xFixed_32_32 partial;
|
||||
xFixed_48_16 v;
|
||||
|
||||
for (j = 0; j < 3; j++)
|
||||
{
|
||||
v = 0;
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
partial = ((xFixed_48_16) transform->matrix[j][i] *
|
||||
(xFixed_48_16) vector->vector[i]);
|
||||
v += partial >> 16;
|
||||
}
|
||||
if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16)
|
||||
return FALSE;
|
||||
result.vector[j] = (xFixed) v;
|
||||
}
|
||||
if (!result.vector[2])
|
||||
return FALSE;
|
||||
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;
|
||||
vector->vector[j] = (xFixed) v;
|
||||
}
|
||||
vector->vector[2] = xFixed1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
*/
|
||||
|
|
@ -39,87 +39,6 @@ IcReplicatePixel (Pixel p, int bpp)
|
|||
return b;
|
||||
}
|
||||
|
||||
#ifdef XXX_DO_WE_NEED_THIS
|
||||
void
|
||||
IcReduceRasterOp (int rop, IcBits fg, IcBits pm, IcBits *andp, IcBits *xorp)
|
||||
{
|
||||
IcBits and, xor;
|
||||
|
||||
switch (rop)
|
||||
{
|
||||
default:
|
||||
case GXclear: /* 0 0 0 0 */
|
||||
and = 0;
|
||||
xor = 0;
|
||||
break;
|
||||
case GXand: /* 0 0 0 1 */
|
||||
and = fg;
|
||||
xor = 0;
|
||||
break;
|
||||
case GXandReverse: /* 0 0 1 0 */
|
||||
and = fg;
|
||||
xor = fg;
|
||||
break;
|
||||
case GXcopy: /* 0 0 1 1 */
|
||||
and = 0;
|
||||
xor = fg;
|
||||
break;
|
||||
case GXandInverted: /* 0 1 0 0 */
|
||||
and = ~fg;
|
||||
xor = 0;
|
||||
break;
|
||||
case GXnoop: /* 0 1 0 1 */
|
||||
and = IC_ALLONES;
|
||||
xor = 0;
|
||||
break;
|
||||
case GXxor: /* 0 1 1 0 */
|
||||
and = IC_ALLONES;
|
||||
xor = fg;
|
||||
break;
|
||||
case GXor: /* 0 1 1 1 */
|
||||
and = ~fg;
|
||||
xor = fg;
|
||||
break;
|
||||
case GXnor: /* 1 0 0 0 */
|
||||
and = ~fg;
|
||||
xor = ~fg;
|
||||
break;
|
||||
case GXequiv: /* 1 0 0 1 */
|
||||
and = IC_ALLONES;
|
||||
xor = ~fg;
|
||||
break;
|
||||
case GXinvert: /* 1 0 1 0 */
|
||||
and = IC_ALLONES;
|
||||
xor = IC_ALLONES;
|
||||
break;
|
||||
case GXorReverse: /* 1 0 1 1 */
|
||||
and = ~fg;
|
||||
xor = IC_ALLONES;
|
||||
break;
|
||||
case GXcopyInverted: /* 1 1 0 0 */
|
||||
and = 0;
|
||||
xor = ~fg;
|
||||
break;
|
||||
case GXorInverted: /* 1 1 0 1 */
|
||||
and = fg;
|
||||
xor = ~fg;
|
||||
break;
|
||||
case GXnand: /* 1 1 1 0 */
|
||||
and = fg;
|
||||
xor = IC_ALLONES;
|
||||
break;
|
||||
case GXset: /* 1 1 1 1 */
|
||||
and = 0;
|
||||
xor = IC_ALLONES;
|
||||
break;
|
||||
}
|
||||
and |= ~pm;
|
||||
xor &= pm;
|
||||
*andp = and;
|
||||
*xorp = xor;
|
||||
}
|
||||
#endif /* XXX_DO_WE_NEED_THIS */
|
||||
|
||||
#define O 0
|
||||
#define I IC_ALLONES
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue