diff options
author | Eric Anholt <anholt@freebsd.org> | 2005-08-30 04:41:04 +0000 |
---|---|---|
committer | Eric Anholt <anholt@freebsd.org> | 2005-08-30 04:41:04 +0000 |
commit | 0c74799af4f924ba64ebd6052802b73547f55c72 (patch) | |
tree | 7dad282a6a084ad34da3c801c810da33ed7914bb /exa/exa_render.c | |
parent | f20e845b04dee5fc0780811f565180e322b60b73 (diff) |
Remove existing broken maxX/maxY code for composite (results in infinite
loops, doesn't deal with failure, doesn't present the interface to
drivers that I expected) and instead replace it with a simple fallback
to software when coordinate limits could be violated. Act similarly in
other acceleration cases as well.
The solution I want to see (and intend to do soon) is to (when necessary)
create temporary pictures/pixmaps pointing towards the real ones' bits,
with the offsets adjusted, then render from/to those using adjusted
coordinates.
Diffstat (limited to 'exa/exa_render.c')
-rw-r--r-- | exa/exa_render.c | 67 |
1 files changed, 11 insertions, 56 deletions
diff --git a/exa/exa_render.c b/exa/exa_render.c index 438c876e8..9909d7f46 100644 --- a/exa/exa_render.c +++ b/exa/exa_render.c @@ -327,65 +327,20 @@ exaTryDriverComposite(CARD8 op, PixmapPtr pSrcPix, pMaskPix = NULL, pDstPix; struct _Pixmap scratch; - if (pExaScr->info->card.maxX < width || - pExaScr->info->card.maxY < height) + /* Bail if we might exceed coord limits by rendering from/to these. We + * should really be making some scratch pixmaps with offsets and coords + * adjusted to deal with this, but it hasn't been done yet. + */ + if (pSrc->pDrawable->width > pExaScr->info->card.maxX || + pSrc->pDrawable->height > pExaScr->info->card.maxY || + pDst->pDrawable->width > pExaScr->info->card.maxX || + pDst->pDrawable->height > pExaScr->info->card.maxY || + (pMask && (pMask->pDrawable->width > pExaScr->info->card.maxX || + pMask->pDrawable->height > pExaScr->info->card.maxY))) { - int total_width = width; - int total_height = height; - int xOff = 0; - int yOff = 0; - while (total_width > pExaScr->info->card.maxX) { - while (total_height > pExaScr->info->card.maxY) { - exaTryDriverComposite(op, - pSrc, - pMask, - pDst, - xSrc + xOff, - ySrc + yOff, - xMask + xOff, - yMask + yOff, - xDst + xOff, - yDst + yOff, - pExaScr->info->card.maxX, - pExaScr->info->card.maxY); - total_width -= pExaScr->info->card.maxX; - xOff += pExaScr->info->card.maxX; - yOff = 0; - } - if (total_height) - exaTryDriverComposite(op, - pSrc, - pMask, - pDst, - xSrc + xOff, - ySrc + yOff, - xMask + xOff, - yMask + yOff, - xDst + xOff, - yDst + yOff, - pExaScr->info->card.maxX, - total_height); - total_height -= pExaScr->info->card.maxY; - yOff += pExaScr->info->card.maxY; - } - if (total_width && total_height) - exaTryDriverComposite(op, - pSrc, - pMask, - pDst, - xSrc + xOff, - ySrc + yOff, - xMask + xOff, - yMask + yOff, - xDst + xOff, - yDst + yOff, - total_width, - total_height); - - return -1; + return -1; } - xDst += pDst->pDrawable->x; yDst += pDst->pDrawable->y; |