Compare commits
23 Commits
master
...
submit/fb.
Author | SHA1 | Date | |
---|---|---|---|
|
3acbea5bba | ||
|
9234ef1306 | ||
|
7247c99e42 | ||
|
b1d01277cf | ||
|
cc52d9f2a7 | ||
|
319c06a43e | ||
|
720fcb0e5f | ||
|
fc100d1477 | ||
|
a02135a1e3 | ||
|
3e097272b6 | ||
|
9c0d93bc3e | ||
|
954b8a7df3 | ||
|
6a55c94883 | ||
|
7704464dc4 | ||
|
a938ed6206 | ||
|
b9162798c0 | ||
|
57790da625 | ||
|
ebd5114ca2 | ||
|
03c3a0d410 | ||
|
676e3722e4 | ||
|
e3ca015dbc | ||
|
9eeb8b8304 | ||
|
3d652bf68e |
174
fb/fb.h
174
fb/fb.h
|
@ -48,29 +48,11 @@
|
||||||
#define WRITE(ptr, val) ((*wfbWriteMemory)((ptr), (val), sizeof(*(ptr))))
|
#define WRITE(ptr, val) ((*wfbWriteMemory)((ptr), (val), sizeof(*(ptr))))
|
||||||
#define READ(ptr) ((*wfbReadMemory)((ptr), sizeof(*(ptr))))
|
#define READ(ptr) ((*wfbReadMemory)((ptr), sizeof(*(ptr))))
|
||||||
|
|
||||||
#define MEMCPY_WRAPPED(dst, src, size) do { \
|
|
||||||
size_t _i; \
|
|
||||||
CARD8 *_dst = (CARD8*)(dst), *_src = (CARD8*)(src); \
|
|
||||||
for(_i = 0; _i < size; _i++) { \
|
|
||||||
WRITE(_dst +_i, READ(_src + _i)); \
|
|
||||||
} \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
#define MEMSET_WRAPPED(dst, val, size) do { \
|
|
||||||
size_t _i; \
|
|
||||||
CARD8 *_dst = (CARD8*)(dst); \
|
|
||||||
for(_i = 0; _i < size; _i++) { \
|
|
||||||
WRITE(_dst +_i, (val)); \
|
|
||||||
} \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define FBPREFIX(x) fb##x
|
#define FBPREFIX(x) fb##x
|
||||||
#define WRITE(ptr, val) (*(ptr) = (val))
|
#define WRITE(ptr, val) (*(ptr) = (val))
|
||||||
#define READ(ptr) (*(ptr))
|
#define READ(ptr) (*(ptr))
|
||||||
#define MEMCPY_WRAPPED(dst, src, size) memcpy((dst), (src), (size))
|
|
||||||
#define MEMSET_WRAPPED(dst, val, size) memset((dst), (val), (size))
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -93,10 +75,6 @@
|
||||||
#define FB_STIP_UNIT (1 << FB_STIP_SHIFT)
|
#define FB_STIP_UNIT (1 << FB_STIP_SHIFT)
|
||||||
#define FB_STIP_MASK (FB_STIP_UNIT - 1)
|
#define FB_STIP_MASK (FB_STIP_UNIT - 1)
|
||||||
#define FB_STIP_ALLONES ((FbStip) -1)
|
#define FB_STIP_ALLONES ((FbStip) -1)
|
||||||
#define FB_STIP_ODDSTRIDE(s) (((s) & (FB_MASK >> FB_STIP_SHIFT)) != 0)
|
|
||||||
#define FB_STIP_ODDPTR(p) ((((long) (p)) & (FB_MASK >> 3)) != 0)
|
|
||||||
#define FbStipStrideToBitsStride(s) (((s) >> (FB_SHIFT - FB_STIP_SHIFT)))
|
|
||||||
#define FbBitsStrideToStipStride(s) (((s) << (FB_SHIFT - FB_STIP_SHIFT)))
|
|
||||||
#define FbFullMask(n) ((n) == FB_UNIT ? FB_ALLONES : ((((FbBits) 1) << n) - 1))
|
#define FbFullMask(n) ((n) == FB_UNIT ? FB_ALLONES : ((((FbBits) 1) << n) - 1))
|
||||||
|
|
||||||
#if FB_SHIFT == 5
|
#if FB_SHIFT == 5
|
||||||
|
@ -111,31 +89,17 @@ typedef FbBits FbStip;
|
||||||
|
|
||||||
typedef int FbStride;
|
typedef int FbStride;
|
||||||
|
|
||||||
#ifdef FB_DEBUG
|
|
||||||
extern _X_EXPORT void fbValidateDrawable(DrawablePtr d);
|
|
||||||
extern _X_EXPORT void fbInitializeDrawable(DrawablePtr d);
|
|
||||||
extern _X_EXPORT void fbSetBits(FbStip * bits, int stride, FbStip data);
|
|
||||||
|
|
||||||
#define FB_HEAD_BITS (FbStip) (0xbaadf00d)
|
|
||||||
#define FB_TAIL_BITS (FbStip) (0xbaddf0ad)
|
|
||||||
#else
|
|
||||||
#define fbValidateDrawable(d)
|
|
||||||
#define fdInitializeDrawable(d)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "fbrop.h"
|
#include "fbrop.h"
|
||||||
|
|
||||||
#if BITMAP_BIT_ORDER == LSBFirst
|
#if BITMAP_BIT_ORDER == LSBFirst
|
||||||
#define FbScrLeft(x,n) ((x) >> (n))
|
#define FbScrLeft(x,n) ((x) >> (n))
|
||||||
#define FbScrRight(x,n) ((x) << (n))
|
#define FbScrRight(x,n) ((x) << (n))
|
||||||
/* #define FbLeftBits(x,n) ((x) & ((((FbBits) 1) << (n)) - 1)) */
|
|
||||||
#define FbLeftStipBits(x,n) ((x) & ((((FbStip) 1) << (n)) - 1))
|
#define FbLeftStipBits(x,n) ((x) & ((((FbStip) 1) << (n)) - 1))
|
||||||
#define FbStipMoveLsb(x,s,n) (FbStipRight (x,(s)-(n)))
|
#define FbStipMoveLsb(x,s,n) (FbStipRight (x,(s)-(n)))
|
||||||
#define FbPatternOffsetBits 0
|
#define FbPatternOffsetBits 0
|
||||||
#else
|
#else
|
||||||
#define FbScrLeft(x,n) ((x) << (n))
|
#define FbScrLeft(x,n) ((x) << (n))
|
||||||
#define FbScrRight(x,n) ((x) >> (n))
|
#define FbScrRight(x,n) ((x) >> (n))
|
||||||
/* #define FbLeftBits(x,n) ((x) >> (FB_UNIT - (n))) */
|
|
||||||
#define FbLeftStipBits(x,n) ((x) >> (FB_STIP_UNIT - (n)))
|
#define FbLeftStipBits(x,n) ((x) >> (FB_STIP_UNIT - (n)))
|
||||||
#define FbStipMoveLsb(x,s,n) (x)
|
#define FbStipMoveLsb(x,s,n) (x)
|
||||||
#define FbPatternOffsetBits (sizeof (FbBits) - 1)
|
#define FbPatternOffsetBits (sizeof (FbBits) - 1)
|
||||||
|
@ -147,10 +111,6 @@ extern _X_EXPORT void fbSetBits(FbStip * bits, int stride, FbStip data);
|
||||||
#define FbStipRight(x,n) FbScrRight(x,n)
|
#define FbStipRight(x,n) FbScrRight(x,n)
|
||||||
|
|
||||||
#define FbRotLeft(x,n) FbScrLeft(x,n) | (n ? FbScrRight(x,FB_UNIT-n) : 0)
|
#define FbRotLeft(x,n) FbScrLeft(x,n) | (n ? FbScrRight(x,FB_UNIT-n) : 0)
|
||||||
#define FbRotRight(x,n) FbScrRight(x,n) | (n ? FbScrLeft(x,FB_UNIT-n) : 0)
|
|
||||||
|
|
||||||
#define FbRotStipLeft(x,n) FbStipLeft(x,n) | (n ? FbStipRight(x,FB_STIP_UNIT-n) : 0)
|
|
||||||
#define FbRotStipRight(x,n) FbStipRight(x,n) | (n ? FbStipLeft(x,FB_STIP_UNIT-n) : 0)
|
|
||||||
|
|
||||||
#define FbLeftMask(x) ( ((x) & FB_MASK) ? \
|
#define FbLeftMask(x) ( ((x) & FB_MASK) ? \
|
||||||
FbScrRight(FB_ALLONES,(x) & FB_MASK) : 0)
|
FbScrRight(FB_ALLONES,(x) & FB_MASK) : 0)
|
||||||
|
@ -168,21 +128,6 @@ extern _X_EXPORT void fbSetBits(FbStip * bits, int stride, FbStip data);
|
||||||
#define FbStipMask(x,w) (FbStipRight(FB_STIP_ALLONES,(x) & FB_STIP_MASK) & \
|
#define FbStipMask(x,w) (FbStipRight(FB_STIP_ALLONES,(x) & FB_STIP_MASK) & \
|
||||||
FbStipLeft(FB_STIP_ALLONES,(FB_STIP_UNIT - ((x)+(w))) & FB_STIP_MASK))
|
FbStipLeft(FB_STIP_ALLONES,(FB_STIP_UNIT - ((x)+(w))) & FB_STIP_MASK))
|
||||||
|
|
||||||
#define FbMaskBits(x,w,l,n,r) { \
|
|
||||||
n = (w); \
|
|
||||||
r = FbRightMask((x)+n); \
|
|
||||||
l = FbLeftMask(x); \
|
|
||||||
if (l) { \
|
|
||||||
n -= FB_UNIT - ((x) & FB_MASK); \
|
|
||||||
if (n < 0) { \
|
|
||||||
n = 0; \
|
|
||||||
l &= r; \
|
|
||||||
r = 0; \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
n >>= FB_SHIFT; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define FbByteMaskInvalid 0x10
|
#define FbByteMaskInvalid 0x10
|
||||||
|
|
||||||
#define FbPatternOffset(o,t) ((o) ^ (FbPatternOffsetBits & ~(sizeof (t) - 1)))
|
#define FbPatternOffset(o,t) ((o) ^ (FbPatternOffsetBits & ~(sizeof (t) - 1)))
|
||||||
|
@ -278,102 +223,6 @@ extern _X_EXPORT void fbSetBits(FbStip * bits, int stride, FbStip data);
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define FbMaskStip(x,w,l,n,r) { \
|
|
||||||
n = (w); \
|
|
||||||
r = FbRightStipMask((x)+n); \
|
|
||||||
l = FbLeftStipMask(x); \
|
|
||||||
if (l) { \
|
|
||||||
n -= FB_STIP_UNIT - ((x) & FB_STIP_MASK); \
|
|
||||||
if (n < 0) { \
|
|
||||||
n = 0; \
|
|
||||||
l &= r; \
|
|
||||||
r = 0; \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
n >>= FB_STIP_SHIFT; \
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* These macros are used to transparently stipple
|
|
||||||
* in copy mode; the expected usage is with 'n' constant
|
|
||||||
* so all of the conditional parts collapse into a minimal
|
|
||||||
* sequence of partial word writes
|
|
||||||
*
|
|
||||||
* 'n' is the bytemask of which bytes to store, 'a' is the address
|
|
||||||
* of the FbBits base unit, 'o' is the offset within that unit
|
|
||||||
*
|
|
||||||
* The term "lane" comes from the hardware term "byte-lane" which
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define FbLaneCase1(n,a,o) \
|
|
||||||
if ((n) == 0x01) { \
|
|
||||||
WRITE((CARD8 *) ((a)+FbPatternOffset(o,CARD8)), fgxor); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define FbLaneCase2(n,a,o) \
|
|
||||||
if ((n) == 0x03) { \
|
|
||||||
WRITE((CARD16 *) ((a)+FbPatternOffset(o,CARD16)), fgxor); \
|
|
||||||
} else { \
|
|
||||||
FbLaneCase1((n)&1,a,o) \
|
|
||||||
FbLaneCase1((n)>>1,a,(o)+1) \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define FbLaneCase4(n,a,o) \
|
|
||||||
if ((n) == 0x0f) { \
|
|
||||||
WRITE((CARD32 *) ((a)+FbPatternOffset(o,CARD32)), fgxor); \
|
|
||||||
} else { \
|
|
||||||
FbLaneCase2((n)&3,a,o) \
|
|
||||||
FbLaneCase2((n)>>2,a,(o)+2) \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define FbLaneCase(n,a) FbLaneCase4(n,(CARD8 *) (a),0)
|
|
||||||
|
|
||||||
/* Macros for dealing with dashing */
|
|
||||||
|
|
||||||
#define FbDashDeclare \
|
|
||||||
unsigned char *__dash, *__firstDash, *__lastDash
|
|
||||||
|
|
||||||
#define FbDashInit(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 FbDashNext(dashlen) { \
|
|
||||||
if (++__dash == __lastDash) \
|
|
||||||
__dash = __firstDash; \
|
|
||||||
(dashlen) = *__dash; \
|
|
||||||
}
|
|
||||||
|
|
||||||
/* as numInDashList is always even, this case can skip a test */
|
|
||||||
|
|
||||||
#define FbDashNextEven(dashlen) { \
|
|
||||||
(dashlen) = *++__dash; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define FbDashNextOdd(dashlen) FbDashNext(dashlen)
|
|
||||||
|
|
||||||
#define FbDashStep(dashlen,even) { \
|
|
||||||
if (!--(dashlen)) { \
|
|
||||||
FbDashNext(dashlen); \
|
|
||||||
(even) = 1-(even); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
extern _X_EXPORT const GCOps fbGCOps;
|
|
||||||
extern _X_EXPORT const GCFuncs fbGCFuncs;
|
|
||||||
|
|
||||||
/* Framebuffer access wrapper */
|
/* Framebuffer access wrapper */
|
||||||
typedef FbBits(*ReadMemoryProcPtr) (const void *src, int size);
|
typedef FbBits(*ReadMemoryProcPtr) (const void *src, int size);
|
||||||
typedef void (*WriteMemoryProcPtr) (void *dst, FbBits value, int size);
|
typedef void (*WriteMemoryProcPtr) (void *dst, FbBits value, int size);
|
||||||
|
@ -423,15 +272,7 @@ typedef struct {
|
||||||
unsigned int dashLength; /* total of all dash elements */
|
unsigned int dashLength; /* total of all dash elements */
|
||||||
} FbGCPrivRec, *FbGCPrivPtr;
|
} FbGCPrivRec, *FbGCPrivPtr;
|
||||||
|
|
||||||
#define fbGetGCPrivateKey(pGC) (&fbGetScreenPrivate((pGC)->pScreen)->gcPrivateKeyRec)
|
|
||||||
|
|
||||||
#define fbGetGCPrivate(pGC) ((FbGCPrivPtr)\
|
|
||||||
dixLookupPrivate(&(pGC)->devPrivates, fbGetGCPrivateKey(pGC)))
|
|
||||||
|
|
||||||
#define fbGetCompositeClip(pGC) ((pGC)->pCompositeClip)
|
#define fbGetCompositeClip(pGC) ((pGC)->pCompositeClip)
|
||||||
#define fbGetExpose(pGC) ((pGC)->fExpose)
|
|
||||||
|
|
||||||
#define fbGetScreenPixmap(s) ((PixmapPtr) (s)->devPrivate)
|
|
||||||
|
|
||||||
#define fbGetWinPrivateKey(pWin) (&fbGetScreenPrivate(((DrawablePtr) (pWin))->pScreen)->winPrivateKeyRec)
|
#define fbGetWinPrivateKey(pWin) (&fbGetScreenPrivate(((DrawablePtr) (pWin))->pScreen)->winPrivateKeyRec)
|
||||||
|
|
||||||
|
@ -506,12 +347,6 @@ typedef struct {
|
||||||
*/
|
*/
|
||||||
#define FbEvenTile(w) ((w) <= FB_UNIT && FbPowerOfTwo(w))
|
#define FbEvenTile(w) ((w) <= FB_UNIT && FbPowerOfTwo(w))
|
||||||
|
|
||||||
/*
|
|
||||||
* fballpriv.c
|
|
||||||
*/
|
|
||||||
extern _X_EXPORT Bool
|
|
||||||
fbAllocatePrivates(ScreenPtr pScreen);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* fbarc.c
|
* fbarc.c
|
||||||
*/
|
*/
|
||||||
|
@ -716,9 +551,6 @@ fbBltPlane(FbBits * src,
|
||||||
/*
|
/*
|
||||||
* fbcmap_mi.c
|
* fbcmap_mi.c
|
||||||
*/
|
*/
|
||||||
extern _X_EXPORT int
|
|
||||||
fbListInstalledColormaps(ScreenPtr pScreen, Colormap * pmaps);
|
|
||||||
|
|
||||||
extern _X_EXPORT void
|
extern _X_EXPORT void
|
||||||
fbInstallColormap(ColormapPtr pmap);
|
fbInstallColormap(ColormapPtr pmap);
|
||||||
|
|
||||||
|
@ -838,10 +670,6 @@ extern _X_EXPORT void
|
||||||
fbPolyFillRect(DrawablePtr pDrawable,
|
fbPolyFillRect(DrawablePtr pDrawable,
|
||||||
GCPtr pGC, int nrectInit, xRectangle *prectInit);
|
GCPtr pGC, int nrectInit, xRectangle *prectInit);
|
||||||
|
|
||||||
#define fbPolyFillArc miPolyFillArc
|
|
||||||
|
|
||||||
#define fbFillPolygon miFillPolygon
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* fbfillsp.c
|
* fbfillsp.c
|
||||||
*/
|
*/
|
||||||
|
@ -946,8 +774,6 @@ extern _X_EXPORT void
|
||||||
extern _X_EXPORT void
|
extern _X_EXPORT void
|
||||||
fbPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg);
|
fbPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg);
|
||||||
|
|
||||||
#define fbPolyRectangle miPolyRectangle
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* fbpict.c
|
* fbpict.c
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
/* SPDX-License-Identifier: MIT OR X11
|
||||||
|
*
|
||||||
|
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
|
||||||
|
*/
|
||||||
|
#ifndef XORG_FB_PRIV_H
|
||||||
|
#define XORG_FB_PRIV_H
|
||||||
|
|
||||||
|
#include <X11/Xdefs.h>
|
||||||
|
|
||||||
|
#include "include/scrnintstr.h"
|
||||||
|
#include "fb/fb.h"
|
||||||
|
|
||||||
|
#define FbBitsStrideToStipStride(s) (((s) << (FB_SHIFT - FB_STIP_SHIFT)))
|
||||||
|
|
||||||
|
#define fbGetGCPrivateKey(pGC) (&fbGetScreenPrivate((pGC)->pScreen)->gcPrivateKeyRec)
|
||||||
|
#define fbGetGCPrivate(pGC) ((FbGCPrivPtr)dixLookupPrivate(&(pGC)->devPrivates, fbGetGCPrivateKey(pGC)))
|
||||||
|
|
||||||
|
#define fbGetScreenPixmap(s) ((PixmapPtr) (s)->devPrivate)
|
||||||
|
|
||||||
|
#ifdef FB_DEBUG
|
||||||
|
|
||||||
|
#define FB_HEAD_BITS (FbStip) (0xbaadf00d)
|
||||||
|
#define FB_TAIL_BITS (FbStip) (0xbaddf0ad)
|
||||||
|
|
||||||
|
void fbValidateDrawable(DrawablePtr d);
|
||||||
|
void fbSetBits(FbStip * bits, int stride, FbStip data);
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
static inline void fbValidateDrawable(DrawablePtr d) {}
|
||||||
|
|
||||||
|
#endif /* FB_DEBUG */
|
||||||
|
|
||||||
|
Bool fbAllocatePrivates(ScreenPtr pScreen);
|
||||||
|
int fbListInstalledColormaps(ScreenPtr pScreen, Colormap* pmaps);
|
||||||
|
|
||||||
|
#endif /* XORG_FB_PRIV_H */
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
|
||||||
#include "fb.h"
|
#include "fb/fb_priv.h"
|
||||||
|
|
||||||
static DevPrivateKeyRec fbScreenPrivateKeyRec;
|
static DevPrivateKeyRec fbScreenPrivateKeyRec;
|
||||||
DevPrivateKey
|
DevPrivateKey
|
||||||
|
|
|
@ -22,7 +22,8 @@
|
||||||
|
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
|
||||||
#include "fb.h"
|
#include "fb/fb_priv.h"
|
||||||
|
|
||||||
#include "mizerarc.h"
|
#include "mizerarc.h"
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
|
|
62
fb/fbbits.h
62
fb/fbbits.h
|
@ -31,6 +31,66 @@
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "fb/fb_priv.h"
|
||||||
|
|
||||||
|
#define __FbMaskBits(x,w,l,n,r) { \
|
||||||
|
n = (w); \
|
||||||
|
r = FbRightMask((x)+n); \
|
||||||
|
l = FbLeftMask(x); \
|
||||||
|
if (l) { \
|
||||||
|
n -= FB_UNIT - ((x) & FB_MASK); \
|
||||||
|
if (n < 0) { \
|
||||||
|
n = 0; \
|
||||||
|
l &= r; \
|
||||||
|
r = 0; \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
n >>= FB_SHIFT; \
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Macros for dealing with dashing */
|
||||||
|
|
||||||
|
#define FbDashDeclare \
|
||||||
|
unsigned char *__dash, *__firstDash, *__lastDash
|
||||||
|
|
||||||
|
#define FbDashInit(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 FbDashNext(dashlen) { \
|
||||||
|
if (++__dash == __lastDash) \
|
||||||
|
__dash = __firstDash; \
|
||||||
|
(dashlen) = *__dash; \
|
||||||
|
}
|
||||||
|
|
||||||
|
/* as numInDashList is always even, this case can skip a test */
|
||||||
|
|
||||||
|
#define FbDashNextEven(dashlen) { \
|
||||||
|
(dashlen) = *++__dash; \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define FbDashNextOdd(dashlen) FbDashNext(dashlen)
|
||||||
|
|
||||||
|
#define FbDashStep(dashlen,even) { \
|
||||||
|
if (!--(dashlen)) { \
|
||||||
|
FbDashNext(dashlen); \
|
||||||
|
(even) = 1-(even); \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef BITSSTORE
|
#ifdef BITSSTORE
|
||||||
#define STORE(b,x) BITSSTORE(b,x)
|
#define STORE(b,x) BITSSTORE(b,x)
|
||||||
#else
|
#else
|
||||||
|
@ -785,7 +845,7 @@ POLYSEGMENT(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg)
|
||||||
dstLine = dst + (intToY(pt1) + yoff + dstYoff) * dstStride;
|
dstLine = dst + (intToY(pt1) + yoff + dstYoff) * dstStride;
|
||||||
dstLine += dstX >> FB_SHIFT;
|
dstLine += dstX >> FB_SHIFT;
|
||||||
dstX &= FB_MASK;
|
dstX &= FB_MASK;
|
||||||
FbMaskBits(dstX, width, startmask, nmiddle, endmask);
|
__FbMaskBits(dstX, width, startmask, nmiddle, endmask);
|
||||||
if (startmask) {
|
if (startmask) {
|
||||||
WRITE(dstLine,
|
WRITE(dstLine,
|
||||||
FbDoMaskRRop(READ(dstLine), andBits, xorBits,
|
FbDoMaskRRop(READ(dstLine), andBits, xorBits,
|
||||||
|
|
27
fb/fbblt.c
27
fb/fbblt.c
|
@ -25,6 +25,33 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "fb.h"
|
#include "fb.h"
|
||||||
|
|
||||||
|
#ifdef FB_ACCESS_WRAPPER
|
||||||
|
|
||||||
|
#define MEMCPY_WRAPPED(dst, src, size) do { \
|
||||||
|
size_t _i; \
|
||||||
|
CARD8 *_dst = (CARD8*)(dst), *_src = (CARD8*)(src); \
|
||||||
|
for(_i = 0; _i < size; _i++) { \
|
||||||
|
WRITE(_dst +_i, READ(_src + _i)); \
|
||||||
|
} \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
#define MEMSET_WRAPPED(dst, val, size) do { \
|
||||||
|
size_t _i; \
|
||||||
|
CARD8 *_dst = (CARD8*)(dst); \
|
||||||
|
for(_i = 0; _i < size; _i++) { \
|
||||||
|
WRITE(_dst +_i, (val)); \
|
||||||
|
} \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#define MEMCPY_WRAPPED(dst, src, size) memcpy((dst), (src), (size))
|
||||||
|
#define MEMSET_WRAPPED(dst, val, size) memset((dst), (val), (size))
|
||||||
|
|
||||||
|
#endif /* FB_ACCESS_WRAPPER */
|
||||||
|
|
||||||
|
#define FbStipStrideToBitsStride(s) (((s) >> (FB_SHIFT - FB_STIP_SHIFT)))
|
||||||
|
|
||||||
#define InitializeShifts(sx,dx,ls,rs) { \
|
#define InitializeShifts(sx,dx,ls,rs) { \
|
||||||
if (sx != dx) { \
|
if (sx != dx) { \
|
||||||
if (sx > dx) { \
|
if (sx > dx) { \
|
||||||
|
|
|
@ -32,9 +32,9 @@
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
|
|
||||||
#include "dix/colormap_priv.h"
|
#include "dix/colormap_priv.h"
|
||||||
|
#include "fb/fb_priv.h"
|
||||||
#include "mi/mi_priv.h"
|
#include "mi/mi_priv.h"
|
||||||
|
|
||||||
#include "fb.h"
|
|
||||||
#include "micmap.h"
|
#include "micmap.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "fb.h"
|
#include "fb/fb_priv.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
fbCopyNtoN(DrawablePtr pSrcDrawable,
|
fbCopyNtoN(DrawablePtr pSrcDrawable,
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
|
||||||
#include "fb.h"
|
#include "fb/fb_priv.h"
|
||||||
|
|
||||||
static void
|
static void
|
||||||
fbStipple(FbBits * dst, FbStride dstStride,
|
fbStipple(FbBits * dst, FbStride dstStride,
|
||||||
|
|
10
fb/fbgc.c
10
fb/fbgc.c
|
@ -24,9 +24,9 @@
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "fb.h"
|
#include "fb/fb_priv.h"
|
||||||
|
|
||||||
const GCFuncs fbGCFuncs = {
|
static const GCFuncs fbGCFuncs = {
|
||||||
fbValidateGC,
|
fbValidateGC,
|
||||||
miChangeGC,
|
miChangeGC,
|
||||||
miCopyGC,
|
miCopyGC,
|
||||||
|
@ -36,7 +36,7 @@ const GCFuncs fbGCFuncs = {
|
||||||
miCopyClip,
|
miCopyClip,
|
||||||
};
|
};
|
||||||
|
|
||||||
const GCOps fbGCOps = {
|
static const GCOps fbGCOps = {
|
||||||
fbFillSpans,
|
fbFillSpans,
|
||||||
fbSetSpans,
|
fbSetSpans,
|
||||||
fbPutImage,
|
fbPutImage,
|
||||||
|
@ -45,11 +45,11 @@ const GCOps fbGCOps = {
|
||||||
fbPolyPoint,
|
fbPolyPoint,
|
||||||
fbPolyLine,
|
fbPolyLine,
|
||||||
fbPolySegment,
|
fbPolySegment,
|
||||||
fbPolyRectangle,
|
miPolyRectangle,
|
||||||
fbPolyArc,
|
fbPolyArc,
|
||||||
miFillPolygon,
|
miFillPolygon,
|
||||||
fbPolyFillRect,
|
fbPolyFillRect,
|
||||||
fbPolyFillArc,
|
miPolyFillArc,
|
||||||
miPolyText8,
|
miPolyText8,
|
||||||
miPolyText16,
|
miPolyText16,
|
||||||
miImageText8,
|
miImageText8,
|
||||||
|
|
|
@ -23,9 +23,10 @@
|
||||||
|
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
|
||||||
#include "fb.h"
|
|
||||||
#include <X11/fonts/fontstruct.h>
|
#include <X11/fonts/fontstruct.h>
|
||||||
#include "dixfontstr.h"
|
|
||||||
|
#include "fb/fb_priv.h"
|
||||||
|
#include "include/dixfontstr.h"
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
fbGlyphIn(RegionPtr pRegion, int x, int y, int width, int height)
|
fbGlyphIn(RegionPtr pRegion, int x, int y, int width, int height)
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "fb.h"
|
#include "fb/fb_priv.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
fbPutImage(DrawablePtr pDrawable,
|
fbPutImage(DrawablePtr pDrawable,
|
||||||
|
|
|
@ -24,7 +24,13 @@
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "fb.h"
|
#include "fb/fb_priv.h"
|
||||||
|
|
||||||
|
#ifdef FB_DEBUG
|
||||||
|
static void fbInitializeDrawable(DrawablePtr pDrawable);
|
||||||
|
#else
|
||||||
|
static inline void fbInitializeDrawable(DrawablePtr pDrawable) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
PixmapPtr
|
PixmapPtr
|
||||||
fbCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
|
fbCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
|
||||||
#include "fb.h"
|
#include "fb/fb_priv.h"
|
||||||
|
|
||||||
typedef void (*FbDots) (FbBits * dst,
|
typedef void (*FbDots) (FbBits * dst,
|
||||||
FbStride dstStride,
|
FbStride dstStride,
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
|
||||||
#include "fb.h"
|
#include "fb/fb_priv.h"
|
||||||
|
|
||||||
static void
|
static void
|
||||||
fbPushPattern(DrawablePtr pDrawable,
|
fbPushPattern(DrawablePtr pDrawable,
|
||||||
|
|
|
@ -22,9 +22,10 @@
|
||||||
|
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
|
||||||
|
#include "fb/fb_priv.h"
|
||||||
#include "os/osdep.h"
|
#include "os/osdep.h"
|
||||||
|
|
||||||
#include "fb.h"
|
#undef CreateWindow
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
fbCloseScreen(ScreenPtr pScreen)
|
fbCloseScreen(ScreenPtr pScreen)
|
||||||
|
|
|
@ -24,7 +24,9 @@
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "fb.h"
|
#include "fb/fb_priv.h"
|
||||||
|
#include "fb/fbbits.h"
|
||||||
|
|
||||||
#include "miline.h"
|
#include "miline.h"
|
||||||
|
|
||||||
#define fbBresShiftMask(mask,dir,bpp) ((bpp == FB_STIP_UNIT) ? 0 : \
|
#define fbBresShiftMask(mask,dir,bpp) ((bpp == FB_STIP_UNIT) ? 0 : \
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
|
||||||
#include "fb.h"
|
#include "fb/fb_priv.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
fbSetSpans(DrawablePtr pDrawable,
|
fbSetSpans(DrawablePtr pDrawable,
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "fb.h"
|
#include "fb/fb_priv.h"
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
fbCreateWindow(WindowPtr pWin)
|
fbCreateWindow(WindowPtr pWin)
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include <xcb/xcb_keysyms.h>
|
#include <xcb/xcb_keysyms.h>
|
||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
|
|
||||||
|
#include "fb/fb_priv.h"
|
||||||
#include "mi/mipointer_priv.h"
|
#include "mi/mipointer_priv.h"
|
||||||
#include "os/client_priv.h"
|
#include "os/client_priv.h"
|
||||||
#include "os/osdep.h"
|
#include "os/osdep.h"
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
|
|
||||||
|
#include "fb/fb_priv.h"
|
||||||
#include "mi/mi_priv.h"
|
#include "mi/mi_priv.h"
|
||||||
#include "dix_priv.h"
|
#include "dix_priv.h"
|
||||||
|
|
||||||
|
@ -47,7 +48,6 @@
|
||||||
extern int darwinMainScreenX, darwinMainScreenY;
|
extern int darwinMainScreenX, darwinMainScreenY;
|
||||||
extern Bool no_configure_window;
|
extern Bool no_configure_window;
|
||||||
#endif
|
#endif
|
||||||
#include "fb.h"
|
|
||||||
|
|
||||||
#include "rootlessCommon.h"
|
#include "rootlessCommon.h"
|
||||||
#include "rootlessWindow.h"
|
#include "rootlessWindow.h"
|
||||||
|
|
Loading…
Reference in New Issue