sna: Silence compiler warnings for discarding const Region points

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2014-06-11 09:29:50 +01:00
parent 085141348c
commit eb9de37daa
25 changed files with 317 additions and 297 deletions

View File

@ -107,6 +107,30 @@
#endif
static inline int
region_num_rects(const RegionRec *r)
{
return r->data ? r->data->numRects : 1;
}
static inline int
region_nil(const RegionRec *r)
{
return region_num_rects(r) == 0;
}
static inline BoxPtr
region_boxptr(const RegionRec *r)
{
return (BoxPtr)(r->data + 1);
}
static inline BoxPtr
region_rects(const RegionRec *r)
{
return r->data ? region_boxptr(r) : (BoxPtr)&r->extents;
}
#ifndef INCLUDE_LEGACY_REGION_DEFINES
#define RegionCreate(r, s) REGION_CREATE(NULL, r, s)
#define RegionBreak(r) REGION_BREAK(NULL, r)

View File

@ -178,11 +178,11 @@ fbBitmapToRegion(PixmapPtr pixmap)
} else
region->extents.x1 = region->extents.x2 = 0;
DBG(("%s: region extents=(%d, %d), (%d, %d) x %ld\n",
DBG(("%s: region extents=(%d, %d), (%d, %d) x %d\n",
__FUNCTION__,
region->extents.x1, region->extents.y1,
region->extents.x2, region->extents.y2,
(long)RegionNumRects(region)));
region_num_rects(region)));
return region;
}

View File

@ -30,8 +30,8 @@ POLYLINE(DrawablePtr drawable, GCPtr gc, int mode, int n_0, DDXPointPtr pt_0)
int xoff = drawable->x;
int yoff = drawable->y;
unsigned int bias = miGetZeroLineBias(drawable->pScreen);
const BoxRec *clip = RegionRects(gc->pCompositeClip);
const BoxRec *const last_clip = clip + RegionNumRects(gc->pCompositeClip);
const BoxRec *clip = region_rects(gc->pCompositeClip);
const BoxRec *const last_clip = clip + region_num_rects(gc->pCompositeClip);
FbBits *dst;
int dstStride;
@ -148,8 +148,8 @@ POLYSEGMENT(DrawablePtr drawable, GCPtr gc, int n_0, xSegment *seg_0)
int xoff = drawable->x;
int yoff = drawable->y;
unsigned int bias = miGetZeroLineBias(drawable->pScreen);
const BoxRec *clip = RegionRects(gc->pCompositeClip);
const BoxRec *const last_clip = clip + RegionNumRects(gc->pCompositeClip);
const BoxRec *clip = region_rects(gc->pCompositeClip);
const BoxRec *const last_clip = clip + region_num_rects(gc->pCompositeClip);
FbBits *dst;
int dstStride;

View File

@ -93,10 +93,10 @@ fbPolyPoint(DrawablePtr drawable, GCPtr gc,
int xoff, int yoff,
FbBits and, FbBits xor);
DBG(("%s x %d, clip=[(%d, %d), (%d, %d)]x%ld\n", __FUNCTION__, n,
DBG(("%s x %d, clip=[(%d, %d), (%d, %d)]x%d\n", __FUNCTION__, n,
gc->pCompositeClip->extents.x1, gc->pCompositeClip->extents.y1,
gc->pCompositeClip->extents.x2, gc->pCompositeClip->extents.y2,
(long)RegionNumRects(gc->pCompositeClip)));
region_num_rects(gc->pCompositeClip)));
if (mode == CoordModePrevious)
fbFixCoordModePrevious(n, pt);

View File

@ -5382,8 +5382,8 @@ gen3_render_video(struct sna *sna,
PixmapPtr pixmap)
{
struct sna_pixmap *priv = sna_pixmap(pixmap);
BoxPtr pbox = REGION_RECTS(dstRegion);
int nbox = REGION_NUM_RECTS(dstRegion);
BoxPtr pbox = region_rects(dstRegion);
int nbox = region_num_rects(dstRegion);
int dst_width = dstRegion->extents.x2 - dstRegion->extents.x1;
int dst_height = dstRegion->extents.y2 - dstRegion->extents.y1;
int src_width = frame->src.x2 - frame->src.x1;
@ -5508,8 +5508,8 @@ gen3_render_video(struct sna *sna,
dst_bo, -dstRegion->extents.x1, -dstRegion->extents.y1,
priv->gpu_bo, pix_xoff, pix_yoff,
pixmap->drawable.bitsPerPixel,
REGION_RECTS(dstRegion),
REGION_NUM_RECTS(dstRegion));
region_rects(dstRegion),
region_num_rects(dstRegion));
kgem_bo_destroy(&sna->kgem, dst_bo);
}
@ -5520,12 +5520,12 @@ gen3_render_video(struct sna *sna,
sna_damage_subtract(&priv->cpu_damage, dstRegion);
} else {
sna_damage_add_boxes(&priv->gpu_damage,
REGION_RECTS(dstRegion),
REGION_NUM_RECTS(dstRegion),
region_rects(dstRegion),
region_num_rects(dstRegion),
pix_xoff, pix_yoff);
sna_damage_subtract_boxes(&priv->cpu_damage,
REGION_RECTS(dstRegion),
REGION_NUM_RECTS(dstRegion),
region_rects(dstRegion),
region_num_rects(dstRegion),
pix_xoff, pix_yoff);
}
}

View File

