mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-21 20:20:07 +01:00
XQuartz: Fix alpha to be 1 (screenshots bug, etc)
This is related to: bc964ff1e3
XQuartz: Stab at fixing the alpha 0/1 bug (screenshots, etc) by pulling in some old code that got gutted from rootless.
which was on the 1.4 branch and implemented in fbPaintWindow. Now that fbPaintWindow is gone, this is now in miPaintWindow().
This commit is contained in:
parent
4975c08725
commit
032173f693
2 changed files with 23 additions and 6 deletions
|
|
@ -1676,7 +1676,7 @@ if test "x$XQUARTZ" = xyes; then
|
||||||
|
|
||||||
AC_CHECK_LIB([Xplugin],[xp_init],[:])
|
AC_CHECK_LIB([Xplugin],[xp_init],[:])
|
||||||
|
|
||||||
CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DNO_ALLOCA"
|
CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DROOTLESS_SAFEALPHA -DNO_ALLOCA"
|
||||||
|
|
||||||
PKG_CHECK_MODULES(XPBPROXY, [applewmproto >= 1.2] [applewm >= 1.2] xfixes fixesproto x11)
|
PKG_CHECK_MODULES(XPBPROXY, [applewmproto >= 1.2] [applewm >= 1.2] xfixes fixesproto x11)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -535,7 +535,7 @@ _X_EXPORT void
|
||||||
miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
|
miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
|
||||||
{
|
{
|
||||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
ScreenPtr pScreen = pWin->drawable.pScreen;
|
||||||
ChangeGCVal gcval[5];
|
ChangeGCVal gcval[6];
|
||||||
BITS32 gcmask;
|
BITS32 gcmask;
|
||||||
GCPtr pGC;
|
GCPtr pGC;
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -603,18 +603,35 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
|
||||||
gcval[0].val = GXcopy;
|
gcval[0].val = GXcopy;
|
||||||
gcmask = GCFunction;
|
gcmask = GCFunction;
|
||||||
|
|
||||||
|
#ifdef ROOTLESS_SAFEALPHA
|
||||||
|
/* Bit mask for alpha channel with a particular number of bits per
|
||||||
|
* pixel. Note that we only care for 32bpp data. Mac OS X uses planar
|
||||||
|
* alpha for 16bpp.
|
||||||
|
*/
|
||||||
|
#define RootlessAlphaMask(bpp) ((bpp) == 32 ? 0xFF000000 : 0)
|
||||||
|
#endif
|
||||||
|
|
||||||
if (solid)
|
if (solid)
|
||||||
{
|
{
|
||||||
|
#ifdef ROOTLESS_SAFEALPHA
|
||||||
|
gcval[1].val = fill.pixel | RootlessAlphaMask(pWin->drawable.bitsPerPixel);
|
||||||
|
#else
|
||||||
gcval[1].val = fill.pixel;
|
gcval[1].val = fill.pixel;
|
||||||
|
#endif
|
||||||
gcval[2].val = FillSolid;
|
gcval[2].val = FillSolid;
|
||||||
gcmask |= GCForeground | GCFillStyle;
|
gcmask |= GCForeground | GCFillStyle;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gcval[1].val = FillTiled;
|
int c=1;
|
||||||
gcval[2].ptr = (pointer)fill.pixmap;
|
#ifdef ROOTLESS_SAFEALPHA
|
||||||
gcval[3].val = tile_x_off;
|
gcval[c++].val = ((CARD32)-1) & ~RootlessAlphaMask(pWin->drawable.bitsPerPixel);
|
||||||
gcval[4].val = tile_y_off;
|
gcmask |= GCPlaneMask;
|
||||||
|
#endif
|
||||||
|
gcval[c++].val = FillTiled;
|
||||||
|
gcval[c++].ptr = (pointer)fill.pixmap;
|
||||||
|
gcval[c++].val = tile_x_off;
|
||||||
|
gcval[c++].val = tile_y_off;
|
||||||
gcmask |= GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin;
|
gcmask |= GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue