summaryrefslogtreecommitdiff
path: root/exa/exa_unaccel.c
diff options
context:
space:
mode:
Diffstat (limited to 'exa/exa_unaccel.c')
-rw-r--r--exa/exa_unaccel.c40
1 files changed, 9 insertions, 31 deletions
diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c
index a30911507..7713a08c9 100644
--- a/exa/exa_unaccel.c
+++ b/exa/exa_unaccel.c
@@ -23,26 +23,6 @@
#include "exa_priv.h"
-#define TRIM_BOX(box, pGC) if (pGC->pCompositeClip) { \
- BoxPtr extents = &pGC->pCompositeClip->extents;\
- if(box.x1 < extents->x1) box.x1 = extents->x1; \
- if(box.x2 > extents->x2) box.x2 = extents->x2; \
- if(box.y1 < extents->y1) box.y1 = extents->y1; \
- if(box.y2 > extents->y2) box.y2 = extents->y2; \
- }
-
-#define TRANSLATE_BOX(box, pDrawable) { \
- box.x1 += pDrawable->x; \
- box.x2 += pDrawable->x; \
- box.y1 += pDrawable->y; \
- box.y2 += pDrawable->y; \
- }
-
-#define TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC) { \
- TRANSLATE_BOX(box, pDrawable); \
- TRIM_BOX(box, pGC); \
- }
-
/*
* These functions wrap the low-level fb rendering functions and
* synchronize framebuffer/accelerated drawing by stalling until
@@ -222,10 +202,9 @@ ExaCheckPolyFillRect (DrawablePtr pDrawable, GCPtr pGC,
EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
if (nrect) {
- BoxRec box = { .x1 = max(prect->x,0),
- .x2 = min(prect->x + prect->width,pDrawable->width),
- .y1 = max(prect->y,0),
- .y2 = min(prect->y + prect->height,pDrawable->height) };
+ int x1 = max(prect->x, 0), y1 = max(prect->y, 0);
+ int x2 = min(prect->x + prect->width, pDrawable->width);
+ int y2 = min(prect->y + prect->height, pDrawable->height);
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
exaPrepareAccessGC (pGC);
@@ -239,15 +218,14 @@ ExaCheckPolyFillRect (DrawablePtr pDrawable, GCPtr pGC,
while (--nrect)
{
prect++;
- box.x1 = min(box.x1, prect->x);
- box.x2 = max(box.x2, prect->x + prect->width);
- box.y1 = min(box.y1, prect->y);
- box.y2 = max(box.y2, prect->y + prect->height);
+ x1 = min(x1, prect->x);
+ x2 = max(x2, prect->x + prect->width);
+ y1 = min(y1, prect->y);
+ y2 = max(y2, prect->y + prect->height);
}
- TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC);
-
- exaDrawableDirty (pDrawable, box.x1, box.x2, box.y1, box.y2);
+ exaDrawableDirty (pDrawable, pDrawable->x + x1, pDrawable->y + y1,
+ pDrawable->x + x2, pDrawable->y + y2);
}
}