return true;
if (gen2_composite_fallback(sna, src, mask, dst))
- return false;
+ goto fallback;
if (need_tiling(sna, width, height))
return sna_tiling_composite(op, src, mask, dst,
dst_x, dst_y, width, height)) {
DBG(("%s: unable to set render target\n",
__FUNCTION__));
- return false;
+ goto fallback;
}
tmp->op = op;
if (!sna_render_composite_redirect(sna, tmp,
dst_x, dst_y, width, height,
op > PictOpSrc || dst->pCompositeClip->data != NULL))
- return false;
+ goto fallback;
}
switch (gen2_composite_picture(sna, src, &tmp->src,
return true;
cleanup_mask:
- if (tmp->mask.bo)
+ if (tmp->mask.bo) {
kgem_bo_destroy(&sna->kgem, tmp->mask.bo);
+ tmp->mask.bo = NULL;
+ }
cleanup_src:
- if (tmp->src.bo)
+ if (tmp->src.bo) {
kgem_bo_destroy(&sna->kgem, tmp->src.bo);
+ tmp->src.bo = NULL;
+ }
cleanup_dst:
- if (tmp->redirect.real_bo)
+ if (tmp->redirect.real_bo) {
kgem_bo_destroy(&sna->kgem, tmp->dst.bo);
- return false;
+ tmp->redirect.real_bo = NULL;
+ }
+fallback:
+ return (mask == NULL &&
+ sna_blt_composite(sna, op, src, dst,
+ src_x, src_y,
+ dst_x, dst_y,
+ width, height,
+ tmp, true));
}
fastcall static void
dst_x, dst_y, width, height)) {
DBG(("%s: unable to set render target\n",
__FUNCTION__));
- return false;
+ goto fallback;
}
tmp->op = op;
return true;
cleanup_mask:
- if (tmp->mask.bo)
+ if (tmp->mask.bo) {
kgem_bo_destroy(&sna->kgem, tmp->mask.bo);
+ tmp->mask.bo = NULL;
+ }
cleanup_src:
- if (tmp->src.bo)
+ if (tmp->src.bo) {
kgem_bo_destroy(&sna->kgem, tmp->src.bo);
+ tmp->src.bo = NULL;
+ }
cleanup_dst:
- if (tmp->redirect.real_bo)
+ if (tmp->redirect.real_bo) {
kgem_bo_destroy(&sna->kgem, tmp->dst.bo);
+ tmp->redirect.real_bo = NULL;
+ }
fallback:
return (mask == NULL &&
sna_blt_composite(sna,
return true;
if (gen4_composite_fallback(sna, src, mask, dst))
- return false;
+ goto fallback;
if (need_tiling(sna, width, height))
return sna_tiling_composite(op, src, mask, dst,
dst_x, dst_y, width, height,
op > PictOpSrc || dst->pCompositeClip->data)) {
DBG(("%s: failed to set composite target\n", __FUNCTION__));
- return false;
+ goto fallback;
}
tmp->op = op;
return true;
cleanup_mask:
- if (tmp->mask.bo)
+ if (tmp->mask.bo) {
kgem_bo_destroy(&sna->kgem, tmp->mask.bo);
+ tmp->mask.bo = NULL;
+ }
cleanup_src:
- if (tmp->src.bo)
+ if (tmp->src.bo) {
kgem_bo_destroy(&sna->kgem, tmp->src.bo);
+ tmp->src.bo = NULL;
+ }
cleanup_dst:
- if (tmp->redirect.real_bo)
+ if (tmp->redirect.real_bo) {
kgem_bo_destroy(&sna->kgem, tmp->dst.bo);
- return false;
+ tmp->redirect.real_bo = NULL;
+ }
+fallback:
+ return (mask == NULL &&
+ sna_blt_composite(sna, op,
+ src, dst,
+ src_x, src_y,
+ dst_x, dst_y,
+ width, height,
+ tmp, true));
}
#if !NO_COMPOSITE_SPANS
return true;
if (gen5_composite_fallback(sna, src, mask, dst))
- return false;
+ goto fallback;
if (need_tiling(sna, width, height))
return sna_tiling_composite(op, src, mask, dst,
dst_x, dst_y, width, height,
op > PictOpSrc || dst->pCompositeClip->data)) {
DBG(("%s: failed to set composite target\n", __FUNCTION__));
- return false;
+ goto fallback;
}
DBG(("%s: preparing source\n", __FUNCTION__));
return true;
cleanup_mask:
- if (tmp->mask.bo)
+ if (tmp->mask.bo) {
kgem_bo_destroy(&sna->kgem, tmp->mask.bo);
+ tmp->mask.bo = NULL;
+ }
cleanup_src:
- if (tmp->src.bo)
+ if (tmp->src.bo) {
kgem_bo_destroy(&sna->kgem, tmp->src.bo);
+ tmp->src.bo = NULL;
+ }
cleanup_dst:
- if (tmp->redirect.real_bo)
+ if (tmp->redirect.real_bo) {
kgem_bo_destroy(&sna->kgem, tmp->dst.bo);
- return false;
+ tmp->redirect.real_bo = NULL;
+ }
+fallback:
+ return (mask == NULL &&
+ sna_blt_composite(sna, op,
+ src, dst,
+ src_x, src_y,
+ dst_x, dst_y,
+ width, height,
+ tmp, true));
}
#if !NO_COMPOSITE_SPANS
return true;
if (gen6_composite_fallback(sna, src, mask, dst))
- return (mask == NULL &&
- sna_blt_composite(sna, op,
- src, dst,
- src_x, src_y,
- dst_x, dst_y,
- width, height,
- tmp, true));
+ goto fallback;
if (need_tiling(sna, width, height))
return sna_tiling_composite(op, src, mask, dst,
if (!gen6_composite_set_target(sna, tmp, dst,
dst_x, dst_y, width, height,
op > PictOpSrc || dst->pCompositeClip->data))
- return false;
+ goto fallback;
switch (gen6_composite_picture(sna, src, &tmp->src,
src_x, src_y,
return true;
cleanup_mask:
- if (tmp->mask.bo)
+ if (tmp->mask.bo) {
kgem_bo_destroy(&sna->kgem, tmp->mask.bo);
+ tmp->mask.bo = NULL;
+ }
cleanup_src:
- if (tmp->src.bo)
+ if (tmp->src.bo) {
kgem_bo_destroy(&sna->kgem, tmp->src.bo);
+ tmp->src.bo = NULL;
+ }
cleanup_dst:
- if (tmp->redirect.real_bo)
+ if (tmp->redirect.real_bo) {
kgem_bo_destroy(&sna->kgem, tmp->dst.bo);
- return false;
+ tmp->redirect.real_bo = NULL;
+ }
+fallback:
+ return (mask == NULL &&
+ sna_blt_composite(sna, op,
+ src, dst,
+ src_x, src_y,
+ dst_x, dst_y,
+ width, height,
+ tmp, true));
}
#if !NO_COMPOSITE_SPANS
return true;
if (gen7_composite_fallback(sna, src, mask, dst))
- return (mask == NULL &&
- sna_blt_composite(sna, op,
- src, dst,
- src_x, src_y,
- dst_x, dst_y,
- width, height,
- tmp, true));
+ goto fallback;
if (need_tiling(sna, width, height))
return sna_tiling_composite(op, src, mask, dst,
if (!gen7_composite_set_target(sna, tmp, dst,
dst_x, dst_y, width, height,
op > PictOpSrc || dst->pCompositeClip->data))
- return false;
+ goto fallback;
switch (gen7_composite_picture(sna, src, &tmp->src,
src_x, src_y,
return true;
cleanup_mask:
- if (tmp->mask.bo)
+ if (tmp->mask.bo) {
kgem_bo_destroy(&sna->kgem, tmp->mask.bo);
+ tmp->mask.bo = NULL;
+ }
cleanup_src:
- if (tmp->src.bo)
+ if (tmp->src.bo) {
kgem_bo_destroy(&sna->kgem, tmp->src.bo);
+ tmp->src.bo = NULL;
+ }
cleanup_dst:
- if (tmp->redirect.real_bo)
+ if (tmp->redirect.real_bo) {
kgem_bo_destroy(&sna->kgem, tmp->dst.bo);
- return false;
+ tmp->redirect.real_bo = NULL;
+ }
+fallback:
+ return (mask == NULL &&
+ sna_blt_composite(sna, op,
+ src, dst,
+ src_x, src_y,
+ dst_x, dst_y,
+ width, height,
+ tmp, true));
}
#if !NO_COMPOSITE_SPANS