int srcXoff, srcYoff;
int dstXoff, dstYoff;
+ XGL_SCREEN_PRIV (pDst->pScreen);
XGL_DRAWABLE_PIXMAP_PRIV (pSrc);
-
+
if (!nBox)
return TRUE;
- /* source is all in software and damaged, fall-back is probably more
- efficient */
- if (pPixmapPriv->allBits &&
- pPixmapPriv->pDamage &&
- REGION_NOTEMPTY (pDrawable->pScreen,
- DamageRegion (pPixmapPriv->pDamage)))
+ if (!xglPrepareTarget (pDst))
return FALSE;
- if (xglPrepareTarget (pDst))
- {
- XGL_SCREEN_PRIV (pDst->pScreen);
-
- if (!xglSyncSurface (pSrc))
- return FALSE;
-
- XGL_GET_DRAWABLE (pDst, dst, dstXoff, dstYoff);
-
- /* blit to screen */
- if (dst == pScreenPriv->surface)
- XGL_INCREMENT_PIXMAP_SCORE (pPixmapPriv, 5000);
- }
- else
- {
- if (!xglPrepareTarget (pSrc))
- return FALSE;
-
- if (!xglSyncSurface (pDst))
- return FALSE;
-
- XGL_GET_DRAWABLE (pDst, dst, dstXoff, dstYoff);
- }
-
+ if (!xglSyncSurface (pSrc))
+ return FALSE;
+
XGL_GET_DRAWABLE (pSrc, src, srcXoff, srcYoff);
-
+ XGL_GET_DRAWABLE (pDst, dst, dstXoff, dstYoff);
+
+ /* blit to screen */
+ if (dst == pScreenPriv->surface)
+ XGL_INCREMENT_PIXMAP_SCORE (pPixmapPriv, 5000);
+
glitz_surface_set_clip_region (dst,
dstXoff, dstYoff,
(glitz_box_t *) pBox, nBox);
pExtent->x2 - pExtent->x1, pExtent->y2 - pExtent->y1,
pBox, nBox))
{
- RegionRec region;
- Bool overlap;
+ RegionRec region;
+ RegionPtr pDamageRegion;
+ glitz_surface_t *surface;
+ int xOff, yOff;
XGL_DRAWABLE_PIXMAP (pDrawable);
+ XGL_PIXMAP_PRIV (pPixmap);
if (!xglMapPixmapBits (pPixmap))
FatalError (XGL_SW_FAILURE_STRING);
FatalError (XGL_SW_FAILURE_STRING);
break;
}
+
+ pDamageRegion = DamageRegion (pPixmapPriv->pDamage);
+
+ XGL_GET_DRAWABLE (pDrawable, surface, xOff, yOff);
- REGION_INIT (pGC->pScreen, ®ion, pBox, nBox);
+ pPixmapPriv->damageBox = miEmptyBox;
while (nBox--)
{
fbFill (pDrawable, pGC,
pBox->x1, pBox->y1,
pBox->x2 - pBox->x1, pBox->y2 - pBox->y1);
+
+ if (pPixmapPriv->format)
+ {
+ part.x1 = pBox->x1 + xOff;
+ part.y1 = pBox->y1 + yOff;
+ part.x2 = pBox->x2 + xOff;
+ part.y2 = pBox->y2 + yOff;
+
+ REGION_INIT (pDrawable->pScreen, ®ion, &part, 1);
+ REGION_UNION (pDrawable->pScreen,
+ pDamageRegion, pDamageRegion, ®ion);
+ REGION_UNINIT (pDrawable->pScreen, ®ion);
+ }
+
pBox++;
}
-
- /* hmm, overlap can't be good, don't know what to do about that */
- REGION_VALIDATE (pGC->pScreen, ®ion, &overlap);
- xglAddSurfaceDamage (pDrawable, ®ion);
- REGION_UNINIT (pGC->pScreen, ®ion);
} else
xglAddCurrentBitDamage (pDrawable);
BoxPtr pExtent;
xglGeometryPtr pGeometry;
+ if (n < 1)
+ return TRUE;
+
pExtent = REGION_EXTENTS (pDrawable->pScreen, pGC->pCompositeClip);
pGeometry = xglGetScratchVertexGeometry (pGC->pScreen, 2 * n);
xglGeometryPtr pGeometry;
Bool coincident_endpoints;
+ if (npt < 2)
+ return TRUE;
+
pExtent = REGION_EXTENTS (pDrawable->pScreen, pGC->pCompositeClip);
coincident_endpoints = FALSE;
BoxPtr pExtent;
xglGeometryPtr pGeometry;
+ if (nsegInit < 1)
+ return TRUE;
+
pExtent = REGION_EXTENTS (pDrawable->pScreen, pGC->pCompositeClip);
pGeometry = xglGetScratchVertexGeometry (pGC->pScreen, 2 * nsegInit);
BoxPtr pExtent;
xglGeometryRec geometry;
+ if (nGlyph < 1)
+ return TRUE;
+
pExtent = REGION_EXTENTS (pDrawable->pScreen, pGC->pCompositeClip);
x += pDrawable->x;
box.x2 = box.x1 + w;
box.y2 = box.y1 + h;
- if (pGCPriv->flags &= ~xglGCReadOnlyDrawableFlag)
+ if (pGC->alu != GXcopy || (pGCPriv->flags &= ~xglGCReadOnlyDrawableFlag))
{
if (!xglSyncBits (pSrc, &box))
FatalError (XGL_SW_FAILURE_STRING);
ScreenPtr pScreen = pDrawable->pScreen;
PixmapPtr pPixmapHeader = NULL;
PixmapPtr pPixmap;
+ int saveTarget;
+
+ XGL_DRAWABLE_PIXMAP_PRIV (pDrawable);
if ((format == ZPixmap) || (depth == 1))
{
GetScratchPixmapHeader (pScreen, w, h, depth,
BitsPerPixel (depth),
PixmapBytePad (w, depth),
- (pointer) data);
+ (pointer) data);
+ if (pPixmap)
+ XGL_GET_PIXMAP_PRIV (pPixmap)->format = NULL;
}
else
{
if (!pPixmap)
return;
+ /* CopyArea should always be done in software */
+ saveTarget = pPixmapPriv->target;
+ pPixmapPriv->target = xglPixmapTargetNo;
+
if (format == XYBitmap)
(*pGC->ops->CopyPlane) ((DrawablePtr) pPixmap, pDrawable, pGC,
sx, sy, sw, sh, dx, dy, 1L);
(*pGC->ops->CopyArea) ((DrawablePtr) pPixmap, pDrawable, pGC,
sx, sy, sw, sh, dx, dy);
+ pPixmapPriv->target = saveTarget;
+
if (pPixmapHeader)
FreeScratchPixmapHeader (pPixmapHeader);
else
return FALSE;
}
- if (!pPixmapPriv->pDamage)
- return TRUE;
-
pRegion = DamageRegion (pPixmapPriv->pDamage);
if (REGION_NOTEMPTY (pDrawable->pScreen, pRegion))
{
XGL_DRAWABLE_PIXMAP_PRIV (pDrawable);
- if (BOX_NOTEMPTY (&pPixmapPriv->bitBox))
+ if (pPixmapPriv->target == xglPixmapTargetIn &&
+ pPixmapPriv->damageBox.x1 < pPixmapPriv->bitBox.x2 &&
+ pPixmapPriv->damageBox.y1 < pPixmapPriv->bitBox.y2 &&
+ pPixmapPriv->damageBox.x2 > pPixmapPriv->bitBox.x1 &&
+ pPixmapPriv->damageBox.y2 > pPixmapPriv->bitBox.y1)
{
- if (pPixmapPriv->damageBox.x1 > pPixmapPriv->bitBox.x2 ||
- pPixmapPriv->damageBox.y1 > pPixmapPriv->bitBox.y2 ||
- pPixmapPriv->damageBox.x2 < pPixmapPriv->bitBox.x1 ||
- pPixmapPriv->damageBox.y2 < pPixmapPriv->bitBox.y1)
- return;
-
pPixmapPriv->bitBox = miEmptyBox;
pPixmapPriv->allBits = FALSE;
}
is likely to exceed the size of the mask. */
if ((SMOOTH_TRAPS_ESTIMATE_RECTS (nTrap) * 4) > (width * height))
accelerate = FALSE;
-
+ } else
accelerate = FALSE;
- }
pMask = xglCreateMaskPicture (pScreen, pDst, maskFormat,
width, height, accelerate);
pPixmap = XGL_GET_WINDOW_PIXMAP (pWin);
- box.x1 = pWin->drawable.x + pExtent->x1;
- box.y1 = pWin->drawable.y + pExtent->y1;
- box.x2 = pWin->drawable.x + pExtent->x2;
- box.y2 = pWin->drawable.y + pExtent->y2;
+ box.x1 = pExtent->x1;
+ box.y1 = pExtent->y1;
+ box.x2 = pExtent->x2;
+ box.y2 = pExtent->y2;
dx = ptOldOrg.x - pWin->drawable.x;
dy = ptOldOrg.y - pWin->drawable.y;