summaryrefslogtreecommitdiff
path: root/src/sna/sna_damage.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sna/sna_damage.c')
-rw-r--r--src/sna/sna_damage.c95
1 files changed, 47 insertions, 48 deletions
diff --git a/src/sna/sna_damage.c b/src/sna/sna_damage.c
index b634c0b2..51b15d34 100644
--- a/src/sna/sna_damage.c
+++ b/src/sna/sna_damage.c
@@ -660,8 +660,8 @@ fastcall struct sna_damage *_sna_damage_add(struct sna_damage *damage,
damage = __sna_damage_add(damage, region);
- ErrorF(" = %s\n",
- _debug_describe_damage(damage_buf, sizeof(damage_buf), damage));
+ DBG((" = %s\n",
+ _debug_describe_damage(damage_buf, sizeof(damage_buf), damage)));
assert(RegionNumRects(&damage->region));
assert(damage->region.extents.x2 > damage->region.extents.x1);
assert(damage->region.extents.y2 > damage->region.extents.y1);
@@ -744,8 +744,8 @@ struct sna_damage *_sna_damage_add_boxes(struct sna_damage *damage,
damage = __sna_damage_add_boxes(damage, b, n, dx, dy);
- ErrorF(" = %s\n",
- _debug_describe_damage(damage_buf, sizeof(damage_buf), damage));
+ DBG((" = %s\n",
+ _debug_describe_damage(damage_buf, sizeof(damage_buf), damage)));
if (RegionNumRects(&damage->region)) {
assert(damage->region.extents.x2 > damage->region.extents.x1);
assert(damage->region.extents.y2 > damage->region.extents.y1);
@@ -833,8 +833,8 @@ struct sna_damage *_sna_damage_add_rectangles(struct sna_damage *damage,
damage = __sna_damage_add_rectangles(damage, r, n, dx, dy);
- ErrorF(" = %s\n",
- _debug_describe_damage(damage_buf, sizeof(damage_buf), damage));
+ DBG((" = %s\n",
+ _debug_describe_damage(damage_buf, sizeof(damage_buf), damage)));
if (RegionNumRects(&damage->region)) {
assert(damage->region.extents.x2 > damage->region.extents.x1);
assert(damage->region.extents.y2 > damage->region.extents.y1);
@@ -917,8 +917,8 @@ struct sna_damage *_sna_damage_add_points(struct sna_damage *damage,
damage = __sna_damage_add_points(damage, p, n, dx, dy);
- ErrorF(" = %s\n",
- _debug_describe_damage(damage_buf, sizeof(damage_buf), damage));
+ DBG((" = %s\n",
+ _debug_describe_damage(damage_buf, sizeof(damage_buf), damage)));
if (RegionNumRects(&damage->region)) {
assert(damage->region.extents.x2 > damage->region.extents.x1);
assert(damage->region.extents.y2 > damage->region.extents.y1);
@@ -947,8 +947,8 @@ fastcall struct sna_damage *_sna_damage_add_box(struct sna_damage *damage,
damage = __sna_damage_add_box(damage, box);
- ErrorF(" = %s\n",
- _debug_describe_damage(damage_buf, sizeof(damage_buf), damage));
+ DBG((" = %s\n",
+ _debug_describe_damage(damage_buf, sizeof(damage_buf), damage)));
assert(RegionNumRects(&damage->region));
assert(damage->region.extents.x2 > damage->region.extents.x1);
assert(damage->region.extents.y2 > damage->region.extents.y1);
@@ -1101,14 +1101,14 @@ fastcall struct sna_damage *_sna_damage_subtract(struct sna_damage *damage,
char damage_buf[1000];
char region_buf[120];
- ErrorF("%s(%s - %s)...\n", __FUNCTION__,
+ DBG(("%s(%s - %s)...\n", __FUNCTION__,
_debug_describe_damage(damage_buf, sizeof(damage_buf), damage),
- _debug_describe_region(region_buf, sizeof(region_buf), region));
+ _debug_describe_region(region_buf, sizeof(region_buf), region)));
damage = __sna_damage_subtract(damage, region);
- ErrorF(" = %s\n",
- _debug_describe_damage(damage_buf, sizeof(damage_buf), damage));
+ DBG((" = %s\n",
+ _debug_describe_damage(damage_buf, sizeof(damage_buf), damage)));
return damage;
}
@@ -1171,14 +1171,14 @@ fastcall struct sna_damage *_sna_damage_subtract_box(struct sna_damage *damage,
{
char damage_buf[1000];
- ErrorF("%s(%s - (%d, %d), (%d, %d))...\n", __FUNCTION__,
- _debug_describe_damage(damage_buf, sizeof(damage_buf), damage),
- box->x1, box->y1, box->x2, box->y2);
+ DBG(("%s(%s - (%d, %d), (%d, %d))...\n", __FUNCTION__,
+ _debug_describe_damage(damage_buf, sizeof(damage_buf), damage),
+ box->x1, box->y1, box->x2, box->y2));
damage = __sna_damage_subtract_box(damage, box);
- ErrorF(" = %s\n",
- _debug_describe_damage(damage_buf, sizeof(damage_buf), damage));
+ DBG((" = %s\n",
+ _debug_describe_damage(damage_buf, sizeof(damage_buf), damage)));
return damage;
}
@@ -1253,16 +1253,16 @@ fastcall struct sna_damage *_sna_damage_subtract_boxes(struct sna_damage *damage
{
char damage_buf[1000];
- ErrorF("%s(%s - [(%d,%d), (%d,%d)...x%d])...\n", __FUNCTION__,
- _debug_describe_damage(damage_buf, sizeof(damage_buf), damage),
- box->x1 + dx, box->y1 + dy,
- box->x2 + dx, box->y2 + dy,
- n);
+ DBG(("%s(%s - [(%d,%d), (%d,%d)...x%d])...\n", __FUNCTION__,
+ _debug_describe_damage(damage_buf, sizeof(damage_buf), damage),
+ box->x1 + dx, box->y1 + dy,
+ box->x2 + dx, box->y2 + dy,
+ n));
damage = __sna_damage_subtract_boxes(damage, box, n, dx, dy);
- ErrorF(" = %s\n",
- _debug_describe_damage(damage_buf, sizeof(damage_buf), damage));
+ DBG((" = %s\n",
+ _debug_describe_damage(damage_buf, sizeof(damage_buf), damage)));
return damage;
}
@@ -1338,11 +1338,11 @@ int _sna_damage_contains_box(struct sna_damage *damage,
box->x1, box->y1, box->x2, box->y2));
ret = __sna_damage_contains_box(damage, box);
- ErrorF(" = %d", ret);
+ DBG((" = %d", ret));
if (ret)
- ErrorF(" [(%d, %d), (%d, %d)...]",
- box->x1, box->y1, box->x2, box->y2);
- ErrorF("\n");
+ DBG((" [(%d, %d), (%d, %d)...]",
+ box->x1, box->y1, box->x2, box->y2));
+ DBG(("\n"));
return ret;
}
@@ -1441,16 +1441,16 @@ bool _sna_damage_intersect(struct sna_damage *damage,
char region_buf[120];
bool ret;
- ErrorF("%s(%s, %s)...\n", __FUNCTION__,
- _debug_describe_damage(damage_buf, sizeof(damage_buf), damage),
- _debug_describe_region(region_buf, sizeof(region_buf), region));
+ DBG(("%s(%s, %s)...\n", __FUNCTION__,
+ _debug_describe_damage(damage_buf, sizeof(damage_buf), damage),
+ _debug_describe_region(region_buf, sizeof(region_buf), region)));
ret = __sna_damage_intersect(damage, region, result);
if (ret)
- ErrorF(" = %s\n",
- _debug_describe_region(region_buf, sizeof(region_buf), result));
+ DBG((" = %s\n",
+ _debug_describe_region(region_buf, sizeof(region_buf), result)));
else
- ErrorF(" = none\n");
+ DBG((" = none\n"));
return ret;
}
@@ -1492,11 +1492,11 @@ int _sna_damage_get_boxes(struct sna_damage *damage, BoxPtr *boxes)
char damage_buf[1000];
int count;
- ErrorF("%s(%s)...\n", __FUNCTION__,
- _debug_describe_damage(damage_buf, sizeof(damage_buf), damage));
+ DBG(("%s(%s)...\n", __FUNCTION__,
+ _debug_describe_damage(damage_buf, sizeof(damage_buf), damage)));
count = __sna_damage_get_boxes(damage, boxes);
- ErrorF(" = %d\n", count);
+ DBG((" = %d\n", count));
return count;
}
@@ -1660,14 +1660,14 @@ static bool st_check_equal(struct sna_damage_selftest *test,
r_boxes = pixman_region_rectangles(region, &r_num);
if (d_num != r_num) {
- ErrorF("%s: damage and ref contain different number of rectangles\n",
- __FUNCTION__);
+ ERR(("%s: damage and ref contain different number of rectangles\n",
+ __FUNCTION__));
return false;
}
if (memcmp(d_boxes, r_boxes, d_num*sizeof(BoxRec))) {
- ErrorF("%s: damage and ref contain different rectangles\n",
- __FUNCTION__);
+ ERR(("%s: damage and ref contain different rectangles\n",
+ __FUNCTION__));
return false;
}
@@ -1702,7 +1702,7 @@ void sna_damage_selftest(void)
int iter, i;
iter = 1 + rand() % (1 + (pass / 64));
- ErrorF("%s: pass %d, iters=%d\n", __FUNCTION__, pass, iter);
+ DBG(("%s: pass %d, iters=%d\n", __FUNCTION__, pass, iter));
test.width = 1 + rand() % 2048;
test.height = 1 + rand() % 2048;
@@ -1715,10 +1715,9 @@ void sna_damage_selftest(void)
}
if (!check[rand() % ARRAY_SIZE(check)](&test, &damage, &ref)) {
- ErrorF("%s: failed - region = %s, damage = %s\n", __FUNCTION__,
- _debug_describe_region(region_buf, sizeof(region_buf), &ref),
- _debug_describe_damage(damage_buf, sizeof(damage_buf), damage));
- assert(0);
+ FatalError("%s: failed - region = %s, damage = %s\n", __FUNCTION__,
+ _debug_describe_region(region_buf, sizeof(region_buf), &ref),
+ _debug_describe_damage(damage_buf, sizeof(damage_buf), damage));
}
pixman_region_fini(&ref);