mirror of
https://github.com/X11Libre/xserver.git
synced 2026-09-15 19:22:22 +00:00
Empty damage object when freeing pixmap.
Wrap InstallColormap so that the DDX doesn't see colormaps from our ARGB
visual (avoids lovely green tint to screen). Also, set visual->nplanes
of ARGB visual to all used (including alpha) planes so DIX can set
pixel values correctly.
Translate automatic update regions correctly to account for borders
When nplanes == 32 (ARGB visuals), mask in all ones for alpha values to
allocated pixel values.
Remove redundant fbAddTraps declaration
Fix fbCopyWindow to work on non-screen pixmaps (not needed yet)
Replace broken clipping code with that from modular tree.
Respect subWindowMode.
This commit is contained in:
parent
24bed5cff9
commit
a29bfbd3d0
9 changed files with 180 additions and 72 deletions
|
|
@ -40,6 +40,7 @@ compCloseScreen (int index, ScreenPtr pScreen)
|
|||
|
||||
pScreen->CloseScreen = cs->CloseScreen;
|
||||
pScreen->BlockHandler = cs->BlockHandler;
|
||||
pScreen->InstallColormap = cs->InstallColormap;
|
||||
pScreen->ReparentWindow = cs->ReparentWindow;
|
||||
pScreen->MoveWindow = cs->MoveWindow;
|
||||
pScreen->ResizeWindow = cs->ResizeWindow;
|
||||
|
|
@ -59,6 +60,23 @@ compCloseScreen (int index, ScreenPtr pScreen)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
compInstallColormap (ColormapPtr pColormap)
|
||||
{
|
||||
VisualPtr pVisual = pColormap->pVisual;
|
||||
ScreenPtr pScreen = pColormap->pScreen;
|
||||
CompScreenPtr cs = GetCompScreen (pScreen);
|
||||
int a;
|
||||
|
||||
for (a = 0; a < NUM_COMP_ALTERNATE_VISUALS; a++)
|
||||
if (pVisual->vid == cs->alternateVisuals[a])
|
||||
return;
|
||||
pScreen->InstallColormap = cs->InstallColormap;
|
||||
(*pScreen->InstallColormap) (pColormap);
|
||||
cs->InstallColormap = pScreen->InstallColormap;
|
||||
pScreen->InstallColormap = compInstallColormap;
|
||||
}
|
||||
|
||||
static void
|
||||
compScreenUpdate (ScreenPtr pScreen)
|
||||
{
|
||||
|
|
@ -126,7 +144,9 @@ typedef struct _alternateVisual {
|
|||
} CompAlternateVisual;
|
||||
|
||||
static CompAlternateVisual altVisuals[NUM_COMP_ALTERNATE_VISUALS] = {
|
||||
#if COMP_INCLUDE_RGB24_VISUAL
|
||||
{ 24, PICT_r8g8b8 },
|
||||
#endif
|
||||
{ 32, PICT_a8r8g8b8 },
|
||||
};
|
||||
|
||||
|
|
@ -163,10 +183,6 @@ compAddAlternateVisuals (ScreenPtr pScreen, CompScreenPtr cs)
|
|||
if (!pPictFormat)
|
||||
continue;
|
||||
|
||||
/*
|
||||
* Ok, create a visual id for this format
|
||||
*/
|
||||
cs->alternateVisuals[numAlternate] = FakeClientID (0);
|
||||
/*
|
||||
* Allocate vid list for this depth
|
||||
*/
|
||||
|
|
@ -235,6 +251,7 @@ compAddAlternateVisuals (ScreenPtr pScreen, CompScreenPtr cs)
|
|||
DepthPtr depth = depths[alt];
|
||||
PictFormatPtr pPictFormat = pPictFormats[alt];
|
||||
VisualPtr visual = &visuals[numVisuals + alt];
|
||||
unsigned long alphaMask;
|
||||
|
||||
/*
|
||||
* Initialize the visual
|
||||
|
|
@ -249,16 +266,19 @@ compAddAlternateVisuals (ScreenPtr pScreen, CompScreenPtr cs)
|
|||
pPictFormat->direct.green);
|
||||
visual->blueMask = (((unsigned long) pPictFormat->direct.blueMask) <<
|
||||
pPictFormat->direct.blue);
|
||||
alphaMask = (((unsigned long) pPictFormat->direct.alphaMask) <<
|
||||
pPictFormat->direct.alpha);
|
||||
visual->offsetRed = pPictFormat->direct.red;
|
||||
visual->offsetGreen = pPictFormat->direct.green;
|
||||
visual->offsetBlue = pPictFormat->direct.blue;
|
||||
/*
|
||||
* follow GLX and set nplanes to just the bits
|
||||
* used for the RGB value, not A
|
||||
* Include A bits in this (unlike GLX which includes only RGB)
|
||||
* This lets DIX compute suitable masks for colormap allocations
|
||||
*/
|
||||
visual->nplanes = Ones (visual->redMask |
|
||||
visual->greenMask |
|
||||
visual->blueMask);
|
||||
visual->blueMask |
|
||||
alphaMask);
|
||||
/*
|
||||
* find widest component
|
||||
*/
|
||||
|
|
@ -355,6 +375,9 @@ compScreenInit (ScreenPtr pScreen)
|
|||
cs->ReparentWindow = pScreen->ReparentWindow;
|
||||
pScreen->ReparentWindow = compReparentWindow;
|
||||
|
||||
cs->InstallColormap = pScreen->InstallColormap;
|
||||
pScreen->InstallColormap = compInstallColormap;
|
||||
|
||||
cs->BlockHandler = pScreen->BlockHandler;
|
||||
pScreen->BlockHandler = compBlockHandler;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue