XQuartz: Let miSetVisualTypes set the mask, since we are using the default anyways.
This commit is contained in:
parent
df2fbc410f
commit
c850b6109c
@ -208,26 +208,17 @@ static Bool DarwinScreenInit(int index, ScreenPtr pScreen, int argc, char **argv
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
// setup a single visual appropriate for our pixel type
|
// setup a single visual appropriate for our pixel type
|
||||||
if(!miSetVisualTypesAndMasks(dfb->depth, dfb->visuals, dfb->bitsPerRGB,
|
if(!miSetVisualTypes(dfb->depth, dfb->visuals, dfb->bitsPerRGB, dfb->preferredCVC)) {
|
||||||
dfb->preferredCVC, dfb->redMask,
|
|
||||||
dfb->greenMask, dfb->blueMask)) {
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Make PseudoColor visuals not suck in TrueColor mode
|
// TODO: Make PseudoColor visuals not suck in TrueColor mode
|
||||||
// if(dfb->depth > 8)
|
// if(dfb->depth > 8)
|
||||||
// miSetVisualTypesAndMasks(8, PseudoColorMask, 8, PseudoColor, 0, 0, 0);
|
// miSetVisualTypes(8, PseudoColorMask, 8, PseudoColor);
|
||||||
|
|
||||||
#if 0
|
|
||||||
/*
|
|
||||||
* These aren't used anymore. xpr/xprScreen.c initializes the dfb struct
|
|
||||||
* above based on the display properties.
|
|
||||||
*/
|
|
||||||
if(dfb->depth > 15)
|
if(dfb->depth > 15)
|
||||||
miSetVisualTypesAndMasks(15, LARGE_VISUALS, 5, TrueColor, 0x7c00, 0x03e0, 0x001f);
|
miSetVisualTypes(15, TrueColorMask, 5, TrueColor);
|
||||||
if(dfb->depth > 24)
|
if(dfb->depth > 24)
|
||||||
miSetVisualTypesAndMasks(24, LARGE_VISUALS, 8, TrueColor, 0x00ff0000, 0x0000ff00, 0x000000ff);
|
miSetVisualTypes(24, TrueColorMask, 8, TrueColor);
|
||||||
#endif
|
|
||||||
|
|
||||||
miSetPixmapDepths();
|
miSetPixmapDepths();
|
||||||
|
|
||||||
@ -249,29 +240,6 @@ static Bool DarwinScreenInit(int index, ScreenPtr pScreen, int argc, char **argv
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ErrorF("Screen type: %d, %d=%d, %d=%d, %d=%d, %x=%x=%x, %x=%x=%x, %x=%x=%x\n", pScreen->visuals->class,
|
|
||||||
// pScreen->visuals->offsetRed, dfb->bitsPerRGB * 2,
|
|
||||||
// pScreen->visuals->offsetGreen, dfb->bitsPerRGB,
|
|
||||||
// pScreen->visuals->offsetBlue, 0,
|
|
||||||
// pScreen->visuals->redMask, dfb->redMask, ((1<<dfb->bitsPerRGB)-1) << pScreen->visuals->offsetRed,
|
|
||||||
// pScreen->visuals->greenMask, dfb->greenMask, ((1<<dfb->bitsPerRGB)-1) << pScreen->visuals->offsetGreen,
|
|
||||||
// pScreen->visuals->blueMask, dfb->blueMask, ((1<<dfb->bitsPerRGB)-1) << pScreen->visuals->offsetBlue);
|
|
||||||
|
|
||||||
// set the RGB order correctly for TrueColor
|
|
||||||
// if (dfb->bitsPerPixel > 8) {
|
|
||||||
// for (i = 0, visual = pScreen->visuals; // someday we may have more than 1
|
|
||||||
// i < pScreen->numVisuals; i++, visual++) {
|
|
||||||
// if (visual->class == TrueColor) {
|
|
||||||
// visual->offsetRed = bitsPerRGB * 2;
|
|
||||||
// visual->offsetGreen = bitsPerRGB;
|
|
||||||
// visual->offsetBlue = 0;
|
|
||||||
// visual->redMask = ((1<<bitsPerRGB)-1) << visual->offsetRed;
|
|
||||||
// visual->greenMask = ((1<<bitsPerRGB)-1) << visual->offsetGreen;
|
|
||||||
// visual->blueMask = ((1<<bitsPerRGB)-1) << visual->offsetBlue;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
#ifdef RENDER
|
#ifdef RENDER
|
||||||
if (! fbPictureInit(pScreen, 0, 0)) {
|
if (! fbPictureInit(pScreen, 0, 0)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -48,9 +48,6 @@ typedef struct {
|
|||||||
int bitsPerRGB;
|
int bitsPerRGB;
|
||||||
int bitsPerPixel;
|
int bitsPerPixel;
|
||||||
int preferredCVC;
|
int preferredCVC;
|
||||||
Pixel redMask;
|
|
||||||
Pixel greenMask;
|
|
||||||
Pixel blueMask;
|
|
||||||
} DarwinFramebufferRec, *DarwinFramebufferPtr;
|
} DarwinFramebufferRec, *DarwinFramebufferPtr;
|
||||||
|
|
||||||
// From darwin.c
|
// From darwin.c
|
||||||
|
@ -277,31 +277,15 @@ xprAddScreen(int index, ScreenPtr pScreen)
|
|||||||
|
|
||||||
if(depth == -1) {
|
if(depth == -1) {
|
||||||
depth = CGDisplaySamplesPerPixel(kCGDirectMainDisplay) * CGDisplayBitsPerSample(kCGDirectMainDisplay);
|
depth = CGDisplaySamplesPerPixel(kCGDirectMainDisplay) * CGDisplayBitsPerSample(kCGDirectMainDisplay);
|
||||||
//dfb->depth = CGDisplaySamplesPerPixel(kCGDirectMainDisplay) * CGDisplayBitsPerSample(kCGDirectMainDisplay);
|
|
||||||
//dfb->bitsPerRGB = CGDisplayBitsPerSample(kCGDirectMainDisplay);
|
|
||||||
//dfb->bitsPerPixel = CGDisplayBitsPerPixel(kCGDirectMainDisplay);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(depth) {
|
switch(depth) {
|
||||||
// case -8: // broken
|
|
||||||
// dfb->visuals = (1 << StaticGray) | (1 << GrayScale);
|
|
||||||
// dfb->preferredCVC = GrayScale;
|
|
||||||
// dfb->depth = 8;
|
|
||||||
// dfb->bitsPerRGB = 8;
|
|
||||||
// dfb->bitsPerPixel = 8;
|
|
||||||
// dfb->redMask = 0;
|
|
||||||
// dfb->greenMask = 0;
|
|
||||||
// dfb->blueMask = 0;
|
|
||||||
// break;
|
|
||||||
case 8: // pseudo-working
|
case 8: // pseudo-working
|
||||||
dfb->visuals = PseudoColorMask;
|
dfb->visuals = PseudoColorMask;
|
||||||
dfb->preferredCVC = PseudoColor;
|
dfb->preferredCVC = PseudoColor;
|
||||||
dfb->depth = 8;
|
dfb->depth = 8;
|
||||||
dfb->bitsPerRGB = 8;
|
dfb->bitsPerRGB = 8;
|
||||||
dfb->bitsPerPixel = 8;
|
dfb->bitsPerPixel = 8;
|
||||||
dfb->redMask = 0;
|
|
||||||
dfb->greenMask = 0;
|
|
||||||
dfb->blueMask = 0;
|
|
||||||
break;
|
break;
|
||||||
case 15:
|
case 15:
|
||||||
dfb->visuals = TrueColorMask; //LARGE_VISUALS;
|
dfb->visuals = TrueColorMask; //LARGE_VISUALS;
|
||||||
@ -309,9 +293,6 @@ xprAddScreen(int index, ScreenPtr pScreen)
|
|||||||
dfb->depth = 15;
|
dfb->depth = 15;
|
||||||
dfb->bitsPerRGB = 5;
|
dfb->bitsPerRGB = 5;
|
||||||
dfb->bitsPerPixel = 16;
|
dfb->bitsPerPixel = 16;
|
||||||
dfb->redMask = 0x7c00;
|
|
||||||
dfb->greenMask = 0x03e0;
|
|
||||||
dfb->blueMask = 0x001f;
|
|
||||||
break;
|
break;
|
||||||
// case 24:
|
// case 24:
|
||||||
default:
|
default:
|
||||||
@ -322,9 +303,6 @@ xprAddScreen(int index, ScreenPtr pScreen)
|
|||||||
dfb->depth = 24;
|
dfb->depth = 24;
|
||||||
dfb->bitsPerRGB = 8;
|
dfb->bitsPerRGB = 8;
|
||||||
dfb->bitsPerPixel = 32;
|
dfb->bitsPerPixel = 32;
|
||||||
dfb->redMask = 0x00ff0000;
|
|
||||||
dfb->greenMask = 0x0000ff00;
|
|
||||||
dfb->blueMask = 0x000000ff;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user