sna: Add more DBG for fallback processing
Hunting the lost box... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
36f2e46619
commit
88cb1968b6
|
|
@ -37,6 +37,11 @@ static inline void add(RegionPtr region,
|
|||
r->x1 = x1; r->y1 = y1;
|
||||
r->x2 = x2; r->y2 = y2;
|
||||
|
||||
DBG(("%s[%d/%d]: (%d, %d), (%d, %d)\n",
|
||||
__FUNCTION__,
|
||||
region->data->numRects, region->data->size,
|
||||
x1, y1, x2, y2));
|
||||
|
||||
if (x1 < region->extents.x1)
|
||||
region->extents.x1 = x1;
|
||||
if (x2 > region->extents.x2)
|
||||
|
|
@ -138,5 +143,11 @@ fbBitmapToRegion(PixmapPtr pixmap)
|
|||
} else
|
||||
region->extents.x1 = region->extents.x2 = 0;
|
||||
|
||||
DBG(("%s: region extents=(%d, %d), (%d, %d) x %d\n",
|
||||
__FUNCTION__,
|
||||
region->extents.x1, region->extents.y1,
|
||||
region->extents.x2, region->extents.y2,
|
||||
RegionNumRects(region)));
|
||||
|
||||
return region;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -285,7 +285,10 @@ fbBlt(FbBits *srcLine, FbStride srcStride, int srcX,
|
|||
s += srcX >> 3;
|
||||
d += dstX >> 3;
|
||||
|
||||
DBG(("%s fast blt\n", __FUNCTION__));
|
||||
DBG(("%s fast blt, src_stride=%d, dst_stride=%d, width=%d (offset=%d)\n",
|
||||
__FUNCTION__,
|
||||
srcStride, dstStride, width,
|
||||
srcLine - dstLine));
|
||||
|
||||
if ((srcLine < dstLine && srcLine + width > dstLine) ||
|
||||
(dstLine < srcLine && dstLine + width > srcLine))
|
||||
|
|
|
|||
|
|
@ -76,11 +76,16 @@ fbClipBoxes(const RegionRec *region, const BoxRec *box, const BoxRec **end)
|
|||
c0 = (const BoxRec *)region->data + 1;
|
||||
c1 = c0 + region->data->numRects;
|
||||
|
||||
if (c0->y2 <= box->y1)
|
||||
if (c0->y2 <= box->y1) {
|
||||
DBG(("%s: first clip (%d, %d), (%d, %d) before box (%d, %d), (%d, %d)\n",
|
||||
__FUNCTION__,
|
||||
c0->x1, c0->y1, c0->x2, c0->y2,
|
||||
box->x1, box->y1, box->x2, box->y2));
|
||||
c0 = find_clip_row_for_y(c0, c1, box->y1);
|
||||
}
|
||||
|
||||
DBG(("%s: c0=(%d, %d),(%d, %d)\n",
|
||||
__FUNCTION__, c0->x1, c0->y1, c0->x2, c0->y2));
|
||||
DBG(("%s: c0=(%d, %d),(%d, %d) x %ld\n",
|
||||
__FUNCTION__, c0->x1, c0->y1, c0->x2, c0->y2, c1 - c0));
|
||||
|
||||
*end = c1;
|
||||
return c0;
|
||||
|
|
|
|||
|
|
@ -46,6 +46,13 @@ box_intersect(BoxPtr a, const BoxRec *b)
|
|||
return a->x1 < a->x2 && a->y1 < a->y2;
|
||||
}
|
||||
|
||||
#define run_box(b, c) \
|
||||
DBG(("%s: box=(%d, %d), (%d, %d), clip=(%d, %d), (%d, %d)\n", \
|
||||
__FUNCTION__, (b)->x1, (b)->y1, (b)->x2, (b)->y2, (c)->x1, (c)->y1, (c)->x2, (c)->y2)); \
|
||||
if ((b)->y2 <= (c)->y1) break; \
|
||||
if ((b)->x1 >= (c)->x2) continue; \
|
||||
if ((b)->x2 <= (c)->x1) { if ((b)->y2 <= (c)->y2) break; continue; }
|
||||
|
||||
static inline void
|
||||
fbDrawableRun(DrawablePtr d, GCPtr gc, const BoxRec *box,
|
||||
void (*func)(DrawablePtr, GCPtr, const BoxRec *b, void *data),
|
||||
|
|
@ -55,14 +62,7 @@ fbDrawableRun(DrawablePtr d, GCPtr gc, const BoxRec *box,
|
|||
for (c = fbClipBoxes(gc->pCompositeClip, box, &end); c != end; c++) {
|
||||
BoxRec b;
|
||||
|
||||
if (box->x1 >= c->x2)
|
||||
continue;
|
||||
if (box->x2 <= c->x1) {
|
||||
if (box->y2 <= c->y2)
|
||||
break;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
run_box(box, c);
|
||||
|
||||
b = *box;
|
||||
if (box_intersect(&b, c))
|
||||
|
|
@ -77,14 +77,7 @@ fbDrawableRunUnclipped(DrawablePtr d, GCPtr gc, const BoxRec *box,
|
|||
{
|
||||
const BoxRec *c, *end;
|
||||
for (c = fbClipBoxes(gc->pCompositeClip, box, &end); c != end; c++) {
|
||||
if (box->x1 >= c->x2)
|
||||
continue;
|
||||
if (box->x2 <= c->x1) {
|
||||
if (box->y2 <= c->y2)
|
||||
break;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
run_box(box, c);
|
||||
func(d, gc, c, data);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,28 +141,14 @@ fbFill(DrawablePtr drawable, GCPtr gc, int x, int y, int width, int height)
|
|||
|
||||
case FillTiled:
|
||||
{
|
||||
PixmapPtr pTile = gc->tile.pixmap;
|
||||
FbBits *tile;
|
||||
FbStride tileStride;
|
||||
int tileBpp;
|
||||
int tileWidth;
|
||||
int tileHeight;
|
||||
_X_UNUSED int tileXoff, tileYoff;
|
||||
PixmapPtr tile = gc->tile.pixmap;
|
||||
|
||||
fbGetDrawable(&pTile->drawable, tile,
|
||||
tileStride, tileBpp, tileXoff, tileYoff);
|
||||
tileWidth = pTile->drawable.width;
|
||||
tileHeight = pTile->drawable.height;
|
||||
fbTile(dst + (y + dstYoff) * dstStride,
|
||||
dstStride,
|
||||
(x + dstXoff) * dstBpp,
|
||||
width * dstBpp, height,
|
||||
tile,
|
||||
tileStride,
|
||||
tileWidth * tileBpp,
|
||||
tileHeight,
|
||||
gc->alu, pgc->pm,
|
||||
dstBpp,
|
||||
fbTile(dst + (y + dstYoff) * dstStride, dstStride,
|
||||
(x + dstXoff) * dstBpp, width * dstBpp, height,
|
||||
tile->devPrivate.ptr, tile->devKind / sizeof(FbBits),
|
||||
tile->drawable.width * tile->drawable.bitsPerPixel,
|
||||
tile->drawable.height,
|
||||
gc->alu, pgc->pm, dstBpp,
|
||||
(gc->patOrg.x + drawable->x + dstXoff) * dstBpp,
|
||||
gc->patOrg.y + drawable->y - y);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -99,30 +99,29 @@ fbOddTile(FbBits *dst, FbStride dstStride, int dstX,
|
|||
int xRot, int yRot)
|
||||
{
|
||||
int tileX, tileY;
|
||||
int widthTmp;
|
||||
int h, w;
|
||||
int x, y;
|
||||
|
||||
DBG(("%s tile=%dx%d, size=%dx%d\n", __FUNCTION__,
|
||||
tileWidth, tileHeight, width, height));
|
||||
|
||||
modulus(-yRot, tileHeight, tileY);
|
||||
y = 0;
|
||||
while (height) {
|
||||
h = tileHeight - tileY;
|
||||
int ww = width;
|
||||
int h = tileHeight - tileY;
|
||||
if (h > height)
|
||||
h = height;
|
||||
height -= h;
|
||||
widthTmp = width;
|
||||
x = dstX;
|
||||
modulus(dstX - xRot, tileWidth, tileX);
|
||||
while (widthTmp) {
|
||||
w = tileWidth - tileX;
|
||||
if (w > widthTmp)
|
||||
w = widthTmp;
|
||||
widthTmp -= w;
|
||||
fbBlt(tile + tileY * tileStride,
|
||||
tileStride,
|
||||
tileX,
|
||||
dst + y * dstStride,
|
||||
dstStride, x, w, h, alu, pm, bpp, FALSE, FALSE);
|
||||
while (ww) {
|
||||
int w = tileWidth - tileX;
|
||||
if (w > ww)
|
||||
w = ww;
|
||||
ww -= w;
|
||||
fbBlt(tile + tileY * tileStride, tileStride, tileX,
|
||||
dst + y * dstStride, dstStride,
|
||||
x, w, h, alu, pm, bpp, FALSE, FALSE);
|
||||
x += w;
|
||||
tileX = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue