summaryrefslogtreecommitdiff
path: root/hw/vfb
diff options
context:
space:
mode:
authorAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2004-09-15 16:34:16 +0000
committerAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2004-09-15 16:34:16 +0000
commit696b137d5855cdcd0e6b95e16ce2dad00510a41d (patch)
tree93d38eaf0eb8fd4bb2d9725dc242c5434ceabfa8 /hw/vfb
parent2c971497fc9fc09d342cdb13a985fdde81f82351 (diff)
Pull XORG-6_8_0 to CYGWIN branchCYGWIN-6_8_0-MERGE
Diffstat (limited to 'hw/vfb')
-rw-r--r--hw/vfb/InitOutput.c131
-rw-r--r--hw/vfb/Xvfb.man.pre2
2 files changed, 46 insertions, 87 deletions
diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c
index b0418508c..0fbf014d6 100644
--- a/hw/vfb/InitOutput.c
+++ b/hw/vfb/InitOutput.c
@@ -45,6 +45,7 @@ from The Open Group.
#include "gcstruct.h"
#include "input.h"
#include "mipointer.h"
+#include "micmap.h"
#include <sys/types.h>
#ifdef HAS_MMAP
#include <sys/mman.h>
@@ -64,13 +65,12 @@ from The Open Group.
#endif /* HAS_SHM */
#include "dix.h"
#include "miline.h"
-#include "mfb.h"
#define VFB_DEFAULT_WIDTH 1280
#define VFB_DEFAULT_HEIGHT 1024
#define VFB_DEFAULT_DEPTH 8
-#define VFB_DEFAULT_WHITEPIXEL 0
-#define VFB_DEFAULT_BLACKPIXEL 1
+#define VFB_DEFAULT_WHITEPIXEL 1
+#define VFB_DEFAULT_BLACKPIXEL 0
#define VFB_DEFAULT_LINEBIAS 0
#define XWD_WINDOW_NAME_LEN 60
@@ -278,6 +278,11 @@ ddxUseMsg()
#endif
}
+/* ddxInitGlobals - called by |InitGlobals| from os/util.c */
+void ddxInitGlobals(void)
+{
+}
+
int
ddxProcessArgument(int argc, char *argv[], int i)
{
@@ -437,60 +442,6 @@ GetTimeInMillis()
}
#endif
-
-static Bool
-vfbMultiDepthCreateGC(GCPtr pGC)
-{
- switch (vfbBitsPerPixel(pGC->depth))
- {
- case 1: return mfbCreateGC (pGC);
- case 8:
- case 16:
- case 32: return fbCreateGC (pGC);
- default: return FALSE;
- }
-}
-
-static void
-vfbMultiDepthGetSpans(
- DrawablePtr pDrawable, /* drawable from which to get bits */
- int wMax, /* largest value of all *pwidths */
- register DDXPointPtr ppt, /* points to start copying from */
- int *pwidth, /* list of number of bits to copy */
- int nspans, /* number of scanlines to copy */
- char *pdstStart) /* where to put the bits */
-{
- switch (pDrawable->bitsPerPixel) {
- case 1:
- mfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
- break;
- case 8:
- case 16:
- case 32:
- fbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
- break;
- }
- return;
-}
-
-static void
-vfbMultiDepthGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
- unsigned int format, unsigned long planeMask,
- char *pdstLine)
-{
- switch (pDrawable->bitsPerPixel)
- {
- case 1:
- mfbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
- break;
- case 8:
- case 16:
- case 32:
- fbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
- break;
- }
-}
-
static ColormapPtr InstalledMaps[MAXSCREENS];
static int
@@ -917,39 +868,54 @@ vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
pbits = vfbAllocateFramebufferMemory(pvfb);
if (!pbits) return FALSE;
- /* miSetPixmapDepths ();*/
+ miSetPixmapDepths ();
- switch (pvfb->bitsPerPixel)
- {
- case 1:
- ret = mfbScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
- dpix, dpiy, pvfb->paddedWidth);
- break;
+ switch (pvfb->depth) {
case 8:
+ miSetVisualTypesAndMasks (8,
+ ((1 << StaticGray) |
+ (1 << GrayScale) |
+ (1 << StaticColor) |
+ (1 << PseudoColor) |
+ (1 << TrueColor) |
+ (1 << DirectColor)),
+ 8, PseudoColor, 0x07, 0x38, 0xc0);
+ break;
+ case 15:
+ miSetVisualTypesAndMasks (15,
+ ((1 << TrueColor) |
+ (1 << DirectColor)),
+ 8, TrueColor, 0x7c00, 0x03e0, 0x001f);
+ break;
case 16:
- case 32:
- ret = fbScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
- dpix, dpiy, pvfb->paddedWidth,pvfb->bitsPerPixel);
-#ifdef RENDER
- if (ret && Render)
- fbPictureInit (pScreen, 0, 0);
-#endif
+ miSetVisualTypesAndMasks (16,
+ ((1 << TrueColor) |
+ (1 << DirectColor)),
+ 8, TrueColor, 0xf800, 0x07e0, 0x001f);
+ break;
+ case 24:
+ miSetVisualTypesAndMasks (24,
+ ((1 << TrueColor) |
+ (1 << DirectColor)),
+ 8, TrueColor, 0xff0000, 0x00ff00, 0x0000ff);
break;
- default:
- return FALSE;
}
+
+ ret = fbScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
+ dpix, dpiy, pvfb->paddedWidth,pvfb->bitsPerPixel);
+#ifdef RENDER
+ if (ret && Render)
+ fbPictureInit (pScreen, 0, 0);
+#endif
if (!ret) return FALSE;
- miInitializeBackingStore(pScreen);
+ /* miInitializeBackingStore(pScreen); */
/*
* Circumvent the backing store that was just initialised. This amounts
* to a truely bizarre way of initialising SaveDoomedAreas and friends.
*/
- pScreen->CreateGC = vfbMultiDepthCreateGC;
- pScreen->GetImage = vfbMultiDepthGetImage;
- pScreen->GetSpans = vfbMultiDepthGetSpans;
pScreen->InstallColormap = vfbInstallColormap;
pScreen->UninstallColormap = vfbUninstallColormap;
@@ -965,14 +931,7 @@ vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
pScreen->blackPixel = pvfb->blackPixel;
pScreen->whitePixel = pvfb->whitePixel;
- if (pvfb->bitsPerPixel == 1)
- {
- ret = mfbCreateDefColormap(pScreen);
- }
- else
- {
- ret = fbCreateDefColormap(pScreen);
- }
+ ret = fbCreateDefColormap(pScreen);
miSetZeroLineBias(pScreen, pvfb->lineBias);
@@ -1003,7 +962,7 @@ InitOutput(ScreenInfo *screenInfo, int argc, char **argv)
vfbPixmapDepths[1] = TRUE;
vfbPixmapDepths[4] = TRUE;
vfbPixmapDepths[8] = TRUE;
- vfbPixmapDepths[15] = TRUE;
+/* vfbPixmapDepths[15] = TRUE; */
vfbPixmapDepths[16] = TRUE;
vfbPixmapDepths[24] = TRUE;
vfbPixmapDepths[32] = TRUE;
diff --git a/hw/vfb/Xvfb.man.pre b/hw/vfb/Xvfb.man.pre
index dd03a3a4b..95efc4f61 100644
--- a/hw/vfb/Xvfb.man.pre
+++ b/hw/vfb/Xvfb.man.pre
@@ -1,4 +1,4 @@
-.\" $XdotOrg: xc/programs/Xserver/hw/vfb/Xvfb.man,v 1.1.4.2.4.1 2004/03/04 17:47:33 eich Exp $
+.\" $XdotOrg: xc/programs/Xserver/hw/vfb/Xvfb.man,v 1.2 2004/04/23 19:19:32 eich Exp $
.\" $Xorg: Xvfb.man,v 1.4 2001/02/09 02:04:45 xorgcvs Exp $
.\" Copyright 1993, 1998 The Open Group
.\"