summaryrefslogtreecommitdiff
path: root/exa
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2014-06-20 13:31:20 -0400
committerAdam Jackson <ajax@redhat.com>2014-10-27 15:46:05 -0400
commit73e2383b7350723256894c5076d0c731aec5cd1f (patch)
tree1ceac2d3dbec5820802ce3be12fac72b754cce20 /exa
parente7b9295551d55b42b416ba70cce11dae79ece5e7 (diff)
dix: Always store GC client clip as a region (v2)
Again, this changes FixesCreateRegionFromGC to throw BadMatch when fed a GC with no client clip. v2: Fix Xnest and some variable names (Keith) Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'exa')
-rw-r--r--exa/exa_accel.c20
-rw-r--r--exa/exa_priv.h7
-rw-r--r--exa/exa_unaccel.c11
3 files changed, 17 insertions, 21 deletions
diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index 9c742bdc9..5aa7d1078 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -413,7 +413,7 @@ exaHWCopyNtoN(DrawablePtr pSrcDrawable,
if (!pGC || !exaGCReadsDestination(pDstDrawable, pGC->planemask,
pGC->fillStyle, pGC->alu,
- pGC->clientClipType)) {
+ pGC->clientClip != NULL)) {
dstregion = RegionCreate(NullBox, 0);
RegionCopy(dstregion, srcregion);
RegionTranslate(dstregion, dst_off_x - dx - src_off_x,
@@ -771,7 +771,7 @@ exaPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pSeg)
static Bool exaFillRegionSolid(DrawablePtr pDrawable, RegionPtr pRegion,
Pixel pixel, CARD32 planemask, CARD32 alu,
- unsigned int clientClipType);
+ Bool hasClientClip);
static void
exaPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrect, xRectangle *prect)
@@ -816,11 +816,11 @@ exaPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrect, xRectangle *prect)
if (((pGC->fillStyle == FillSolid || pGC->tileIsPixel) &&
exaFillRegionSolid(pDrawable, pReg, pGC->fillStyle == FillSolid ?
pGC->fgPixel : pGC->tile.pixel, pGC->planemask,
- pGC->alu, pGC->clientClipType)) ||
+ pGC->alu, pGC->clientClip != NULL)) ||
(pGC->fillStyle == FillTiled && !pGC->tileIsPixel &&
exaFillRegionTiled(pDrawable, pReg, pGC->tile.pixmap, &pGC->patOrg,
pGC->planemask, pGC->alu,
- pGC->clientClipType))) {
+ pGC->clientClip != NULL))) {
goto out;
}
}
@@ -990,7 +990,7 @@ exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
static Bool
exaFillRegionSolid(DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel,
- CARD32 planemask, CARD32 alu, unsigned int clientClipType)
+ CARD32 planemask, CARD32 alu, Bool hasClientClip)
{
ExaScreenPriv(pDrawable->pScreen);
PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable);
@@ -1013,8 +1013,7 @@ exaFillRegionSolid(DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel,
pixmaps[0].pPix = pPixmap;
pixmaps[0].pReg = exaGCReadsDestination(pDrawable, planemask, FillSolid,
alu,
- clientClipType) ? NULL :
- pRegion;
+ hasClientClip) ? NULL : pRegion;
exaDoMigration(pixmaps, 1, TRUE);
}
@@ -1074,7 +1073,7 @@ exaFillRegionSolid(DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel,
Bool
exaFillRegionTiled(DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile,
DDXPointPtr pPatOrg, CARD32 planemask, CARD32 alu,
- unsigned int clientClipType)
+ Bool hasClientClip)
{
ExaScreenPriv(pDrawable->pScreen);
PixmapPtr pPixmap;
@@ -1096,7 +1095,7 @@ exaFillRegionTiled(DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile,
if (tileWidth == 1 && tileHeight == 1)
return exaFillRegionSolid(pDrawable, pRegion,
exaGetPixmapFirstPixel(pTile), planemask,
- alu, clientClipType);
+ alu, hasClientClip);
pPixmap = exaGetDrawablePixmap(pDrawable);
pExaPixmap = ExaGetPixmapPriv(pPixmap);
@@ -1113,8 +1112,7 @@ exaFillRegionTiled(DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile,
pixmaps[0].pPix = pPixmap;
pixmaps[0].pReg = exaGCReadsDestination(pDrawable, planemask, FillTiled,
alu,
- clientClipType) ? NULL :
- pRegion;
+ hasClientClip) ? NULL : pRegion;
pixmaps[1].as_dst = FALSE;
pixmaps[1].as_src = TRUE;
pixmaps[1].pPix = pTile;
diff --git a/exa/exa_priv.h b/exa/exa_priv.h
index 88bfd3772..ca4db720f 100644
--- a/exa/exa_priv.h
+++ b/exa/exa_priv.h
@@ -455,12 +455,11 @@ ExaCheckAddTraps(PicturePtr pPicture,
static _X_INLINE Bool
exaGCReadsDestination(DrawablePtr pDrawable, unsigned long planemask,
unsigned int fillStyle, unsigned char alu,
- unsigned int clientClipType)
+ Bool clientClip)
{
return ((alu != GXcopy && alu != GXclear && alu != GXset &&
alu != GXcopyInverted) || fillStyle == FillStippled ||
- clientClipType != CT_NONE ||
- !EXA_PM_IS_SOLID(pDrawable, planemask));
+ clientClip != FALSE || !EXA_PM_IS_SOLID(pDrawable, planemask));
}
void
@@ -470,7 +469,7 @@ Bool
exaFillRegionTiled(DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile,
DDXPointPtr pPatOrg, CARD32 planemask, CARD32 alu,
- unsigned int clientClipType);
+ Bool clientClip);
void
diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c
index b0c6344a5..73eada9c2 100644
--- a/exa/exa_unaccel.c
+++ b/exa/exa_unaccel.c
@@ -107,7 +107,7 @@ ExaCheckPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
if (!pExaScr->prepare_access_reg || !pExaPixmap->pDamage ||
exaGCReadsDestination(pDrawable, pGC->planemask, pGC->fillStyle,
- pGC->alu, pGC->clientClipType))
+ pGC->alu, pGC->clientClip != NULL))
exaPrepareAccess(pDrawable, EXA_PREPARE_DEST);
else
pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_DEST,
@@ -143,7 +143,7 @@ ExaCheckCopyNtoN(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
if (pExaScr->prepare_access_reg &&
!exaGCReadsDestination(pDst, pGC->planemask, pGC->fillStyle,
- pGC->alu, pGC->clientClipType) &&
+ pGC->alu, pGC->clientClip != NULL) &&
RegionInitBoxes(&reg, pbox, nbox)) {
PixmapPtr pPixmap = exaGetDrawablePixmap(pDst);
@@ -179,10 +179,9 @@ ExaFallbackPrepareReg(DrawablePtr pDrawable,
ExaScreenPriv(pScreen);
if (pExaScr->prepare_access_reg &&
- !(checkReads && exaGCReadsDestination(pDrawable,
- pGC->planemask,
- pGC->fillStyle,
- pGC->alu, pGC->clientClipType))) {
+ !(checkReads && exaGCReadsDestination(pDrawable, pGC->planemask,
+ pGC->fillStyle, pGC->alu,
+ pGC->clientClip != NULL))) {
BoxRec box;
RegionRec reg;
int xoff, yoff;