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
|
@ -460,6 +460,7 @@ compFreePixmap (WindowPtr pWin)
|
||||||
{
|
{
|
||||||
DamageUnregister (&pWin->drawable, cw->damage);
|
DamageUnregister (&pWin->drawable, cw->damage);
|
||||||
cw->damageRegistered = FALSE;
|
cw->damageRegistered = FALSE;
|
||||||
|
DamageEmpty (cw->damage);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Move the parent-constrained border clip region back into
|
* Move the parent-constrained border clip region back into
|
||||||
|
|
|
@ -40,6 +40,7 @@ compCloseScreen (int index, ScreenPtr pScreen)
|
||||||
|
|
||||||
pScreen->CloseScreen = cs->CloseScreen;
|
pScreen->CloseScreen = cs->CloseScreen;
|
||||||
pScreen->BlockHandler = cs->BlockHandler;
|
pScreen->BlockHandler = cs->BlockHandler;
|
||||||
|
pScreen->InstallColormap = cs->InstallColormap;
|
||||||
pScreen->ReparentWindow = cs->ReparentWindow;
|
pScreen->ReparentWindow = cs->ReparentWindow;
|
||||||
pScreen->MoveWindow = cs->MoveWindow;
|
pScreen->MoveWindow = cs->MoveWindow;
|
||||||
pScreen->ResizeWindow = cs->ResizeWindow;
|
pScreen->ResizeWindow = cs->ResizeWindow;
|
||||||
|
@ -59,6 +60,23 @@ compCloseScreen (int index, ScreenPtr pScreen)
|
||||||
return ret;
|
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
|
static void
|
||||||
compScreenUpdate (ScreenPtr pScreen)
|
compScreenUpdate (ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
|
@ -126,7 +144,9 @@ typedef struct _alternateVisual {
|
||||||
} CompAlternateVisual;
|
} CompAlternateVisual;
|
||||||
|
|
||||||
static CompAlternateVisual altVisuals[NUM_COMP_ALTERNATE_VISUALS] = {
|
static CompAlternateVisual altVisuals[NUM_COMP_ALTERNATE_VISUALS] = {
|
||||||
|
#if COMP_INCLUDE_RGB24_VISUAL
|
||||||
{ 24, PICT_r8g8b8 },
|
{ 24, PICT_r8g8b8 },
|
||||||
|
#endif
|
||||||
{ 32, PICT_a8r8g8b8 },
|
{ 32, PICT_a8r8g8b8 },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -163,10 +183,6 @@ compAddAlternateVisuals (ScreenPtr pScreen, CompScreenPtr cs)
|
||||||
if (!pPictFormat)
|
if (!pPictFormat)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/*
|
|
||||||
* Ok, create a visual id for this format
|
|
||||||
*/
|
|
||||||
cs->alternateVisuals[numAlternate] = FakeClientID (0);
|
|
||||||
/*
|
/*
|
||||||
* Allocate vid list for this depth
|
* Allocate vid list for this depth
|
||||||
*/
|
*/
|
||||||
|
@ -235,6 +251,7 @@ compAddAlternateVisuals (ScreenPtr pScreen, CompScreenPtr cs)
|
||||||
DepthPtr depth = depths[alt];
|
DepthPtr depth = depths[alt];
|
||||||
PictFormatPtr pPictFormat = pPictFormats[alt];
|
PictFormatPtr pPictFormat = pPictFormats[alt];
|
||||||
VisualPtr visual = &visuals[numVisuals + alt];
|
VisualPtr visual = &visuals[numVisuals + alt];
|
||||||
|
unsigned long alphaMask;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize the visual
|
* Initialize the visual
|
||||||
|
@ -249,16 +266,19 @@ compAddAlternateVisuals (ScreenPtr pScreen, CompScreenPtr cs)
|
||||||
pPictFormat->direct.green);
|
pPictFormat->direct.green);
|
||||||
visual->blueMask = (((unsigned long) pPictFormat->direct.blueMask) <<
|
visual->blueMask = (((unsigned long) pPictFormat->direct.blueMask) <<
|
||||||
pPictFormat->direct.blue);
|
pPictFormat->direct.blue);
|
||||||
|
alphaMask = (((unsigned long) pPictFormat->direct.alphaMask) <<
|
||||||
|
pPictFormat->direct.alpha);
|
||||||
visual->offsetRed = pPictFormat->direct.red;
|
visual->offsetRed = pPictFormat->direct.red;
|
||||||
visual->offsetGreen = pPictFormat->direct.green;
|
visual->offsetGreen = pPictFormat->direct.green;
|
||||||
visual->offsetBlue = pPictFormat->direct.blue;
|
visual->offsetBlue = pPictFormat->direct.blue;
|
||||||
/*
|
/*
|
||||||
* follow GLX and set nplanes to just the bits
|
* Include A bits in this (unlike GLX which includes only RGB)
|
||||||
* used for the RGB value, not A
|
* This lets DIX compute suitable masks for colormap allocations
|
||||||
*/
|
*/
|
||||||
visual->nplanes = Ones (visual->redMask |
|
visual->nplanes = Ones (visual->redMask |
|
||||||
visual->greenMask |
|
visual->greenMask |
|
||||||
visual->blueMask);
|
visual->blueMask |
|
||||||
|
alphaMask);
|
||||||
/*
|
/*
|
||||||
* find widest component
|
* find widest component
|
||||||
*/
|
*/
|
||||||
|
@ -355,6 +375,9 @@ compScreenInit (ScreenPtr pScreen)
|
||||||
cs->ReparentWindow = pScreen->ReparentWindow;
|
cs->ReparentWindow = pScreen->ReparentWindow;
|
||||||
pScreen->ReparentWindow = compReparentWindow;
|
pScreen->ReparentWindow = compReparentWindow;
|
||||||
|
|
||||||
|
cs->InstallColormap = pScreen->InstallColormap;
|
||||||
|
pScreen->InstallColormap = compInstallColormap;
|
||||||
|
|
||||||
cs->BlockHandler = pScreen->BlockHandler;
|
cs->BlockHandler = pScreen->BlockHandler;
|
||||||
pScreen->BlockHandler = compBlockHandler;
|
pScreen->BlockHandler = compBlockHandler;
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,15 @@ typedef struct _CompSubwindows {
|
||||||
CompClientWindowPtr clients;
|
CompClientWindowPtr clients;
|
||||||
} CompSubwindowsRec, *CompSubwindowsPtr;
|
} CompSubwindowsRec, *CompSubwindowsPtr;
|
||||||
|
|
||||||
|
#ifndef COMP_INCLUDE_RGB24_VISUAL
|
||||||
|
#define COMP_INCLUDE_RGB24_VISUAL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if COMP_INCLUDE_RGB24_VISUAL
|
||||||
#define NUM_COMP_ALTERNATE_VISUALS 2
|
#define NUM_COMP_ALTERNATE_VISUALS 2
|
||||||
|
#else
|
||||||
|
#define NUM_COMP_ALTERNATE_VISUALS 1
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct _CompScreen {
|
typedef struct _CompScreen {
|
||||||
PositionWindowProcPtr PositionWindow;
|
PositionWindowProcPtr PositionWindow;
|
||||||
|
@ -99,6 +107,11 @@ typedef struct _CompScreen {
|
||||||
*/
|
*/
|
||||||
ReparentWindowProcPtr ReparentWindow;
|
ReparentWindowProcPtr ReparentWindow;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Colormaps for new visuals better not get installed
|
||||||
|
*/
|
||||||
|
InstallColormapProcPtr InstallColormap;
|
||||||
|
|
||||||
ScreenBlockHandlerProcPtr BlockHandler;
|
ScreenBlockHandlerProcPtr BlockHandler;
|
||||||
CloseScreenProcPtr CloseScreen;
|
CloseScreenProcPtr CloseScreen;
|
||||||
Bool damaged;
|
Bool damaged;
|
||||||
|
|
|
@ -667,15 +667,32 @@ compWindowUpdateAutomatic (WindowPtr pWin)
|
||||||
&subwindowMode,
|
&subwindowMode,
|
||||||
serverClient,
|
serverClient,
|
||||||
&error);
|
&error);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* First move the region from window to screen coordinates
|
||||||
|
*/
|
||||||
REGION_TRANSLATE (pScreen, pRegion,
|
REGION_TRANSLATE (pScreen, pRegion,
|
||||||
pSrcPixmap->screen_x, pSrcPixmap->screen_y);
|
pWin->drawable.x, pWin->drawable.y);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Clip against the "real" border clip
|
||||||
|
*/
|
||||||
REGION_INTERSECT (pScreen, pRegion, pRegion, &cw->borderClip);
|
REGION_INTERSECT (pScreen, pRegion, pRegion, &cw->borderClip);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Now translate from screen to pixmap coordinates
|
||||||
|
*/
|
||||||
REGION_TRANSLATE (pScreen, pRegion,
|
REGION_TRANSLATE (pScreen, pRegion,
|
||||||
-pSrcPixmap->screen_x, -pSrcPixmap->screen_y);
|
-pSrcPixmap->screen_x, -pSrcPixmap->screen_y);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Clip the picture
|
||||||
|
*/
|
||||||
SetPictureClipRegion (pSrcPicture, 0, 0, pRegion);
|
SetPictureClipRegion (pSrcPicture, 0, 0, pRegion);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* And paint
|
||||||
|
*/
|
||||||
CompositePicture (PictOpSrc,
|
CompositePicture (PictOpSrc,
|
||||||
pSrcPicture,
|
pSrcPicture,
|
||||||
0,
|
0,
|
||||||
|
@ -689,6 +706,10 @@ compWindowUpdateAutomatic (WindowPtr pWin)
|
||||||
pSrcPixmap->drawable.height);
|
pSrcPixmap->drawable.height);
|
||||||
FreePicture (pSrcPicture, 0);
|
FreePicture (pSrcPicture, 0);
|
||||||
FreePicture (pDstPicture, 0);
|
FreePicture (pDstPicture, 0);
|
||||||
|
/*
|
||||||
|
* Empty the damage region. This has the nice effect of
|
||||||
|
* rendering the translations above harmless
|
||||||
|
*/
|
||||||
DamageEmpty (cw->damage);
|
DamageEmpty (cw->damage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $XdotOrg: xc/programs/Xserver/dix/colormap.c,v 1.3 2004/07/31 08:24:13 anholt Exp $ */
|
/* $XdotOrg: xc/programs/Xserver/dix/colormap.c,v 1.4 2004/08/07 00:58:21 keithp Exp $ */
|
||||||
/* $XFree86: xc/programs/Xserver/dix/colormap.c,v 3.11 2003/11/03 05:10:59 tsi Exp $ */
|
/* $XFree86: xc/programs/Xserver/dix/colormap.c,v 3.11 2003/11/03 05:10:59 tsi Exp $ */
|
||||||
/***********************************************************
|
/***********************************************************
|
||||||
|
|
||||||
|
@ -190,11 +190,10 @@ static void FindColorInRootCmap (
|
||||||
#define NUMRED(vis) ((vis->redMask >> vis->offsetRed) + 1)
|
#define NUMRED(vis) ((vis->redMask >> vis->offsetRed) + 1)
|
||||||
#define NUMGREEN(vis) ((vis->greenMask >> vis->offsetGreen) + 1)
|
#define NUMGREEN(vis) ((vis->greenMask >> vis->offsetGreen) + 1)
|
||||||
#define NUMBLUE(vis) ((vis->blueMask >> vis->offsetBlue) + 1)
|
#define NUMBLUE(vis) ((vis->blueMask >> vis->offsetBlue) + 1)
|
||||||
#if 0
|
#if COMPOSITE
|
||||||
#define NUMALPHA(vis) XXX cant store in visual because of ABI concerns
|
#define ALPHAMASK(vis) ((vis)->nplanes < 32 ? 0 : \
|
||||||
#define ALPHAMASK(vis) XXX cant store in visual because of ABI concerns
|
(CARD32) ~((vis)->redMask|(vis)->greenMask|(vis)->blueMask))
|
||||||
#else
|
#else
|
||||||
#define NUMALPHA(vis) 0
|
|
||||||
#define ALPHAMASK(vis) 0
|
#define ALPHAMASK(vis) 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -873,9 +872,8 @@ AllocColor (pmap, pred, pgreen, pblue, pPix, client)
|
||||||
pixB = FindBestPixel(pmap->blue, NUMBLUE(pVisual), &rgb, BLUEMAP);
|
pixB = FindBestPixel(pmap->blue, NUMBLUE(pVisual), &rgb, BLUEMAP);
|
||||||
*pPix = (pixR << pVisual->offsetRed) |
|
*pPix = (pixR << pVisual->offsetRed) |
|
||||||
(pixG << pVisual->offsetGreen) |
|
(pixG << pVisual->offsetGreen) |
|
||||||
(pixB << pVisual->offsetBlue);
|
(pixB << pVisual->offsetBlue) |
|
||||||
|
ALPHAMASK(pVisual);
|
||||||
*pPix |= ALPHAMASK(pVisual);
|
|
||||||
|
|
||||||
*pred = pmap->red[pixR].co.local.red;
|
*pred = pmap->red[pixR].co.local.red;
|
||||||
*pgreen = pmap->green[pixG].co.local.green;
|
*pgreen = pmap->green[pixG].co.local.green;
|
||||||
|
@ -966,9 +964,7 @@ AllocColor (pmap, pred, pgreen, pblue, pPix, client)
|
||||||
(void)FreeCo(pmap, client, REDMAP, 1, &pixR, (Pixel)0);
|
(void)FreeCo(pmap, client, REDMAP, 1, &pixR, (Pixel)0);
|
||||||
return (BadAlloc);
|
return (BadAlloc);
|
||||||
}
|
}
|
||||||
*pPix = pixR | pixG | pixB;
|
*pPix = pixR | pixG | pixB | ALPHAMASK(pVisual);
|
||||||
|
|
||||||
*pPix |= ALPHAMASK(pVisual);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -201,15 +201,6 @@ typedef struct _FbAccessMap {
|
||||||
*/
|
*/
|
||||||
extern FbAccessMap fbAccessMap[];
|
extern FbAccessMap fbAccessMap[];
|
||||||
|
|
||||||
/* fbaddtrap.c */
|
|
||||||
|
|
||||||
void
|
|
||||||
fbAddTraps (PicturePtr pPicture,
|
|
||||||
INT16 xOff,
|
|
||||||
INT16 yOff,
|
|
||||||
int ntrap,
|
|
||||||
xTrap *traps);
|
|
||||||
|
|
||||||
/* fbcompose.c */
|
/* fbcompose.c */
|
||||||
|
|
||||||
typedef struct _fbCompSrc {
|
typedef struct _fbCompSrc {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $XdotOrg: xc/programs/Xserver/fb/fbwindow.c,v 1.2 2004/04/23 19:05:14 eich Exp $ */
|
/* $XdotOrg: xc/programs/Xserver/fb/fbwindow.c,v 1.3 2004/08/11 22:40:14 keithp Exp $ */
|
||||||
/*
|
/*
|
||||||
* Id: fbwindow.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
|
* Id: fbwindow.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
|
||||||
*
|
*
|
||||||
|
@ -122,13 +122,13 @@ fbCopyWindow(WindowPtr pWin,
|
||||||
{
|
{
|
||||||
RegionRec rgnDst;
|
RegionRec rgnDst;
|
||||||
int dx, dy;
|
int dx, dy;
|
||||||
WindowPtr pwinRoot;
|
|
||||||
#ifdef COMPOSITE
|
#ifdef COMPOSITE
|
||||||
PixmapPtr pPixmap = fbGetWindowPixmap (pWin);
|
PixmapPtr pPixmap = fbGetWindowPixmap (pWin);
|
||||||
|
DrawablePtr pDrawable = &pPixmap->drawable;
|
||||||
|
#else
|
||||||
|
DrawablePtr pDrawable = &WindowTable[pWin->drawable.pScreen->myNum]->drawable;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pwinRoot = WindowTable[pWin->drawable.pScreen->myNum];
|
|
||||||
|
|
||||||
dx = ptOldOrg.x - pWin->drawable.x;
|
dx = ptOldOrg.x - pWin->drawable.x;
|
||||||
dy = ptOldOrg.y - pWin->drawable.y;
|
dy = ptOldOrg.y - pWin->drawable.y;
|
||||||
REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy);
|
REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy);
|
||||||
|
@ -143,7 +143,7 @@ fbCopyWindow(WindowPtr pWin,
|
||||||
-pPixmap->screen_x, -pPixmap->screen_y);
|
-pPixmap->screen_x, -pPixmap->screen_y);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fbCopyRegion ((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
|
fbCopyRegion (pDrawable, pDrawable,
|
||||||
0,
|
0,
|
||||||
&rgnDst, dx, dy, fbCopyWindowProc, 0, 0);
|
&rgnDst, dx, dy, fbCopyWindowProc, 0, 0);
|
||||||
|
|
||||||
|
|
128
render/mipict.c
128
render/mipict.c
|
@ -249,8 +249,7 @@ miValidatePicture (PicturePtr pPicture,
|
||||||
#define BOUND(v) (INT16) ((v) < MINSHORT ? MINSHORT : (v) > MAXSHORT ? MAXSHORT : (v))
|
#define BOUND(v) (INT16) ((v) < MINSHORT ? MINSHORT : (v) > MAXSHORT ? MAXSHORT : (v))
|
||||||
|
|
||||||
static __inline Bool
|
static __inline Bool
|
||||||
miClipPictureReg (ScreenPtr pScreen,
|
miClipPictureReg (RegionPtr pRegion,
|
||||||
RegionPtr pRegion,
|
|
||||||
RegionPtr pClip,
|
RegionPtr pClip,
|
||||||
int dx,
|
int dx,
|
||||||
int dy)
|
int dy)
|
||||||
|
@ -276,19 +275,22 @@ miClipPictureReg (ScreenPtr pScreen,
|
||||||
REGION_EMPTY(pScreen, pRegion);
|
REGION_EMPTY(pScreen, pRegion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (!REGION_NOTEMPTY (pScreen, pClip))
|
||||||
|
return FALSE;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
REGION_TRANSLATE(pScreen, pRegion, dx, dy);
|
if (dx || dy)
|
||||||
|
REGION_TRANSLATE(pScreen, pRegion, -dx, -dy);
|
||||||
if (!REGION_INTERSECT (pScreen, pRegion, pRegion, pClip))
|
if (!REGION_INTERSECT (pScreen, pRegion, pRegion, pClip))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
REGION_TRANSLATE(pScreen, pRegion, -dx, -dy);
|
if (dx || dy)
|
||||||
|
REGION_TRANSLATE(pScreen, pRegion, dx, dy);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return REGION_NOTEMPTY(pScreen, pRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline Bool
|
static __inline Bool
|
||||||
miClipPictureSrc (ScreenPtr pScreen,
|
miClipPictureSrc (RegionPtr pRegion,
|
||||||
RegionPtr pRegion,
|
|
||||||
PicturePtr pPicture,
|
PicturePtr pPicture,
|
||||||
int dx,
|
int dx,
|
||||||
int dy)
|
int dy)
|
||||||
|
@ -314,11 +316,70 @@ miClipPictureSrc (ScreenPtr pScreen,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return miClipPictureReg (pScreen, pRegion, pPicture->pCompositeClip,
|
return miClipPictureReg (pRegion,
|
||||||
dx, dy);
|
pPicture->pCompositeClip,
|
||||||
|
dx,
|
||||||
|
dy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
miCompositeSourceValidate (PicturePtr pPicture,
|
||||||
|
INT16 x,
|
||||||
|
INT16 y,
|
||||||
|
CARD16 width,
|
||||||
|
CARD16 height)
|
||||||
|
{
|
||||||
|
DrawablePtr pDrawable = pPicture->pDrawable;
|
||||||
|
ScreenPtr pScreen = pDrawable->pScreen;
|
||||||
|
|
||||||
|
if (pScreen->SourceValidate)
|
||||||
|
{
|
||||||
|
x -= pPicture->pDrawable->x;
|
||||||
|
y -= pPicture->pDrawable->y;
|
||||||
|
if (pPicture->transform)
|
||||||
|
{
|
||||||
|
xPoint points[4];
|
||||||
|
int i;
|
||||||
|
int xmin, ymin, xmax, ymax;
|
||||||
|
|
||||||
|
#define VectorSet(i,_x,_y) { points[i].x = _x; points[i].y = _y; }
|
||||||
|
VectorSet (0, x, y);
|
||||||
|
VectorSet (1, x + width, y);
|
||||||
|
VectorSet (2, x, y + height);
|
||||||
|
VectorSet (3, x + width, y + height);
|
||||||
|
xmin = ymin = 32767;
|
||||||
|
xmax = ymax = -32737;
|
||||||
|
for (i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
|
PictVector t;
|
||||||
|
t.vector[0] = IntToxFixed (points[i].x);
|
||||||
|
t.vector[1] = IntToxFixed (points[i].y);
|
||||||
|
t.vector[2] = xFixed1;
|
||||||
|
if (PictureTransformPoint (pPicture->transform, &t))
|
||||||
|
{
|
||||||
|
int tx = xFixedToInt (t.vector[0]);
|
||||||
|
int ty = xFixedToInt (t.vector[1]);
|
||||||
|
if (tx < xmin) xmin = tx;
|
||||||
|
if (tx > xmax) xmax = tx;
|
||||||
|
if (ty < ymin) ymin = ty;
|
||||||
|
if (ty > ymax) ymax = ty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
x = xmin;
|
||||||
|
y = ymin;
|
||||||
|
width = xmax - xmin;
|
||||||
|
height = ymax - ymin;
|
||||||
|
}
|
||||||
|
(*pScreen->SourceValidate) (pDrawable, x, y, width, height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* returns FALSE if the final region is empty. Indistinguishable from
|
||||||
|
* an allocation failure, but rendering ignores those anyways.
|
||||||
|
*/
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
miComputeCompositeRegion (RegionPtr pRegion,
|
miComputeCompositeRegion (RegionPtr pRegion,
|
||||||
PicturePtr pSrc,
|
PicturePtr pSrc,
|
||||||
|
@ -333,7 +394,6 @@ miComputeCompositeRegion (RegionPtr pRegion,
|
||||||
CARD16 width,
|
CARD16 width,
|
||||||
CARD16 height)
|
CARD16 height)
|
||||||
{
|
{
|
||||||
ScreenPtr pScreen = pSrc->pDrawable->pScreen;
|
|
||||||
int v;
|
int v;
|
||||||
|
|
||||||
pRegion->extents.x1 = xDst;
|
pRegion->extents.x1 = xDst;
|
||||||
|
@ -347,18 +407,34 @@ miComputeCompositeRegion (RegionPtr pRegion,
|
||||||
if (pRegion->extents.x1 >= pRegion->extents.x2 ||
|
if (pRegion->extents.x1 >= pRegion->extents.x2 ||
|
||||||
pRegion->extents.y1 >= pRegion->extents.y2)
|
pRegion->extents.y1 >= pRegion->extents.y2)
|
||||||
{
|
{
|
||||||
REGION_EMPTY (pScreen, pRegion);
|
REGION_EMPTY (pDst->pDrawable->pScreen, pRegion);
|
||||||
return TRUE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
/* clip against dst */
|
||||||
|
if (!miClipPictureReg (pRegion, pDst->pCompositeClip, 0, 0))
|
||||||
|
{
|
||||||
|
REGION_UNINIT (pScreen, pRegion);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
if (pDst->alphaMap)
|
||||||
|
{
|
||||||
|
if (!miClipPictureReg (pRegion, pDst->alphaMap->pCompositeClip,
|
||||||
|
-pDst->alphaOrigin.x,
|
||||||
|
-pDst->alphaOrigin.y))
|
||||||
|
{
|
||||||
|
REGION_UNINIT (pScreen, pRegion);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* clip against src */
|
/* clip against src */
|
||||||
if (!miClipPictureSrc (pScreen, pRegion, pSrc, xDst - xSrc, yDst - ySrc))
|
if (!miClipPictureSrc (pRegion, pSrc, xDst - xSrc, yDst - ySrc))
|
||||||
{
|
{
|
||||||
REGION_UNINIT (pScreen, pRegion);
|
REGION_UNINIT (pScreen, pRegion);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (pSrc->alphaMap)
|
if (pSrc->alphaMap)
|
||||||
{
|
{
|
||||||
if (!miClipPictureSrc (pScreen, pRegion, pSrc->alphaMap,
|
if (!miClipPictureSrc (pRegion, pSrc->alphaMap,
|
||||||
xDst - (xSrc + pSrc->alphaOrigin.x),
|
xDst - (xSrc + pSrc->alphaOrigin.x),
|
||||||
yDst - (ySrc + pSrc->alphaOrigin.y)))
|
yDst - (ySrc + pSrc->alphaOrigin.y)))
|
||||||
{
|
{
|
||||||
|
@ -369,15 +445,14 @@ miComputeCompositeRegion (RegionPtr pRegion,
|
||||||
/* clip against mask */
|
/* clip against mask */
|
||||||
if (pMask)
|
if (pMask)
|
||||||
{
|
{
|
||||||
if (!miClipPictureSrc (pScreen, pRegion, pMask,
|
if (!miClipPictureSrc (pRegion, pMask, xDst - xMask, yDst - yMask))
|
||||||
xDst - xMask, yDst - yMask))
|
|
||||||
{
|
{
|
||||||
REGION_UNINIT (pScreen, pRegion);
|
REGION_UNINIT (pScreen, pRegion);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (pMask->alphaMap)
|
if (pMask->alphaMap)
|
||||||
{
|
{
|
||||||
if (!miClipPictureSrc (pScreen, pRegion, pMask->alphaMap,
|
if (!miClipPictureSrc (pRegion, pMask->alphaMap,
|
||||||
xDst - (xMask + pMask->alphaOrigin.x),
|
xDst - (xMask + pMask->alphaOrigin.x),
|
||||||
yDst - (yMask + pMask->alphaOrigin.y)))
|
yDst - (yMask + pMask->alphaOrigin.y)))
|
||||||
{
|
{
|
||||||
|
@ -386,22 +461,9 @@ miComputeCompositeRegion (RegionPtr pRegion,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!miClipPictureReg (pScreen, pRegion, pDst->pCompositeClip, 0, 0))
|
miCompositeSourceValidate (pSrc, xSrc, ySrc, width, height);
|
||||||
{
|
if (pMask)
|
||||||
REGION_UNINIT (pScreen, pRegion);
|
miCompositeSourceValidate (pMask, xMask, yMask, width, height);
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
if (pDst->alphaMap)
|
|
||||||
{
|
|
||||||
if (!miClipPictureReg (pScreen,
|
|
||||||
pRegion, pDst->alphaMap->pCompositeClip,
|
|
||||||
-pDst->alphaOrigin.x,
|
|
||||||
-pDst->alphaOrigin.y))
|
|
||||||
{
|
|
||||||
REGION_UNINIT (pScreen, pRegion);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ miColorRects (PicturePtr pDst,
|
||||||
ScreenPtr pScreen = pDst->pDrawable->pScreen;
|
ScreenPtr pScreen = pDst->pDrawable->pScreen;
|
||||||
CARD32 pixel;
|
CARD32 pixel;
|
||||||
GCPtr pGC;
|
GCPtr pGC;
|
||||||
CARD32 tmpval[4];
|
CARD32 tmpval[5];
|
||||||
RegionPtr pClip;
|
RegionPtr pClip;
|
||||||
unsigned long mask;
|
unsigned long mask;
|
||||||
|
|
||||||
|
@ -53,12 +53,13 @@ miColorRects (PicturePtr pDst,
|
||||||
return;
|
return;
|
||||||
tmpval[0] = GXcopy;
|
tmpval[0] = GXcopy;
|
||||||
tmpval[1] = pixel;
|
tmpval[1] = pixel;
|
||||||
mask = GCFunction | GCForeground;
|
tmpval[2] = pDst->subWindowMode;
|
||||||
|
mask = GCFunction | GCForeground | GCSubwindowMode;
|
||||||
if (pClipPict->clientClipType == CT_REGION)
|
if (pClipPict->clientClipType == CT_REGION)
|
||||||
{
|
{
|
||||||
tmpval[2] = pDst->clipOrigin.x - xoff;
|
tmpval[3] = pDst->clipOrigin.x - xoff;
|
||||||
tmpval[3] = pDst->clipOrigin.y - yoff;
|
tmpval[4] = pDst->clipOrigin.y - yoff;
|
||||||
mask |= CPClipXOrigin|CPClipYOrigin;
|
mask |= GCClipXOrigin|GCClipYOrigin;
|
||||||
|
|
||||||
pClip = REGION_CREATE (pScreen, NULL, 1);
|
pClip = REGION_CREATE (pScreen, NULL, 1);
|
||||||
REGION_COPY (pScreen, pClip,
|
REGION_COPY (pScreen, pClip,
|
||||||
|
|
Loading…
Reference in New Issue