summaryrefslogtreecommitdiff
path: root/mfb
diff options
context:
space:
mode:
Diffstat (limited to 'mfb')
-rw-r--r--mfb/maskbits.c6
-rw-r--r--mfb/maskbits.h35
-rw-r--r--mfb/mfb.h6
-rw-r--r--mfb/mfbscrinit.c13
4 files changed, 46 insertions, 14 deletions
diff --git a/mfb/maskbits.c b/mfb/maskbits.c
index 09f593ec2..4cd2d493b 100644
--- a/mfb/maskbits.c
+++ b/mfb/maskbits.c
@@ -1003,6 +1003,12 @@ PixelType rmask[] =
#undef _1_
+PixelType mfbGetmask(int i) { return mask[i]; }
+PixelType mfbGetrmask(int i) { return rmask[i]; }
+PixelType mfbGetstarttab(int i) { return starttab[i]; }
+PixelType mfbGetendtab(int i) { return endtab[i]; }
+PixelType mfbGetpartmasks(int i, int j) { return partmasks[i][j]; }
+
/*
* Merge raster ops for full src + dest + plane mask
*
diff --git a/mfb/maskbits.h b/mfb/maskbits.h
index 4cd30be39..5ca79c929 100644
--- a/mfb/maskbits.h
+++ b/mfb/maskbits.h
@@ -224,11 +224,18 @@ getshiftedleftbits(psrc, offset, w, dst)
#define MFB_PWSH 5
#endif /* MFB_PPW == 32 */
+/* XXX don't use these five */
extern PixelType starttab[];
extern PixelType endtab[];
extern PixelType partmasks[MFB_PPW][MFB_PPW];
extern PixelType rmask[];
extern PixelType mask[];
+/* XXX use these five */
+extern PixelType mfbGetstarttab(int);
+extern PixelType mfbGetendtab(int);
+extern PixelType mfbGetpartmasks(int, int);
+extern PixelType mfbGetrmask(int);
+extern PixelType mfbGetmask(int);
#ifndef MFB_CONSTS_ONLY
@@ -304,19 +311,19 @@ extern PixelType mask[];
}
#define maskbits(x, w, startmask, endmask, nlw) \
- startmask = starttab[(x) & PIM]; \
- endmask = endtab[((x)+(w)) & PIM]; \
+ startmask = mfbGetstarttab((x) & PIM); \
+ endmask = mfbGetendtab(((x)+(w)) & PIM); \
if (startmask) \
nlw = (((w) - (PPW - ((x) & PIM))) >> PWSH); \
else \
nlw = (w) >> PWSH;
#define maskpartialbits(x, w, mask) \
- mask = partmasks[(x) & PIM][(w) & PIM];
+ mask = mfbGetpartmasks((x) & PIM, (w) & PIM);
#define maskPPWbits(x, w, startmask, endmask) \
- startmask = starttab[(x) & PIM]; \
- endmask = endtab[((x)+(w)) & PIM];
+ startmask = mfbGetstarttab((x) & PIM); \
+ endmask = mfbGetendtab(((x)+(w)) & PIM);
#ifdef __GNUC__ /* XXX don't want for Alpha? */
#ifdef vax
@@ -390,8 +397,8 @@ extern PixelType mask[];
{ \
register int d = PPW-(x); \
*(pdst) = (*(pdst) & endtab[x]) | (SCRRIGHT((src), x)); \
- (pdst)[1] = ((pdst)[1] & starttab[n]) | \
- (SCRLEFT(src, d) & endtab[n]); \
+ (pdst)[1] = ((pdst)[1] & mfbGetstarttab(n)) | \
+ (SCRLEFT(src, d) & mfbGetendtab(n)); \
} \
}
@@ -440,10 +447,10 @@ extern PixelType mask[];
else \
{ \
int m = PPW-(x); \
- *(pdst) = (*(pdst) & endtab[x]) | (t2 & starttab[x]); \
+ *(pdst) = (*(pdst) & mfbGetendtab(x)) | (t2 & mfbGetstarttab(x)); \
t1 = SCRLEFT((src), m); \
DoRop(t2, rop, t1, (pdst)[1]); \
- (pdst)[1] = ((pdst)[1] & starttab[n]) | (t2 & endtab[n]); \
+ (pdst)[1] = ((pdst)[1] & mfbGetstarttab(n)) | (t2 & mfbGetendtab(n)); \
} \
}
@@ -514,10 +521,10 @@ extern PixelType mask[];
else \
{ \
int m = PPW-(x); \
- *(pdst) = (*(pdst) & endtab[x]) | (t2 & starttab[x]); \
+ *(pdst) = (*(pdst) & mfbGetendtab(x)) | (t2 & mfbGetstarttab(x)); \
t1 = SCRLEFT((src), m); \
t2 = DoRRop(rop, t1, (pdst)[1]); \
- (pdst)[1] = ((pdst)[1] & starttab[n]) | (t2 & endtab[n]); \
+ (pdst)[1] = ((pdst)[1] & mfbGetstarttab(n)) | (t2 & mfbGetendtab(n)); \
} \
}
#endif
@@ -645,7 +652,7 @@ extern PixelType mask[];
if ((width) > _flag) \
_src |= SCRRIGHT (*((psrc) + 1), _flag); \
\
- *(pdst) = (*(pdst) & starttab[(width)]) | (_src & endtab[(width)]); \
+ *(pdst) = (*(pdst) & mfbGetstarttab((width))) | (_src & mfbGetendtab((width))); \
}
@@ -659,7 +666,7 @@ extern PixelType mask[];
_src |= SCRRIGHT (*((psrc) + 1), _flag); \
DoRop(_src, rop, _src, *(pdst)); \
\
- *(pdst) = (*(pdst) & starttab[(width)]) | (_src & endtab[(width)]); \
+ *(pdst) = (*(pdst) & mfbGetstarttab((width))) | (_src & mfbGetendtab((width))); \
}
#define getandputrrop0(psrc, sbindex, width, pdst, rop) \
@@ -672,7 +679,7 @@ extern PixelType mask[];
_src |= SCRRIGHT (*((psrc) + 1), _flag); \
_src = DoRRop(rop, _src, *(pdst)); \
\
- *(pdst) = (*(pdst) & starttab[(width)]) | (_src & endtab[(width)]); \
+ *(pdst) = (*(pdst) & mfbGetstarttab((width))) | (_src & mfbGetendtab((width))); \
}
#endif /* FASTGETBITS && FASTPUTBITS */
diff --git a/mfb/mfb.h b/mfb/mfb.h
index 267ebc4ea..d0105c93c 100644
--- a/mfb/mfb.h
+++ b/mfb/mfb.h
@@ -713,6 +713,8 @@ extern void mfbSetWindowPixmap(
PixmapPtr /*pPix*/
);
+extern void mfbFillInScreen(ScreenPtr pScreen);
+
/* mfbseg.c */
extern void mfbSegmentSS(
@@ -874,10 +876,14 @@ typedef struct {
typedef mfbPrivGC *mfbPrivGCPtr;
#endif
+/* XXX these should be static, but it breaks the ABI */
extern int mfbGCPrivateIndex; /* index into GC private array */
+extern int mfbGetGCPrivateIndex(void);
extern int mfbWindowPrivateIndex; /* index into Window private array */
+extern int mfbGetWindowPrivateIndex(void);
#ifdef PIXMAP_PER_WINDOW
extern int frameWindowPrivateIndex; /* index into Window private array */
+extern int frameGetWindowPrivateIndex(void);
#endif
#ifndef MFB_PROTOTYPES_ONLY
diff --git a/mfb/mfbscrinit.c b/mfb/mfbscrinit.c
index c85d4e36b..7e840303c 100644
--- a/mfb/mfbscrinit.c
+++ b/mfb/mfbscrinit.c
@@ -65,9 +65,12 @@ SOFTWARE.
#ifdef PIXMAP_PER_WINDOW
int frameWindowPrivateIndex;
+int frameGetWindowPrivateIndex(void) { return frameWindowPrivateIndex; }
#endif
int mfbWindowPrivateIndex;
+int mfbGetWindowPrivateIndex(void) { return mfbWindowPrivateIndex; }
int mfbGCPrivateIndex;
+int mfbGetGCPrivateIndex(void) { return mfbGCPrivateIndex; }
static unsigned long mfbGeneration = 0;
static VisualRec visual = {
@@ -195,3 +198,13 @@ mfbSetWindowPixmap(pWin, pPix)
#endif
}
+void mfbFillInScreen(ScreenPtr pScreen)
+{
+ pScreen->ChangeWindowAttributes = mfbChangeWindowAttributes;
+ pScreen->RealizeWindow = mfbMapWindow;
+ pScreen->UnrealizeWindow = mfbUnmapWindow;
+ pScreen->DestroyPixmap = mfbDestroyPixmap;
+ pScreen->RealizeFont = mfbRealizeFont;
+ pScreen->UnrealizeFont = mfbUnrealizeFont;
+ pScreen->BitmapToRegion = mfbPixmapToRegion;
+}