r->data = NULL;
}
-static inline void region_maybe_clip(RegionRec *r, RegionRec *clip)
+static inline bool region_maybe_clip(RegionRec *r, RegionRec *clip)
{
- if (clip->data)
- RegionIntersect(r, r, clip);
+ if (clip->data && !RegionIntersect(r, r, clip))
+ return false;
+
+ return !box_empty(&r->extents);
}
static inline bool region_is_singular(const RegionRec *r)
gc->pCompositeClip->extents.y1 > region.extents.y1 ||
gc->pCompositeClip->extents.x2 < region.extents.x2 ||
gc->pCompositeClip->extents.y2 < region.extents.y2) {
- RegionIntersect(®ion, ®ion, gc->pCompositeClip);
- if (RegionNil(®ion))
+ if (!RegionIntersect(®ion, ®ion, gc->pCompositeClip) ||
+ box_empty(®ion.extents))
return;
}
RegionRec clip;
region_set(&clip, extents);
- region_maybe_clip(&clip, gc->pCompositeClip);
- if (RegionNil(&clip))
+ if (!region_maybe_clip(&clip, gc->pCompositeClip))
return true;
assert(dx + clip.extents.x1 >= 0);
RegionRec clip;
region_set(&clip, extents);
- region_maybe_clip(&clip, gc->pCompositeClip);
- if (RegionNil(&clip))
+ if (!region_maybe_clip(&clip, gc->pCompositeClip))
return true;
assert(dx + clip.extents.x1 >= 0);
fallback:
DBG(("%s: fallback\n", __FUNCTION__));
region.data = NULL;
- region_maybe_clip(®ion, gc->pCompositeClip);
- if (RegionNil(®ion))
+ if (!region_maybe_clip(®ion, gc->pCompositeClip))
return;
if (!sna_gc_move_to_cpu(gc, drawable, ®ion))
fallback:
region.data = NULL;
- region_maybe_clip(®ion, gc->pCompositeClip);
- if (RegionNil(®ion))
+ if (!region_maybe_clip(®ion, gc->pCompositeClip))
return;
if (!sna_gc_move_to_cpu(gc, drawable, ®ion))
__FUNCTION__,
region.extents.x1, region.extents.y1,
region.extents.x2, region.extents.y2));
- if (RegionNil(®ion))
+ if (box_empty(®ion.extents))
goto empty;
RegionTranslate(®ion,
fallback:
DBG(("%s: fallback\n", __FUNCTION__));
region.data = NULL;
- region_maybe_clip(®ion, gc->pCompositeClip);
- if (RegionNil(®ion))
+ if (!region_maybe_clip(®ion, gc->pCompositeClip))
return;
if (!sna_gc_move_to_cpu(gc, drawable, ®ion))
region_set(&clip, extents);
if (clipped) {
- region_maybe_clip(&clip, gc->pCompositeClip);
- if (RegionNil(&clip))
+ if (!region_maybe_clip(&clip, gc->pCompositeClip))
return true;
}
RegionRec clip;
region_set(&clip, extents);
- region_maybe_clip(&clip, gc->pCompositeClip);
- if (RegionNil(&clip))
+ if (!region_maybe_clip(&clip, gc->pCompositeClip))
return true;
last.x = pt->x + drawable->x;
sna_gc_ops__tmp.FillSpans = sna_fill_spans__fill;
sna_gc_ops__tmp.PolyPoint = sna_poly_point__fill;
} else {
- region_maybe_clip(&data.region,
- gc->pCompositeClip);
- if (RegionNil(&data.region))
+ if (!region_maybe_clip(&data.region,
+ gc->pCompositeClip))
return;
if (region_is_singular(&data.region)) {
sna_gc_ops__tmp.FillSpans = sna_fill_spans__dash;
sna_gc_ops__tmp.PolyPoint = sna_poly_point__dash;
} else {
- region_maybe_clip(&data.region,
- gc->pCompositeClip);
- if (RegionNil(&data.region))
+ if (!region_maybe_clip(&data.region,
+ gc->pCompositeClip))
return;
if (region_is_singular(&data.region)) {
fallback:
DBG(("%s: fallback\n", __FUNCTION__));
- region_maybe_clip(&data.region, gc->pCompositeClip);
- if (RegionNil(&data.region))
+ if (!region_maybe_clip(&data.region, gc->pCompositeClip))
return;
if (!sna_gc_move_to_cpu(gc, drawable, &data.region))
RegionRec clip;
region_set(&clip, extents);
- region_maybe_clip(&clip, gc->pCompositeClip);
- if (RegionNil(&clip))
+ if (!region_maybe_clip(&clip, gc->pCompositeClip))
goto done;
if (clip.data) {
region_set(&clip, extents);
if (clipped) {
- region_maybe_clip(&clip, gc->pCompositeClip);
- if (RegionNil(&clip))
+ if (!region_maybe_clip(&clip, gc->pCompositeClip))
return true;
}
DBG(("%s: [clipped] extents=(%d, %d), (%d, %d), delta=(%d, %d)\n",
sna_gc_ops__tmp.FillSpans = sna_fill_spans__fill;
sna_gc_ops__tmp.PolyPoint = sna_poly_point__fill;
} else {
- region_maybe_clip(&data.region,
- gc->pCompositeClip);
- if (RegionNil(&data.region))
+ if (!region_maybe_clip(&data.region,
+ gc->pCompositeClip))
return;
if (region_is_singular(&data.region)) {
fallback:
DBG(("%s: fallback\n", __FUNCTION__));
- region_maybe_clip(&data.region, gc->pCompositeClip);
- if (RegionNil(&data.region))
+ if (!region_maybe_clip(&data.region, gc->pCompositeClip))
return;
if (!sna_gc_move_to_cpu(gc, drawable, &data.region))
int count;
region_set(&clip, extents);
- region_maybe_clip(&clip, gc->pCompositeClip);
- if (RegionNil(&clip))
+ if (!region_maybe_clip(&clip, gc->pCompositeClip))
goto done;
if (clip.data) {
int16_t offset3 = offset2 - offset1;
region_set(&clip, extents);
- region_maybe_clip(&clip, gc->pCompositeClip);
+ if (!region_maybe_clip(&clip, gc->pCompositeClip))
+ goto done;
+
DBG(("%s: wide clipped: extents=((%d, %d), (%d, %d))\n",
__FUNCTION__,
clip.extents.x1, clip.extents.y1,
clip.extents.x2, clip.extents.y2));
- if (RegionNil(&clip))
- goto done;
if (clip.data) {
const BoxRec * const clip_start = RegionBoxptr(&clip);
DBG(("%s: fallback\n", __FUNCTION__));
region.data = NULL;
- region_maybe_clip(®ion, gc->pCompositeClip);
- if (RegionNil(®ion))
+ if (!region_maybe_clip(®ion, gc->pCompositeClip))
return;
if (!sna_gc_move_to_cpu(gc, drawable, ®ion))
sna_gc_ops__tmp.FillSpans = sna_fill_spans__fill;
sna_gc_ops__tmp.PolyPoint = sna_poly_point__fill;
} else {
- region_maybe_clip(&data.region,
- gc->pCompositeClip);
- if (RegionNil(&data.region))
+ if (!region_maybe_clip(&data.region,
+ gc->pCompositeClip))
return;
if (region_is_singular(&data.region)) {
fill.done(data.sna, &fill);
} else {
- region_maybe_clip(&data.region,
- gc->pCompositeClip);
- if (RegionNil(&data.region))
+ if (!region_maybe_clip(&data.region,
+ gc->pCompositeClip))
return;
sna_gc_ops__tmp.FillSpans = sna_fill_spans__gpu;
fallback:
DBG(("%s -- fallback\n", __FUNCTION__));
- region_maybe_clip(&data.region, gc->pCompositeClip);
- if (RegionNil(&data.region))
+ if (!region_maybe_clip(&data.region, gc->pCompositeClip))
return;
if (!sna_gc_move_to_cpu(gc, drawable, &data.region))
RegionRec clip;
region_set(&clip, extents);
- region_maybe_clip(&clip, gc->pCompositeClip);
- if (RegionNil(&clip))
+ if (!region_maybe_clip(&clip, gc->pCompositeClip))
goto done;
if (clip.data == NULL) {
else
sna_gc_ops__tmp.FillSpans = sna_fill_spans__fill;
} else {
- region_maybe_clip(&data.region,
- gc->pCompositeClip);
- if (RegionNil(&data.region))
+ if (!region_maybe_clip(&data.region,
+ gc->pCompositeClip))
return;
if (region_is_singular(&data.region))
DBG(("%s: fallback (%d, %d), (%d, %d)\n", __FUNCTION__,
data.region.extents.x1, data.region.extents.y1,
data.region.extents.x2, data.region.extents.y2));
- region_maybe_clip(&data.region, gc->pCompositeClip);
- if (RegionNil(&data.region)) {
+ if (!region_maybe_clip(&data.region, gc->pCompositeClip)) {
DBG(("%s: nothing to do, all clipped\n", __FUNCTION__));
return;
}
uint16_t unwind_batch, unwind_reloc;
region_set(&clip, extents);
- region_maybe_clip(&clip, gc->pCompositeClip);
- if (RegionNil(&clip))
+ if (!region_maybe_clip(&clip, gc->pCompositeClip))
goto done;
unwind_batch = sna->kgem.nbatch;
RegionRec clip;
region_set(&clip, extents);
- region_maybe_clip(&clip, gc->pCompositeClip);
- if (RegionNil(&clip))
+ if (!region_maybe_clip(&clip, gc->pCompositeClip))
goto done;
if (clip.data == NULL) {
RegionRec clip;
region_set(&clip, extents);
- region_maybe_clip(&clip, gc->pCompositeClip);
- if (RegionNil(&clip))
+ if (!region_maybe_clip(&clip, gc->pCompositeClip))
return true;
b = sna->kgem.batch + sna->kgem.nbatch;
DDXPointRec pat;
region_set(&clip, extents);
- region_maybe_clip(&clip, gc->pCompositeClip);
- if (RegionNil(&clip))
+ if (!region_maybe_clip(&clip, gc->pCompositeClip))
return true;
pat.x = origin->x + drawable->x;
RegionRec clip;
region_set(&clip, extents);
- region_maybe_clip(&clip, gc->pCompositeClip);
- if (RegionNil(&clip)) {
+ if (!region_maybe_clip(&clip, gc->pCompositeClip)) {
DBG(("%s: all clipped\n", __FUNCTION__));
return true;
}
RegionRec clip;
region_set(&clip, extents);
- region_maybe_clip(&clip, gc->pCompositeClip);
- if (RegionNil(&clip)) {
+ if (!region_maybe_clip(&clip, gc->pCompositeClip)) {
DBG(("%s: all clipped\n", __FUNCTION__));
return true;
}
region.extents.x1, region.extents.y1,
region.extents.x2, region.extents.y2));
region.data = NULL;
- region_maybe_clip(®ion, gc->pCompositeClip);
- if (RegionNil(®ion)) {
+ if (!region_maybe_clip(®ion, gc->pCompositeClip)) {
DBG(("%s: nothing to do, all clipped\n", __FUNCTION__));
return;
}
else
sna_gc_ops__tmp.FillSpans = sna_fill_spans__fill;
} else {
- region_maybe_clip(&data.region,
- gc->pCompositeClip);
- if (RegionNil(&data.region))
+ if (!region_maybe_clip(&data.region,
+ gc->pCompositeClip))
return;
if (region_is_singular(&data.region))
DBG(("%s: fallback (%d, %d), (%d, %d)\n", __FUNCTION__,
data.region.extents.x1, data.region.extents.y1,
data.region.extents.x2, data.region.extents.y2));
- region_maybe_clip(&data.region, gc->pCompositeClip);
- if (RegionNil(&data.region)) {
+ if (!region_maybe_clip(&data.region, gc->pCompositeClip)) {
DBG(("%s: nothing to do, all clipped\n", __FUNCTION__));
return;
}
return x + extents.overallRight;
region.data = NULL;
- region_maybe_clip(®ion, gc->pCompositeClip);
- if (RegionNil(®ion))
+ if (!region_maybe_clip(®ion, gc->pCompositeClip))
return x + extents.overallRight;
if (FORCE_FALLBACK)
return x + extents.overallRight;
region.data = NULL;
- region_maybe_clip(®ion, gc->pCompositeClip);
- if (RegionNil(®ion))
+ if (!region_maybe_clip(®ion, gc->pCompositeClip))
return x + extents.overallRight;
if (FORCE_FALLBACK)
return;
region.data = NULL;
- region_maybe_clip(®ion, gc->pCompositeClip);
- if (RegionNil(®ion))
+ if (!region_maybe_clip(®ion, gc->pCompositeClip))
return;
DBG(("%s: clipped extents (%d, %d), (%d, %d)\n",
return;
region.data = NULL;
- region_maybe_clip(®ion, gc->pCompositeClip);
- if (RegionNil(®ion))
+ if (!region_maybe_clip(®ion, gc->pCompositeClip))
return;
DBG(("%s: clipped extents (%d, %d), (%d, %d)\n",
region.extents.x2, region.extents.y2));
region.data = NULL;
- region_maybe_clip(®ion, gc->pCompositeClip);
- if (RegionNil(®ion))
+ if (!region_maybe_clip(®ion, gc->pCompositeClip))
return;
if (FORCE_FALLBACK)
region.extents.x2, region.extents.y2));
region.data = NULL;
- region_maybe_clip(®ion, gc->pCompositeClip);
- if (RegionNil(®ion))
+ if (!region_maybe_clip(®ion, gc->pCompositeClip))
return;
if (FORCE_FALLBACK)
region.extents.x2, region.extents.y2));
region.data = NULL;
- region_maybe_clip(®ion, gc->pCompositeClip);
- if (RegionNil(®ion))
+ if (!region_maybe_clip(®ion, gc->pCompositeClip))
return;
switch (gc->fillStyle) {
RegionNull(&dst);
RegionIntersect(&dst, &win->borderClip, src);
- if (RegionNil(&dst))
+ if (box_empty(&dst.extents))
return;
#ifdef COMPOSITE