@ -1462,8 +1462,8 @@ gen4_render_video(struct sna *sna,
src_scale_y = (float)src_height / dst_height / frame->height;
src_offset_y = (float)frame->src.y1 / frame->height - dstRegion->extents.y1 * src_scale_y;
box = REGION_RECTS(dstRegion);
nbox = REGION_NUM_RECTS(dstRegion);
box = region_rects(dstRegion);
nbox = region_num_rects(dstRegion);
do {
int n;

View File

@ -1412,8 +1412,8 @@ gen5_render_video(struct sna *sna,
src_scale_y = (float)src_height / dst_height / frame->height;
src_offset_y = (float)frame->src.y1 / frame->height - dstRegion->extents.y1 * src_scale_y;
box = REGION_RECTS(dstRegion);
nbox = REGION_NUM_RECTS(dstRegion);
box = region_rects(dstRegion);
nbox = region_num_rects(dstRegion);
while (nbox--) {
BoxRec r;

View File

@ -1596,10 +1596,10 @@ gen6_render_video(struct sna *sna,
unsigned filter;
BoxPtr box;
DBG(("%s: src=(%d, %d), dst=(%d, %d), %ldx[(%d, %d), (%d, %d)...]\n",
DBG(("%s: src=(%d, %d), dst=(%d, %d), %dx[(%d, %d), (%d, %d)...]\n",
__FUNCTION__,
src_width, src_height, dst_width, dst_height,
(long)REGION_NUM_RECTS(dstRegion),
region_num_rects(dstRegion),
REGION_EXTENTS(NULL, dstRegion)->x1,
REGION_EXTENTS(NULL, dstRegion)->y1,
REGION_EXTENTS(NULL, dstRegion)->x2,
@ -1662,8 +1662,8 @@ gen6_render_video(struct sna *sna,
src_scale_y = (float)src_height / dst_height / frame->height;
src_offset_y = (float)frame->src.y1 / frame->height - dstRegion->extents.y1 * src_scale_y;
box = REGION_RECTS(dstRegion);
nbox = REGION_NUM_RECTS(dstRegion);
box = region_rects(dstRegion);
nbox = region_num_rects(dstRegion);
while (nbox--) {
BoxRec r;

View File

@ -1838,10 +1838,10 @@ gen7_render_video(struct sna *sna,
unsigned filter;
BoxPtr box;
DBG(("%s: src=(%d, %d), dst=(%d, %d), %ldx[(%d, %d), (%d, %d)...]\n",
DBG(("%s: src=(%d, %d), dst=(%d, %d), %dx[(%d, %d), (%d, %d)...]\n",
__FUNCTION__,
src_width, src_height, dst_width, dst_height,
(long)REGION_NUM_RECTS(dstRegion),
region_num_rects(dstRegion),
REGION_EXTENTS(NULL, dstRegion)->x1,
REGION_EXTENTS(NULL, dstRegion)->y1,
REGION_EXTENTS(NULL, dstRegion)->x2,
@ -1918,8 +1918,8 @@ gen7_render_video(struct sna *sna,
src_scale_x, src_scale_y,
src_offset_x, src_offset_y));
box = REGION_RECTS(dstRegion);
nbox = REGION_NUM_RECTS(dstRegion);
box = region_rects(dstRegion);
nbox = region_num_rects(dstRegion);
while (nbox--) {
BoxRec r;

View File

@ -3663,10 +3663,10 @@ gen8_render_video(struct sna *sna,
unsigned filter;
BoxPtr box;
DBG(("%s: src=(%d, %d), dst=(%d, %d), %ldx[(%d, %d), (%d, %d)...]\n",
DBG(("%s: src=(%d, %d), dst=(%d, %d), %dx[(%d, %d), (%d, %d)...]\n",
__FUNCTION__,
src_width, src_height, dst_width, dst_height,
(long)REGION_NUM_RECTS(dstRegion),
region_num_rects(dstRegion),
REGION_EXTENTS(NULL, dstRegion)->x1,
REGION_EXTENTS(NULL, dstRegion)->y1,
REGION_EXTENTS(NULL, dstRegion)->x2,
@ -3741,8 +3741,8 @@ gen8_render_video(struct sna *sna,
src_scale_x, src_scale_y,
src_offset_x, src_offset_y));
box = REGION_RECTS(dstRegion);
nbox = REGION_NUM_RECTS(dstRegion);
box = region_rects(dstRegion);
nbox = region_num_rects(dstRegion);
while (nbox--) {
BoxRec r;

View File

@ -1134,9 +1134,9 @@ inline static bool is_power_of_two(unsigned x)
inline static bool is_clipped(const RegionRec *r,
const DrawableRec *d)
{
DBG(("%s: region[%ld]x(%d, %d),(%d, %d) against drawable %dx%d\n",
DBG(("%s: region[%d]x(%d, %d),(%d, %d) against drawable %dx%d\n",
__FUNCTION__,
(long)RegionNumRects(r),
region_num_rects(r),
r->extents.x1, r->extents.y1,
r->extents.x2, r->extents.y2,
d->width, d->height));

View File

@ -2789,8 +2789,8 @@ move_to_cpu:
}
if (priv->clear) {
int n = RegionNumRects(region);
BoxPtr box = RegionRects(region);
int n = region_num_rects(region);
BoxPtr box = region_rects(region);
assert(DAMAGE_IS_ALL(priv->gpu_damage));
assert(priv->cpu_damage == NULL);
@ -2877,13 +2877,13 @@ move_to_cpu:
* reads.
*/
if (flags & MOVE_WRITE) {
int n = RegionNumRects(region), i;
BoxPtr boxes = RegionRects(region);
int n = region_num_rects(region), i;
BoxPtr boxes = region_rects(region);
BoxPtr blocks;
blocks = NULL;
if (priv->cpu_damage == NULL)
blocks = malloc(sizeof(BoxRec) * RegionNumRects(region));
blocks = malloc(sizeof(BoxRec) * n);
if (blocks) {
for (i = 0; i < n; i++) {
blocks[i].x1 = boxes[i].x1 & ~31;
@ -2931,8 +2931,8 @@ move_to_cpu:
assert(sna_damage_contains_box(priv->cpu_damage, &r->extents) == PIXMAN_REGION_OUT);
download_boxes(sna, priv,
RegionNumRects(r),
RegionRects(r));
region_num_rects(r),
region_rects(r));
sna_damage_subtract(&priv->gpu_damage, r);
} else {
RegionRec need;
@ -2943,8 +2943,8 @@ move_to_cpu:
__FUNCTION__));
download_boxes(sna, priv,
RegionNumRects(&need),
RegionRects(&need));
region_num_rects(&need),
region_rects(&need));
sna_damage_subtract(&priv->gpu_damage, r);
RegionUninit(&need);
}
@ -3271,43 +3271,41 @@ sna_pixmap_move_area_to_gpu(PixmapPtr pixmap, const BoxRec *box, unsigned int fl
assert(priv->cpu_damage);
region_set(&r, box);
if (MIGRATE_ALL || region_subsumes_damage(&r, priv->cpu_damage)) {
bool ok = false;
int n;
n = sna_damage_get_boxes(priv->cpu_damage, (BoxPtr *)&box);
if (n) {
bool ok = false;
assert(n);
if (use_cpu_bo_for_upload(sna, priv, 0)) {
DBG(("%s: using CPU bo for upload to GPU\n", __FUNCTION__));
ok = sna->render.copy_boxes(sna, GXcopy,
pixmap, priv->cpu_bo, 0, 0,
pixmap, priv->gpu_bo, 0, 0,
box, n, 0);
}
if (!ok) {
sna_pixmap_unmap(pixmap, priv);
if (pixmap->devPrivate.ptr == NULL)
return NULL;
if (use_cpu_bo_for_upload(sna, priv, 0)) {
DBG(("%s: using CPU bo for upload to GPU\n", __FUNCTION__));
ok = sna->render.copy_boxes(sna, GXcopy,
pixmap, priv->cpu_bo, 0, 0,
pixmap, priv->gpu_bo, 0, 0,
box, n, 0);
}
if (!ok) {
sna_pixmap_unmap(pixmap, priv);
if (pixmap->devPrivate.ptr == NULL)
return NULL;
assert(pixmap->devKind);
if (n == 1 && !priv->pinned &&
box->x1 <= 0 && box->y1 <= 0 &&
box->x2 >= pixmap->drawable.width &&
box->y2 >= pixmap->drawable.height) {
ok = sna_replace(sna, pixmap,
pixmap->devPrivate.ptr,
pixmap->devKind);
} else {
ok = sna_write_boxes(sna, pixmap,
priv->gpu_bo, 0, 0,
pixmap->devPrivate.ptr,
pixmap->devKind,
0, 0,
box, n);
}
if (!ok)
return NULL;
assert(pixmap->devKind);
if (n == 1 && !priv->pinned &&
box->x1 <= 0 && box->y1 <= 0 &&
box->x2 >= pixmap->drawable.width &&
box->y2 >= pixmap->drawable.height) {
ok = sna_replace(sna, pixmap,
pixmap->devPrivate.ptr,
pixmap->devKind);
} else {
ok = sna_write_boxes(sna, pixmap,
priv->gpu_bo, 0, 0,
pixmap->devPrivate.ptr,
pixmap->devKind,
0, 0,
box, n);
}
if (!ok)
return NULL;
}
sna_damage_destroy(&priv->cpu_damage);
@ -3342,10 +3340,10 @@ sna_pixmap_move_area_to_gpu(PixmapPtr pixmap, const BoxRec *box, unsigned int fl
sna_damage_subtract(&priv->cpu_damage, &r);
} else if (sna_damage_intersect(priv->cpu_damage, &r, &i)) {
int n = RegionNumRects(&i);
int n = region_num_rects(&i);
bool ok;
box = RegionRects(&i);
box = region_rects(&i);
ok = false;
if (use_cpu_bo_for_upload(sna, priv, 0)) {
DBG(("%s: using CPU bo for upload to GPU, %d boxes\n", __FUNCTION__, n));
@ -4070,6 +4068,7 @@ sna_pixmap_move_to_gpu(PixmapPtr pixmap, unsigned flags)
}
n = sna_damage_get_boxes(priv->cpu_damage, &box);
assert(n);
if (n) {
bool ok;
@ -4462,15 +4461,15 @@ try_upload_blt(PixmapPtr pixmap, RegionRec *region,
src_bo->pitch = stride;
kgem_bo_mark_unreusable(src_bo);
DBG(("%s: upload(%d, %d, %d, %d) x %ld through a temporary map\n",
__FUNCTION__, x, y, w, h, (long)RegionNumRects(region)));
DBG(("%s: upload(%d, %d, %d, %d) x %d through a temporary map\n",
__FUNCTION__, x, y, w, h, region_num_rects(region)));
if (sigtrap_get() == 0) {
ok = sna->render.copy_boxes(sna, GXcopy,
pixmap, src_bo, -x, -y,
pixmap, priv->gpu_bo, 0, 0,
RegionRects(region),
RegionNumRects(region),
region_rects(region),
region_num_rects(region),
COPY_LAST);
sigtrap_put();
} else
@ -4607,8 +4606,8 @@ try_upload_tiled_x(PixmapPtr pixmap, RegionRec *region,
kgem_bo_sync__cpu(&sna->kgem, priv->gpu_bo);
box = RegionRects(region);
n = RegionNumRects(region);
box = region_rects(region);
n = region_num_rects(region);
DBG(("%s: upload(%d, %d, %d, %d) x %d\n", __FUNCTION__, x, y, w, h, n));
@ -4753,8 +4752,8 @@ sna_put_zpixmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
return false;
/* Region is pre-clipped and translated into pixmap space */
box = RegionRects(region);
n = RegionNumRects(region);
box = region_rects(region);
n = region_num_rects(region);
DBG(("%s: upload(%d, %d, %d, %d) x %d boxes\n", __FUNCTION__, x, y, w, h, n));
do {
DBG(("%s: copy box (%d, %d)->(%d, %d)x(%d, %d)\n",
@ -4850,8 +4849,8 @@ sna_put_xybitmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
kgem_set_mode(&sna->kgem, KGEM_BLT, bo);
/* Region is pre-clipped and translated into pixmap space */
box = RegionRects(region);
n = RegionNumRects(region);
box = region_rects(region);
n = region_num_rects(region);
do {
int bx1 = (box->x1 - x) & ~7;
int bx2 = (box->x2 - x + 7) & ~7;
@ -5011,8 +5010,8 @@ sna_put_xypixmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
skip = h * BitmapBytePad(w + left);
for (i = 1 << (gc->depth-1); i; i >>= 1, bits += skip) {
const BoxRec *box = RegionRects(region);
int n = RegionNumRects(region);
const BoxRec *box = region_rects(region);
int n = region_num_rects(region);
if ((gc->planemask & i) == 0)
continue;
@ -5407,14 +5406,14 @@ sna_self_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
PixmapPtr pixmap = get_drawable_pixmap(src);
struct sna *sna = to_sna_from_pixmap(pixmap);
struct sna_pixmap *priv = sna_pixmap(pixmap);
BoxPtr box = RegionRects(region);
int n = RegionNumRects(region);
BoxPtr box = region_rects(region);
int n = region_num_rects(region);
int alu = gc ? gc->alu : GXcopy;
int16_t tx, ty;
assert(pixmap == get_drawable_pixmap(dst));
assert(RegionNumRects(region));
assert(region_num_rects(region));
if (((dx | dy) == 0 && alu == GXcopy))
return;
@ -5517,7 +5516,7 @@ out:
}
free_boxes:
if (box != RegionRects(region))
if (box != region_rects(region))
free(box);
}
@ -5717,8 +5716,8 @@ sna_copy_boxes__inplace(struct sna *sna, RegionPtr region, int alu,
kgem_bo_sync__cpu_full(&sna->kgem, src_priv->gpu_bo, FORCE_FULL_SYNC);
box = RegionRects(region);
n = RegionNumRects(region);
box = region_rects(region);
n = region_num_rects(region);
if (src_priv->gpu_bo->tiling) {
DBG(("%s: copy from a tiled CPU map\n", __FUNCTION__));
assert(dst_pixmap->devKind);
@ -5841,8 +5840,8 @@ upload_inplace:
}
dst_priv->clear = false;
box = RegionRects(region);
n = RegionNumRects(region);
box = region_rects(region);
n = region_num_rects(region);
if (dst_priv->gpu_bo->tiling) {
DBG(("%s: copy to a tiled CPU map\n", __FUNCTION__));
assert(dst_priv->gpu_bo->tiling == I915_TILING_X);
@ -5917,14 +5916,14 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
struct kgem_bo *bo;
int16_t src_dx, src_dy;
int16_t dst_dx, dst_dy;
BoxPtr box = RegionRects(region);
int n = RegionNumRects(region);
BoxPtr box = region_rects(region);
int n = region_num_rects(region);
int alu = gc->alu;
int stride, bpp;
char *bits;
bool replaces;
assert(RegionNumRects(region));
assert(region_num_rects(region));
if (src_pixmap == dst_pixmap)
return sna_self_copy_boxes(src, dst, gc,
@ -6607,18 +6606,18 @@ sna_do_copy(DrawablePtr src, DrawablePtr dst, GCPtr gc,
} else
RegionIntersect(&region, &region, clip);
}
DBG(("%s: src extents (%d, %d), (%d, %d) x %ld\n", __FUNCTION__,
DBG(("%s: src extents (%d, %d), (%d, %d) x %d\n", __FUNCTION__,
region.extents.x1, region.extents.y1,
region.extents.x2, region.extents.y2,
(long)RegionNumRects(&region)));
region_num_rects(&region)));
RegionTranslate(&region, dx-sx, dy-sy);
if (gc->pCompositeClip->data)
RegionIntersect(&region, &region, gc->pCompositeClip);
DBG(("%s: copy region (%d, %d), (%d, %d) x %ld\n", __FUNCTION__,
DBG(("%s: copy region (%d, %d), (%d, %d) x %d\n", __FUNCTION__,
region.extents.x1, region.extents.y1,
region.extents.x2, region.extents.y2,
(long)RegionNumRects(&region)));
region_num_rects(&region)));
if (!box_empty(&region.extents))
copy(src, dst, gc, &region, sx-dx, sy-dy, bitPlane, closure);
@ -6641,8 +6640,8 @@ sna_fallback_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
RegionPtr region, int dx, int dy,
Pixel bitplane, void *closure)
{
DBG(("%s (boxes=%ldx[(%d, %d), (%d, %d)...], src=+(%d, %d), alu=%d\n",
__FUNCTION__, (long)RegionNumRects(region),
DBG(("%s (boxes=%dx[(%d, %d), (%d, %d)...], src=+(%d, %d), alu=%d\n",
__FUNCTION__, region_num_rects(region),
region->extents.x1, region->extents.y1,
region->extents.x2, region->extents.y2,
dx, dy, gc->alu));
@ -7272,9 +7271,9 @@ no_damage_clipped:
assert(dx + clip.extents.x2 <= pixmap->drawable.width);
assert(dy + clip.extents.y2 <= pixmap->drawable.height);
DBG(("%s: clip %ld x [(%d, %d), (%d, %d)] x %d [(%d, %d)...]\n",
DBG(("%s: clip %d x [(%d, %d), (%d, %d)] x %d [(%d, %d)...]\n",
__FUNCTION__,
(long)RegionNumRects(&clip),
region_num_rects(&clip),
clip.extents.x1, clip.extents.y1, clip.extents.x2, clip.extents.y2,
n, pt->x, pt->y));
@ -7372,9 +7371,9 @@ damage_clipped:
assert(dx + clip.extents.x2 <= pixmap->drawable.width);
assert(dy + clip.extents.y2 <= pixmap->drawable.height);
DBG(("%s: clip %ld x [(%d, %d), (%d, %d)] x %d [(%d, %d)...]\n",
DBG(("%s: clip %d x [(%d, %d), (%d, %d)] x %d [(%d, %d)...]\n",
__FUNCTION__,
(long)RegionNumRects(&clip),
region_num_rects(&clip),
clip.extents.x1, clip.extents.y1, clip.extents.x2, clip.extents.y2,
n, pt->x, pt->y));
@ -7775,14 +7774,14 @@ sna_copy_bitmap_blt(DrawablePtr _bitmap, DrawablePtr drawable, GCPtr gc,
BoxPtr box;
int n;
DBG(("%s: plane=%x (%d,%d),(%d,%d)x%ld\n",
DBG(("%s: plane=%x (%d,%d),(%d,%d)xld\n",
__FUNCTION__, (unsigned)bitplane,
region->extents.x1, region->extents.y1,
region->extents.x2, region->extents.y2,
(long)RegionNumRects(region)));
region_num_rects(region)));
box = RegionRects(region);
n = RegionNumRects(region);
box = region_rects(region);
n = region_num_rects(region);
assert(n);
get_drawable_deltas(drawable, pixmap, &dx, &dy);
@ -7995,8 +7994,8 @@ sna_copy_plane_blt(DrawablePtr source, DrawablePtr drawable, GCPtr gc,
int16_t dx, dy;
int bit = ffs(bitplane) - 1;
uint32_t br00, br13;
BoxPtr box = RegionRects(region);
int n = RegionNumRects(region);
BoxPtr box = region_rects(region);
int n = region_num_rects(region);
DBG(("%s: plane=%x [%d] x%d\n", __FUNCTION__,
(unsigned)bitplane, bit, n));
@ -8620,8 +8619,8 @@ sna_poly_zero_line_blt(DrawablePtr drawable,
clip.extents.x2, clip.extents.y2,
dx, dy, damage));
extents = RegionRects(&clip);
last_extents = extents + RegionNumRects(&clip);
extents = region_rects(&clip);
last_extents = extents + region_num_rects(&clip);
b = box;
do {
@ -9857,8 +9856,8 @@ sna_poly_zero_segment_blt(DrawablePtr drawable,
jump = _jump[(damage != NULL) | !!(dx|dy) << 1];
b = box;
extents = RegionRects(&clip);
last_extents = extents + RegionNumRects(&clip);
extents = region_rects(&clip);
last_extents = extents + region_num_rects(&clip);
do {
int n = _n;
const xSegment *s = _s;
@ -11067,8 +11066,8 @@ sna_poly_rectangle(DrawablePtr drawable, GCPtr gc, int n, xRectangle *r)
}
fallback:
DBG(("%s: fallback, clip=%ldx[(%d, %d), (%d, %d)]\n", __FUNCTION__,
(long)RegionNumRects(gc->pCompositeClip),
DBG(("%s: fallback, clip=%dx[(%d, %d), (%d, %d)]\n", __FUNCTION__,
region_num_rects(gc->pCompositeClip),
gc->pCompositeClip->extents.x1, gc->pCompositeClip->extents.y1,
gc->pCompositeClip->extents.x2, gc->pCompositeClip->extents.y2));
@ -11076,8 +11075,8 @@ fallback:
if (!region_maybe_clip(&region, gc->pCompositeClip))
return;
DBG(("%s: CPU region=%ldx[(%d, %d), (%d, %d)]\n", __FUNCTION__,
(long)RegionNumRects(&region),
DBG(("%s: CPU region=%dx[(%d, %d), (%d, %d)]\n", __FUNCTION__,
region_num_rects(&region),
region.extents.x1, region.extents.y1,
region.extents.x2, region.extents.y2));
if (!sna_gc_move_to_cpu(gc, drawable, &region))
@ -12406,8 +12405,8 @@ sna_poly_fill_rect_tiled_blt(DrawablePtr drawable,
assert(region.extents.x2 + dx <= pixmap->drawable.width);
assert(region.extents.y2 + dy <= pixmap->drawable.height);
nbox = RegionNumRects(&region);
box = RegionRects(&region);
nbox = region_num_rects(&region);
box = region_rects(&region);
DBG(("%s: split into %d boxes after clipping\n", __FUNCTION__, nbox));
while (nbox--) {
int height = box->y2 - box->y1;
@ -14653,8 +14652,8 @@ sna_glyph_blt(DrawablePtr drawable, GCPtr gc,
_x += drawable->x + dx;
_y += drawable->y + dy;
extents = RegionRects(clip);
last_extents = extents + RegionNumRects(clip);
extents = region_rects(clip);
last_extents = extents + region_num_rects(clip);
if (!transparent) { /* emulate miImageGlyphBlt */
if (!sna_blt_fill_boxes(sna, GXcopy,
@ -15370,8 +15369,8 @@ sna_reversed_glyph_blt(DrawablePtr drawable, GCPtr gc,
_x += drawable->x + dx;
_y += drawable->y + dy;
extents = RegionRects(clip);
last_extents = extents + RegionNumRects(clip);
extents = region_rects(clip);
last_extents = extents + region_num_rects(clip);
if (!transparent) { /* emulate miImageGlyphBlt */
if (!sna_blt_fill_boxes(sna, GXcopy,
@ -15839,8 +15838,8 @@ sna_push_pixels_solid_blt(GCPtr gc,
kgem_set_mode(&sna->kgem, KGEM_BLT, bo);
/* Region is pre-clipped and translated into pixmap space */
box = RegionRects(region);
n = RegionNumRects(region);
box = region_rects(region);
n = region_num_rects(region);
do {
int bx1 = (box->x1 - region->extents.x1) & ~7;
int bx2 = (box->x2 - region->extents.x1 + 7) & ~7;
@ -16094,9 +16093,9 @@ sna_validate_gc(GCPtr gc, unsigned long changes, DrawablePtr drawable)
(gc->clientClipType != CT_NONE && (changes & (GCClipXOrigin | GCClipYOrigin)))) {
DBG(("%s: recomputing clip\n", __FUNCTION__));
miComputeCompositeClip(gc, drawable);
DBG(("%s: composite clip=%ldx[(%d, %d), (%d, %d)] [%p]\n",
DBG(("%s: composite clip=%dx[(%d, %d), (%d, %d)] [%p]\n",
__FUNCTION__,
(long)RegionNumRects(gc->pCompositeClip),
region_num_rects(gc->pCompositeClip),
gc->pCompositeClip->extents.x1,
gc->pCompositeClip->extents.y1,
gc->pCompositeClip->extents.x2,
@ -16770,10 +16769,10 @@ static void sna_accel_post_damage(struct sna *sna)
region.extents.y2 = dirty->y + dst->drawable.height;
region.data = NULL;
DBG(("%s: pushing damage ((%d, %d), (%d, %d))x%d to slave pixmap=%ld, ((%d, %d), (%d, %d))\n", __FUNCTION__,
DBG(("%s: pushing damage ((%d, %d), (%d, %d))x%d to slave pixmap=%d, ((%d, %d), (%d, %d))\n", __FUNCTION__,
damage->extents.x1, damage->extents.y1,
damage->extents.x2, damage->extents.y2,
RegionNumRects(damage),
region_num_rects(damage),
dst->drawable.serialNumber,
region.extents.x1, region.extents.y1,
region.extents.x2, region.extents.y2));
@ -16788,10 +16787,10 @@ static void sna_accel_post_damage(struct sna *sna)
DBG(("%s: slave: ((%d, %d), (%d, %d))x%d\n", __FUNCTION__,
region.extents.x1, region.extents.y1,
region.extents.x2, region.extents.y2,
RegionNumRects(&region)));
region_num_rects(&region)));
box = RegionRects(&region);
n = RegionNumRects(&region);
box = region_rects(&region);
n = region_num_rects(&region);
if (wedged(sna)) {
fallback:
if (!sna_pixmap_move_to_cpu(src, MOVE_READ))

View File

@ -404,7 +404,7 @@ static void _assert_pixmap_contains_box(PixmapPtr pixmap, BoxPtr box, const char
static void apply_damage(struct sna_composite_op *op, RegionPtr region)
{
DBG(("%s: damage=%p, region=%d [(%d, %d), (%d, %d) + (%d, %d)]\n",
__FUNCTION__, op->damage, (int)RegionNumRects(region),
__FUNCTION__, op->damage, region_num_rects(region),
region->extents.x1, region->extents.y1,
region->extents.x2, region->extents.y2,
op->dst.x, op->dst.y));
@ -546,8 +546,8 @@ sna_composite_fb(CARD8 op,
region->extents.x2 + sx <= src->pDrawable->width &&
region->extents.y2 + sy <= src->pDrawable->height) {
if (sigtrap_get() == 0) {
BoxPtr box = RegionRects(region);
int nbox = RegionNumRects(region);
BoxPtr box = region_rects(region);
int nbox = region_num_rects(region);
sx += src->pDrawable->x;
sy += src->pDrawable->y;
@ -734,7 +734,7 @@ sna_composite(CARD8 op,
else
tmp.boxes(sna, &tmp,
RegionBoxptr(&region),
RegionNumRects(&region));
region_num_rects(&region));
apply_damage(&tmp, &region);
tmp.done(sna, &tmp);
@ -899,11 +899,11 @@ sna_composite_rectangles(CARD8 op,
goto cleanup_region;
}
DBG(("%s: clipped extents (%d, %d),(%d, %d) x %ld\n",
DBG(("%s: clipped extents (%d, %d),(%d, %d) x %d\n",
__FUNCTION__,
RegionExtents(&region)->x1, RegionExtents(&region)->y1,
RegionExtents(&region)->x2, RegionExtents(&region)->y2,
(long)RegionNumRects(&region)));
region_num_rects(&region)));
/* XXX xserver-1.8: CompositeRects is not tracked by Damage, so we must
* manually append the damaged regions ourselves.
@ -1082,8 +1082,8 @@ fallback:
if (sigtrap_get() == 0) {
if (op <= PictOpSrc) {
int nbox = RegionNumRects(&region);
BoxPtr box = RegionRects(&region);
int nbox = region_num_rects(&region);
BoxPtr box = region_rects(&region);
uint32_t pixel;
if (op == PictOpClear)

View File

@ -69,34 +69,31 @@ static inline bool region_is_singular_or_empty(const RegionRec *r)
static const char *_debug_describe_region(char *buf, int max,
const RegionRec *region)
{
BoxPtr extents;
BoxPtr box;
int n;
int len;
const BoxRec *box;
int n, len;
if (region == NULL)
return "nil";
n = REGION_NUM_RECTS(region);
n = region_num_rects(region);
if (n == 0)
return "[0]";
extents = REGION_EXTENTS(NULL, region);
if (n == 1) {
sprintf(buf,
"[(%d, %d), (%d, %d)]",
extents->x1, extents->y1,
extents->x2, extents->y2);
region->extents.x1, region->extents.y1,
region->extents.x2, region->extents.y2);
return buf;
}
len = sprintf(buf,
"[(%d, %d), (%d, %d) x %d: ",
extents->x1, extents->y1,
extents->x2, extents->y2,
region->extents.x1, region->extents.y1,
region->extents.x2, region->extents.y2,
n) + 3;
max -= 2;
box = REGION_RECTS(region);
box = region_rects(region);
while (n--) {
char tmp[80];
int this;
@ -223,7 +220,7 @@ static void __sna_damage_reduce(struct sna_damage *damage)
assert(damage->mode != DAMAGE_ALL);
assert(damage->dirty);
DBG((" reduce: before region.n=%ld\n", (long)REGION_NUM_RECTS(region)));
DBG((" reduce: before region.n=%d\n", region_num_rects(region)));
nboxes = damage->embedded_box.size;
list_for_each_entry(iter, &damage->embedded_box.list, list)
@ -248,7 +245,7 @@ static void __sna_damage_reduce(struct sna_damage *damage)
}
if (damage->mode == DAMAGE_ADD)
nboxes += REGION_NUM_RECTS(region);
nboxes += region_num_rects(region);
iter = last_box(damage);
n = iter->size - damage->remain;
@ -299,9 +296,9 @@ static void __sna_damage_reduce(struct sna_damage *damage)
if (damage->mode == DAMAGE_ADD) {
memcpy(boxes + n,
REGION_RECTS(region),
REGION_NUM_RECTS(region)*sizeof(BoxRec));
assert(n + REGION_NUM_RECTS(region) == nboxes);
region_rects(region),
region_num_rects(region)*sizeof(BoxRec));
assert(n + region_num_rects(region) == nboxes);
pixman_region_fini(region);
pixman_region_init_rects(region, boxes, nboxes);
@ -335,7 +332,7 @@ done:
free_list(&damage->embedded_box.list);
reset_embedded_box(damage);
DBG((" reduce: after region.n=%ld\n", (long)REGION_NUM_RECTS(region)));
DBG((" reduce: after region.n=%d\n", region_num_rects(region)));
}
static bool _sna_damage_create_boxes(struct sna_damage *damage,
@ -709,8 +706,8 @@ inline static struct sna_damage *__sna_damage_add(struct sna_damage *damage,
damage_union(damage, &region->extents);
return _sna_damage_create_elt(damage,
REGION_RECTS(region),
REGION_NUM_RECTS(region));
region_rects(region),
region_num_rects(region));
}
#if HAS_DEBUG_FULL
@ -728,7 +725,7 @@ fastcall struct sna_damage *_sna_damage_add(struct sna_damage *damage,
DBG((" = %s\n",
_debug_describe_damage(damage_buf, sizeof(damage_buf), damage)));
assert(RegionNumRects(&damage->region));
assert(region_num_rects(&damage->region));
assert(damage->region.extents.x2 > damage->region.extents.x1);
assert(damage->region.extents.y2 > damage->region.extents.y1);
@ -812,7 +809,7 @@ struct sna_damage *_sna_damage_add_boxes(struct sna_damage *damage,
DBG((" = %s\n",
_debug_describe_damage(damage_buf, sizeof(damage_buf), damage)));
if (RegionNumRects(&damage->region)) {
if (region_num_rects(&damage->region)) {
assert(damage->region.extents.x2 > damage->region.extents.x1);
assert(damage->region.extents.y2 > damage->region.extents.y1);
}
@ -901,7 +898,7 @@ struct sna_damage *_sna_damage_add_rectangles(struct sna_damage *damage,
DBG((" = %s\n",
_debug_describe_damage(damage_buf, sizeof(damage_buf), damage)));
if (RegionNumRects(&damage->region)) {
if (region_num_rects(&damage->region)) {
assert(damage->region.extents.x2 > damage->region.extents.x1);
assert(damage->region.extents.y2 > damage->region.extents.y1);
}
@ -985,7 +982,7 @@ struct sna_damage *_sna_damage_add_points(struct sna_damage *damage,
DBG((" = %s\n",
_debug_describe_damage(damage_buf, sizeof(damage_buf), damage)));
if (RegionNumRects(&damage->region)) {
if (region_num_rects(&damage->region)) {
assert(damage->region.extents.x2 > damage->region.extents.x1);
assert(damage->region.extents.y2 > damage->region.extents.y1);
}
@ -1015,7 +1012,7 @@ fastcall struct sna_damage *_sna_damage_add_box(struct sna_damage *damage,
DBG((" = %s\n",
_debug_describe_damage(damage_buf, sizeof(damage_buf), damage)));
assert(RegionNumRects(&damage->region));
assert(region_num_rects(&damage->region));
assert(damage->region.extents.x2 > damage->region.extents.x1);
assert(damage->region.extents.y2 > damage->region.extents.y1);
@ -1156,8 +1153,8 @@ no_damage:
}
return _sna_damage_create_elt(damage,
REGION_RECTS(region),
REGION_NUM_RECTS(region));
region_rects(region),
region_num_rects(region));
}
#if HAS_DEBUG_FULL
@ -1535,8 +1532,8 @@ static int __sna_damage_get_boxes(struct sna_damage *damage, BoxPtr *boxes)
if (damage->dirty)
__sna_damage_reduce(damage);
*boxes = REGION_RECTS(&damage->region);
return REGION_NUM_RECTS(&damage->region);
*boxes = region_rects(&damage->region);
return region_num_rects(&damage->region);
}
struct sna_damage *_sna_damage_reduce(struct sna_damage *damage)
@ -1824,7 +1821,7 @@ void _sna_damage_debug_get_region(struct sna_damage *damage, RegionRec *r)
}
if (damage->mode == DAMAGE_ADD)
nboxes += REGION_NUM_RECTS(r);
nboxes += region_num_rects(r);
iter = last_box(damage);
n = iter->size - damage->remain;
@ -1861,9 +1858,9 @@ void _sna_damage_debug_get_region(struct sna_damage *damage, RegionRec *r)
if (damage->mode == DAMAGE_ADD) {
memcpy(boxes + n,
REGION_RECTS(r),
REGION_NUM_RECTS(r)*sizeof(BoxRec));
assert(n + REGION_NUM_RECTS(r) == nboxes);
region_rects(r),
region_num_rects(r)*sizeof(BoxRec));
assert(n + region_num_rects(r) == nboxes);
pixman_region_fini(r);
pixman_region_init_rects(r, boxes, nboxes);

View File

@ -1167,8 +1167,8 @@ static bool wait_for_shadow(struct sna *sna, struct sna_pixmap *priv, unsigned f
}
if (flags & MOVE_READ && RegionNotEmpty(&sna->mode.shadow_region)) {
DBG(("%s: copying existing GPU damage: %ldx(%d, %d), (%d, %d)\n",
__FUNCTION__, (long)REGION_NUM_RECTS(&sna->mode.shadow_region),
DBG(("%s: copying existing GPU damage: %dx(%d, %d), (%d, %d)\n",
__FUNCTION__, region_num_rects(&sna->mode.shadow_region),
sna->mode.shadow_region.extents.x1,
sna->mode.shadow_region.extents.y1,
sna->mode.shadow_region.extents.x2,
@ -1176,8 +1176,8 @@ static bool wait_for_shadow(struct sna *sna, struct sna_pixmap *priv, unsigned f
ret = sna->render.copy_boxes(sna, GXcopy,
pixmap, priv->gpu_bo, 0, 0,
pixmap, bo, 0, 0,
REGION_RECTS(&sna->mode.shadow_region),
REGION_NUM_RECTS(&sna->mode.shadow_region),
region_rects(&sna->mode.shadow_region),
region_num_rects(&sna->mode.shadow_region),
0);
}
@ -1216,10 +1216,10 @@ void sna_pixmap_discard_shadow_damage(struct sna_pixmap *priv,
sna = priv->move_to_gpu_data;
DBG(("%s: discarding region %dx[(%d, %d), (%d, %d)] from damage %dx[(%d, %d], (%d, %d)]\n",
__FUNCTION__,
RegionNumRects(region),
region_num_rects(region),
region->extents.x1, region->extents.y1,
region->extents.x2, region->extents.y2,
RegionNumRects(&sna->mode.shadow_region),
region_num_rects(&sna->mode.shadow_region),
sna->mode.shadow_region.extents.x1, sna->mode.shadow_region.extents.y1,
sna->mode.shadow_region.extents.x2, sna->mode.shadow_region.extents.y2));
@ -1629,7 +1629,7 @@ static void set_shadow(struct sna *sna, RegionPtr region)
DBG(("%s: waiting for region %dx[(%d, %d), (%d, %d)], front handle=%d, shadow handle=%d\n",
__FUNCTION__,
RegionNumRects(region),
region_num_rects(region),
region->extents.x1, region->extents.y1,
region->extents.x2, region->extents.y2,
priv->gpu_bo->handle, sna->mode.shadow->handle));
@ -1860,9 +1860,9 @@ sna_crtc_damage(xf86CrtcPtr crtc)
damage = DamageRegion(sna->mode.shadow_damage);
RegionUnion(damage, damage, &region);
DBG(("%s: damage now %ldx[(%d, %d), (%d, %d)]\n",
DBG(("%s: damage now %dx[(%d, %d), (%d, %d)]\n",
__FUNCTION__,
(long)RegionNumRects(damage),
region_num_rects(damage),
damage->extents.x1, damage->extents.y1,
damage->extents.x2, damage->extents.y2));
}
@ -5694,8 +5694,8 @@ sna_crtc_redisplay__fallback(xf86CrtcPtr crtc, RegionPtr region, struct kgem_bo
kgem_bo_sync__gtt(&sna->kgem, bo);
if (sigtrap_get() == 0) { /* paranoia */
const BoxRec *b = REGION_RECTS(region);
int n = REGION_NUM_RECTS(region);
const BoxRec *b = region_rects(region);
int n = region_num_rects(region);
do {
BoxRec box;
@ -5794,8 +5794,8 @@ sna_crtc_redisplay__composite(xf86CrtcPtr crtc, RegionPtr region, struct kgem_bo
goto free_dst;
}
n = REGION_NUM_RECTS(region);
b = REGION_RECTS(region);
n = region_num_rects(region);
b = region_rects(region);
do {
BoxRec box;
@ -5828,11 +5828,11 @@ sna_crtc_redisplay(xf86CrtcPtr crtc, RegionPtr region)
int16_t tx, ty;
assert(sna_crtc);
DBG(("%s: crtc %d [pipe=%d], damage (%d, %d), (%d, %d) x %ld\n",
DBG(("%s: crtc %d [pipe=%d], damage (%d, %d), (%d, %d) x %d\n",
__FUNCTION__, sna_crtc->id, sna_crtc->pipe,
region->extents.x1, region->extents.y1,
region->extents.x2, region->extents.y2,
(long)RegionNumRects(region)));
region_num_rects(region)));
assert(!wedged(sna));
@ -5843,7 +5843,7 @@ sna_crtc_redisplay(xf86CrtcPtr crtc, RegionPtr region)
sna_blt_fill_boxes(sna, GXcopy,
sna_crtc->bo, sna->front->drawable.bitsPerPixel,
priv->clear_color,
REGION_RECTS(region), REGION_NUM_RECTS(region));
region_rects(region), region_num_rects(region));
return;
}
@ -5862,7 +5862,7 @@ sna_crtc_redisplay(xf86CrtcPtr crtc, RegionPtr region)
if (sna->render.copy_boxes(sna, GXcopy,
sna->front, priv->gpu_bo, 0, 0,
&tmp, sna_crtc->bo, -tx, -ty,
REGION_RECTS(region), REGION_NUM_RECTS(region), 0))
region_rects(region), region_num_rects(region), 0))
return;
}
@ -5944,8 +5944,8 @@ void sna_mode_redisplay(struct sna *sna)
if (RegionNil(region))
return;
DBG(("%s: damage: %ldx(%d, %d), (%d, %d)\n",
__FUNCTION__, (long)REGION_NUM_RECTS(region),
DBG(("%s: damage: %dx(%d, %d), (%d, %d)\n",
__FUNCTION__, region_num_rects(region),
region->extents.x1, region->extents.y1,
region->extents.x2, region->extents.y2));

View File

@ -965,8 +965,8 @@ __sna_dri2_copy_region(struct sna *sna, DrawablePtr draw, RegionPtr region,
}
if (region) {
boxes = REGION_RECTS(region);
n = REGION_NUM_RECTS(region);
boxes = region_rects(region);
n = region_num_rects(region);
assert(n);
} else {
region = &clip;
@ -1039,11 +1039,11 @@ sna_dri2_copy_region(DrawablePtr draw,
assert(get_private(src)->bo->refcnt);
assert(get_private(dst)->bo->refcnt);
DBG(("%s: region (%d, %d), (%d, %d) x %ld\n",
DBG(("%s: region (%d, %d), (%d, %d) x %d\n",
__FUNCTION__,
region->extents.x1, region->extents.y1,
region->extents.x2, region->extents.y2,
(long)REGION_NUM_RECTS(region)));
region_num_rects(region)));
__sna_dri2_copy_region(sna, draw, region, src, dst, false);
}
@ -1420,7 +1420,7 @@ can_flip(struct sna * sna,
win->drawable.width, win->drawable.height,
win->clipList.extents.x1, win->clipList.extents.y1,
win->clipList.extents.x2, win->clipList.extents.y2,
RegionNumRects(&win->clipList)));
region_num_rects(&win->clipList)));
if (!RegionEqual(&win->clipList, &draw->pScreen->root->winSize)) {
DBG(("%s: no, window is clipped: clip region=(%d, %d), (%d, %d), root size=(%d, %d), (%d, %d)\n",
__FUNCTION__,
@ -1509,7 +1509,7 @@ can_xchg(struct sna * sna,
win->drawable.width, win->drawable.height,
win->clipList.extents.x1, win->clipList.extents.y1,
win->clipList.extents.x2, win->clipList.extents.y2,
RegionNumRects(&win->clipList),
region_num_rects(&win->clipList),
pixmap->drawable.width,
pixmap->drawable.height));
if (is_clipped(&win->clipList, &pixmap->drawable)) {
@ -1631,7 +1631,7 @@ can_xchg_one(struct sna *sna,
win->drawable.width, win->drawable.height,
win->clipList.extents.x1, win->clipList.extents.y1,
win->clipList.extents.x2, win->clipList.extents.y2,
RegionNumRects(&win->clipList)));
region_num_rects(&win->clipList)));
if (is_clipped(&win->clipList, &win->drawable)) {
DBG(("%s: no, %dx%d window is clipped: clip region=(%d, %d), (%d, %d)\n",
__FUNCTION__,

View File

@ -580,8 +580,8 @@ glyphs_to_dst(struct sna *sna,
list->xOff, list->yOff, dst->pDrawable->x, dst->pDrawable->y));
if (clipped_glyphs(dst, nlist, list, glyphs)) {
rects = REGION_RECTS(dst->pCompositeClip);
nrect = REGION_NUM_RECTS(dst->pCompositeClip);
rects = region_rects(dst->pCompositeClip);
nrect = region_num_rects(dst->pCompositeClip);
} else
nrect = 0;
@ -742,8 +742,8 @@ glyphs0_to_dst(struct sna *sna,
src_y -= list->yOff + y;
if (clipped_glyphs(dst, nlist, list, glyphs)) {
rects = REGION_RECTS(dst->pCompositeClip);
nrect = REGION_NUM_RECTS(dst->pCompositeClip);
rects = region_rects(dst->pCompositeClip);
nrect = region_num_rects(dst->pCompositeClip);
if (nrect == 0)
return true;
@ -974,8 +974,8 @@ glyphs_slow(struct sna *sna,
COMPOSITE_PARTIAL, memset(&tmp, 0, sizeof(tmp))))
return false;
rects = REGION_RECTS(dst->pCompositeClip);
nrect = REGION_NUM_RECTS(dst->pCompositeClip);
rects = region_rects(dst->pCompositeClip);
nrect = region_num_rects(dst->pCompositeClip);
do {
struct sna_composite_rectangles r;
int16_t x2, y2;

View File

@ -676,18 +676,18 @@ sna_tiling_fill_boxes(struct sna *sna,
!sna->render.copy_boxes(sna, GXcopy,
dst, dst_bo, 0, 0,
&tmp, bo, -dx, -dy,
REGION_RECTS(&this), REGION_NUM_RECTS(&this), 0))
region_rects(&this), region_num_rects(&this), 0))
goto err;
RegionTranslate(&this, -dx, -dy);
if (!sna->render.fill_boxes(sna, op, format, color, &tmp, bo,
REGION_RECTS(&this), REGION_NUM_RECTS(&this)))
region_rects(&this), region_num_rects(&this)))
goto err;
if (!sna->render.copy_boxes(sna, GXcopy,
&tmp, bo, 0, 0,
dst, dst_bo, dx, dy,
REGION_RECTS(&this), REGION_NUM_RECTS(&this), 0))
region_rects(&this), region_num_rects(&this), 0))
goto err;
kgem_bo_destroy(&sna->kgem, bo);
@ -871,14 +871,14 @@ sna_tiling_blt_copy_boxes__with_alpha(struct sna *sna, uint8_t alu,
if (!sna_blt_copy_boxes(sna, GXcopy,
src_bo, src_dx, src_dy,
bo, -dx, -dy,
bpp, REGION_RECTS(&this), REGION_NUM_RECTS(&this)))
bpp, region_rects(&this), region_num_rects(&this)))
goto err;
if (!sna_blt_copy_boxes__with_alpha(sna, alu,
bo, -dx, -dy,
dst_bo, dst_dx, dst_dy,
bpp, alpha_fixup,
REGION_RECTS(&this), REGION_NUM_RECTS(&this)))
region_rects(&this), region_num_rects(&this)))
goto err;
kgem_bo_destroy(&sna->kgem, bo);
@ -1098,13 +1098,13 @@ bool sna_tiling_blt_copy_boxes(struct sna *sna, uint8_t alu,
if (!sna_blt_copy_boxes(sna, GXcopy,
src_bo, src_dx, src_dy,
bo, -dx, -dy,
bpp, REGION_RECTS(&this), REGION_NUM_RECTS(&this)))
bpp, region_rects(&this), region_num_rects(&this)))
goto err;
if (!sna_blt_copy_boxes(sna, alu,
bo, -dx, -dy,
dst_bo, dst_dx, dst_dy,
bpp, REGION_RECTS(&this), REGION_NUM_RECTS(&this)))
bpp, region_rects(&this), region_num_rects(&this)))
goto err;
kgem_bo_destroy(&sna->kgem, bo);

View File

@ -73,9 +73,9 @@ static void _assert_pixmap_contains_box(PixmapPtr pixmap, BoxPtr box, const char
static void apply_damage(struct sna_composite_op *op, RegionPtr region)
{
DBG(("%s: damage=%p, region=%ldx[(%d, %d), (%d, %d)]\n",
DBG(("%s: damage=%p, region=%dx[(%d, %d), (%d, %d)]\n",
__FUNCTION__, op->damage,
(long)REGION_NUM_RECTS(region),
region_num_rects(region),
region->extents.x1, region->extents.y1,
region->extents.x2, region->extents.y2));
@ -237,8 +237,8 @@ composite_aligned_boxes(struct sna *sna,
RegionIntersect(&region, &region, &clip);
if (sigtrap_get() == 0) {
b = REGION_RECTS(&region);
count = REGION_NUM_RECTS(&region);
b = region_rects(&region);
count = region_num_rects(&region);
for (i = 0; i < count; i++) {
fbComposite(op, src, NULL, dst,
src_x + b[i].x1 - boxes[0].x1,
@ -254,8 +254,8 @@ composite_aligned_boxes(struct sna *sna,
for (n = 0; n < num_boxes; n++) {
pixman_region_init_rects(&region, &boxes[n], 1);
RegionIntersect(&region, &region, &clip);
b = REGION_RECTS(&region);
count = REGION_NUM_RECTS(&region);
b = region_rects(&region);
count = region_num_rects(&region);
if (sigtrap_get() == 0) {
for (i = 0; i < count; i++) {
fbComposite(op, src, NULL, dst,
@ -280,10 +280,10 @@ composite_aligned_boxes(struct sna *sna,
num_boxes == 1) {
pixman_region_init_rects(&region, boxes, num_boxes);
RegionIntersect(&region, &region, &clip);
if (REGION_NUM_RECTS(&region)) {
if (region_num_rects(&region)) {
tmp.boxes(sna, &tmp,
REGION_RECTS(&region),
REGION_NUM_RECTS(&region));
region_rects(&region),
region_num_rects(&region));
apply_damage(&tmp, &region);
}
pixman_region_fini(&region);
@ -291,10 +291,10 @@ composite_aligned_boxes(struct sna *sna,
for (n = 0; n < num_boxes; n++) {
pixman_region_init_rects(&region, &boxes[n], 1);
RegionIntersect(&region, &region, &clip);
if (REGION_NUM_RECTS(&region)) {
if (region_num_rects(&region)) {
tmp.boxes(sna, &tmp,
REGION_RECTS(&region),
REGION_NUM_RECTS(&region));
region_rects(&region),
region_num_rects(&region));
apply_damage(&tmp, &region);
}
pixman_region_fini(&region);
@ -330,10 +330,10 @@ composite_unaligned_box(struct sna *sna,
pixman_region_init_rects(&region, box, 1);
RegionIntersect(&region, &region, clip);
if (REGION_NUM_RECTS(&region))
if (region_num_rects(&region))
tmp->boxes(sna, tmp,
REGION_RECTS(&region),
REGION_NUM_RECTS(&region),
region_rects(&region),
region_num_rects(&region),
opacity);
pixman_region_fini(&region);
} else
@ -472,7 +472,7 @@ composite_unaligned_trap(struct sna *sna,
pixman_region_init_rects(&region, &box, 1);
RegionIntersect(&region, &region, clip);
if (REGION_NUM_RECTS(&region))
if (region_num_rects(&region))
apply_damage(&tmp->base, &region);
RegionUninit(&region);
} else
@ -797,8 +797,8 @@ composite_unaligned_boxes_inplace__solid(struct sna *sna,
if (sigtrap_get() == 0) {
RegionTranslate(&clip, dx, dy);
count = REGION_NUM_RECTS(&clip);
extents = REGION_RECTS(&clip);
count = region_num_rects(&clip);
extents = region_rects(&clip);
while (count--) {
int16_t y1 = dy + pixman_fixed_to_int(t->top);
uint16_t fy1 = pixman_fixed_frac(t->top);
@ -887,8 +887,8 @@ pixman:
pi.op = op;
if (sigtrap_get() == 0) {
count = REGION_NUM_RECTS(&clip);
extents = REGION_RECTS(&clip);
count = region_num_rects(&clip);
extents = region_rects(&clip);
while (count--) {
int16_t y1 = pixman_fixed_to_int(t->top);
uint16_t fy1 = pixman_fixed_frac(t->top);
@ -1128,8 +1128,8 @@ composite_unaligned_boxes_inplace(struct sna *sna,
pi.op = op;
if (sigtrap_get() == 0) {
count = REGION_NUM_RECTS(&clip);
extents = REGION_RECTS(&clip);
count = region_num_rects(&clip);
extents = region_rects(&clip);
while (count--) {
int16_t y1 = pixman_fixed_to_int(t->top);
uint16_t fy1 = pixman_fixed_frac(t->top);

View File

@ -85,9 +85,9 @@ static void _assert_pixmap_contains_box(PixmapPtr pixmap, BoxPtr box, const char
static void apply_damage(struct sna_composite_op *op, RegionPtr region)
{
DBG(("%s: damage=%p, region=%ldx[(%d, %d), (%d, %d)]\n",
DBG(("%s: damage=%p, region=%dx[(%d, %d), (%d, %d)]\n",
__FUNCTION__, op->damage,
(long)REGION_NUM_RECTS(region),
region_num_rects(region),
region->extents.x1, region->extents.y1,
region->extents.x2, region->extents.y2));
@ -1008,10 +1008,10 @@ tor_blt_span_clipped(struct sna *sna,
pixman_region_init_rects(&region, box, 1);
RegionIntersect(&region, &region, clip);
if (REGION_NUM_RECTS(&region)) {
if (region_num_rects(&region)) {
op->boxes(sna, op,
REGION_RECTS(&region),
REGION_NUM_RECTS(&region),
region_rects(&region),
region_num_rects(&region),
opacity);
apply_damage(&op->base, &region);
}
@ -1738,10 +1738,10 @@ span_thread_clipped_box(struct sna *sna,
pixman_region_init_rects(&region, box, 1);
RegionIntersect(&region, &region, clip);
if (REGION_NUM_RECTS(&region)) {
if (region_num_rects(&region)) {
span_thread_add_boxes(sna, op,
REGION_RECTS(&region),
REGION_NUM_RECTS(&region),
region_rects(&region),
region_num_rects(&region),
AREA_TO_ALPHA(coverage));
}
pixman_region_fini(&region);
@ -2230,8 +2230,8 @@ tor_blt_src_clipped(struct sna *sna,
pixman_region_init_rects(&region, box, 1);
RegionIntersect(&region, &region, clip);
n = REGION_NUM_RECTS(&region);
box = REGION_RECTS(&region);
n = region_num_rects(&region);
box = region_rects(&region);
while (n--)
tor_blt_src(sna, op, NULL, box++, coverage);
pixman_region_fini(&region);
@ -2280,8 +2280,8 @@ tor_blt_in_clipped(struct sna *sna,
pixman_region_init_rects(&region, box, 1);
RegionIntersect(&region, &region, clip);
n = REGION_NUM_RECTS(&region);
box = REGION_RECTS(&region);
n = region_num_rects(&region);
box = region_rects(&region);
while (n--)
tor_blt_in(sna, op, NULL, box++, coverage);
pixman_region_fini(&region);
@ -2337,8 +2337,8 @@ tor_blt_add_clipped(struct sna *sna,
pixman_region_init_rects(&region, box, 1);
RegionIntersect(&region, &region, clip);
n = REGION_NUM_RECTS(&region);
box = REGION_RECTS(&region);
n = region_num_rects(&region);
box = region_rects(&region);
while (n--)
tor_blt_add(sna, op, NULL, box++, coverage);
pixman_region_fini(&region);
@ -2411,8 +2411,8 @@ tor_blt_lerp32_clipped(struct sna *sna,
pixman_region_init_rects(&region, box, 1);
RegionIntersect(&region, &region, clip);
n = REGION_NUM_RECTS(&region);
box = REGION_RECTS(&region);
n = region_num_rects(&region);
box = region_rects(&region);
while (n--)
tor_blt_lerp32(sna, op, NULL, box++, coverage);
pixman_region_fini(&region);
@ -2459,8 +2459,8 @@ pixmask_span_solid__clipped(struct sna *sna,
pixman_region_init_rects(&region, box, 1);
RegionIntersect(&region, &region, clip);
n = REGION_NUM_RECTS(&region);
box = REGION_RECTS(&region);
n = region_num_rects(&region);
box = region_rects(&region);
while (n--)
pixmask_span_solid(sna, op, NULL, box++, coverage);
pixman_region_fini(&region);
@ -2499,8 +2499,8 @@ pixmask_span__clipped(struct sna *sna,
pixman_region_init_rects(&region, box, 1);
RegionIntersect(&region, &region, clip);
n = REGION_NUM_RECTS(&region);
box = REGION_RECTS(&region);
n = region_num_rects(&region);
box = region_rects(&region);
while (n--)
pixmask_span(sna, op, NULL, box++, coverage);
pixman_region_fini(&region);

View File

@ -119,9 +119,9 @@ static void _assert_pixmap_contains_box(PixmapPtr pixmap, BoxPtr box, const char
static void apply_damage(struct sna_composite_op *op, RegionPtr region)
{
DBG(("%s: damage=%p, region=%ldx[(%d, %d), (%d, %d)]\n",
DBG(("%s: damage=%p, region=%dx[(%d, %d), (%d, %d)]\n",
__FUNCTION__, op->damage,
(long)REGION_NUM_RECTS(region),
region_num_rects(region),
region->extents.x1, region->extents.y1,
region->extents.x2, region->extents.y2));
@ -444,10 +444,10 @@ mono_span(struct mono *c, int x1, int x2, BoxPtr box)
pixman_region_init_rects(&region, box, 1);
RegionIntersect(&region, &region, &c->clip);
if (REGION_NUM_RECTS(&region)) {
if (region_num_rects(&region)) {
c->op.boxes(c->sna, &c->op,
REGION_RECTS(&region),
REGION_NUM_RECTS(&region));
region_rects(&region),
region_num_rects(&region));
apply_damage(&c->op, &region);
}
pixman_region_fini(&region);
@ -505,10 +505,10 @@ thread_mono_span_clipped(struct mono *c, int x1, int x2, BoxPtr box)
pixman_region_init_rects(&region, box, 1);
RegionIntersect(&region, &region, &c->clip);
if (REGION_NUM_RECTS(&region))
if (region_num_rects(&region))
thread_mono_span_add_boxes(c,
REGION_RECTS(&region),
REGION_NUM_RECTS(&region));
region_rects(&region),
region_num_rects(&region));
pixman_region_fini(&region);
}

View File

@ -106,9 +106,9 @@ static void _assert_pixmap_contains_box(PixmapPtr pixmap, BoxPtr box, const char
static void apply_damage(struct sna_composite_op *op, RegionPtr region)
{
DBG(("%s: damage=%p, region=%ldx[(%d, %d), (%d, %d)]\n",
DBG(("%s: damage=%p, region=%dx[(%d, %d), (%d, %d)]\n",
__FUNCTION__, op->damage,
(long)REGION_NUM_RECTS(region),
region_num_rects(region),
region->extents.x1, region->extents.y1,
region->extents.x2, region->extents.y2));
@ -1012,10 +1012,10 @@ tor_blt_span_clipped(struct sna *sna,
pixman_region_init_rects(&region, box, 1);
RegionIntersect(&region, &region, clip);
if (REGION_NUM_RECTS(&region)) {
if (region_num_rects(&region)) {
op->boxes(sna, op,
REGION_RECTS(&region),
REGION_NUM_RECTS(&region),
region_rects(&region),
region_num_rects(&region),
opacity);
apply_damage(&op->base, &region);
}
@ -1667,10 +1667,10 @@ span_thread_clipped_box(struct sna *sna,
pixman_region_init_rects(&region, box, 1);
RegionIntersect(&region, &region, clip);
if (REGION_NUM_RECTS(&region)) {
if (region_num_rects(&region)) {
span_thread_add_boxes(sna, op,
REGION_RECTS(&region),
REGION_NUM_RECTS(&region),
region_rects(&region),
region_num_rects(&region),
AREA_TO_FLOAT(coverage));
}
pixman_region_fini(&region);
@ -2231,8 +2231,8 @@ tor_blt_src_clipped(struct sna *sna,
pixman_region_init_rects(&region, box, 1);
RegionIntersect(&region, &region, clip);
n = REGION_NUM_RECTS(&region);
box = REGION_RECTS(&region);
n = region_num_rects(&region);
box = region_rects(&region);
while (n--)
tor_blt_src(sna, op, NULL, box++, coverage);
pixman_region_fini(&region);
@ -2281,8 +2281,8 @@ tor_blt_in_clipped(struct sna *sna,
pixman_region_init_rects(&region, box, 1);
RegionIntersect(&region, &region, clip);
n = REGION_NUM_RECTS(&region);
box = REGION_RECTS(&region);
n = region_num_rects(&region);
box = region_rects(&region);
while (n--)
tor_blt_in(sna, op, NULL, box++, coverage);
pixman_region_fini(&region);
@ -2338,8 +2338,8 @@ tor_blt_add_clipped(struct sna *sna,
pixman_region_init_rects(&region, box, 1);
RegionIntersect(&region, &region, clip);
n = REGION_NUM_RECTS(&region);
box = REGION_RECTS(&region);
n = region_num_rects(&region);
box = region_rects(&region);
while (n--)
tor_blt_add(sna, op, NULL, box++, coverage);
pixman_region_fini(&region);
@ -2410,8 +2410,8 @@ tor_blt_lerp32_clipped(struct sna *sna,
pixman_region_init_rects(&region, box, 1);
RegionIntersect(&region, &region, clip);
n = REGION_NUM_RECTS(&region);
box = REGION_RECTS(&region);
n = region_num_rects(&region);
box = region_rects(&region);
while (n--)
tor_blt_lerp32(sna, op, NULL, box++, coverage);
pixman_region_fini(&region);
@ -2456,8 +2456,8 @@ pixmask_span_solid__clipped(struct sna *sna,
pixman_region_init_rects(&region, box, 1);
RegionIntersect(&region, &region, clip);
n = REGION_NUM_RECTS(&region);
box = REGION_RECTS(&region);
n = region_num_rects(&region);
box = region_rects(&region);
while (n--)
pixmask_span_solid(sna, op, NULL, box++, coverage);
pixman_region_fini(&region);
@ -2494,8 +2494,8 @@ pixmask_span__clipped(struct sna *sna,
pixman_region_init_rects(&region, box, 1);
RegionIntersect(&region, &region, clip);
n = REGION_NUM_RECTS(&region);
box = REGION_RECTS(&region);
n = region_num_rects(&region);
box = region_rects(&region);
while (n--)
pixmask_span(sna, op, NULL, box++, coverage);
pixman_region_fini(&region);

View File

@ -516,8 +516,8 @@ sna_video_overlay_put_image(ClientPtr client,
drw_x, drw_y, drw_w, drw_h,
format->id, width, height, sync));
DBG(("%s: region %ld:(%d, %d), (%d, %d)\n", __FUNCTION__,
(long)RegionNumRects(&clip),
DBG(("%s: region %d:(%d, %d), (%d, %d)\n", __FUNCTION__,
region_num_rects(&clip),
clip.extents.x1, clip.extents.y1,
clip.extents.x2, clip.extents.y2));
@ -581,8 +581,8 @@ sna_video_overlay_put_image(ClientPtr client,
__sna_pixmap_get_bo(sna->front),
sna->front->drawable.bitsPerPixel,
video->color_key,
RegionRects(&clip),
RegionNumRects(&clip)))
region_rects(&clip),
region_num_rects(&clip)))
RegionCopy(&video->clip, &clip);
sna_window_set_port((WindowPtr)draw, port);
} else {

View File

@ -383,7 +383,7 @@ static int sna_video_sprite_put_image(ClientPtr client,
format->id, width, height, sync));
DBG(("%s: region %d:(%d, %d), (%d, %d)\n", __FUNCTION__,
RegionNumRects(&clip),
region_num_rects(&clip),
clip.extents.x1, clip.extents.y1,
clip.extents.x2, clip.extents.y2));
@ -522,8 +522,8 @@ off:
__sna_pixmap_get_bo(sna->front),
sna->front->drawable.bitsPerPixel,
video->color_key,
RegionRects(&clip),
RegionNumRects(&clip)))
region_rects(&clip),
region_num_rects(&clip)))
RegionCopy(&video->clip, &clip);
sna_window_set_port((WindowPtr)draw, port);

View File

@ -193,8 +193,8 @@ sna_video_textured_put_image(ClientPtr client,
drw_x, drw_y, drw_w, drw_h,
format->id, width, height, sync));
DBG(("%s: region %ld:(%d, %d), (%d, %d)\n", __FUNCTION__,
(long)RegionNumRects(&clip),
DBG(("%s: region %d:(%d, %d), (%d, %d)\n", __FUNCTION__,
region_num_rects(&clip),
clip.extents.x1, clip.extents.y1,
clip.extents.x2, clip.extents.y2));