Use push_or_fail in raster SVG paths

This commit is contained in:
Behdad Esfahbod committed 2026-03-09 23:09:41 -03:00
1 parent 2329724c1e
commit a940e06ff4
3 files changed
+3 -6

No files matched your search

+1 -2
View File
@@ -83,8 +83,7 @@ svg_clip_append_shape (hb_svg_clip_collect_context_t *ctx,
clip_shape.has_transform = true;
clip_shape.transform = transform;
}
ctx->defs->clip_shapes.push (clip_shape);
if (likely (!ctx->defs->clip_shapes.in_error ()))
if (likely (ctx->defs->clip_shapes.push_or_fail (clip_shape)))
ctx->clip->shape_count++;
else if (ctx->had_alloc_failure)
*ctx->had_alloc_failure = true;
+1 -2
View File
@@ -147,8 +147,7 @@ hb_raster_svg_emit_fill (const hb_svg_fill_context_t *ctx,
if (unlikely (!node.visit ((uintptr_t) cur)))
break;
chain.push (cur);
if (unlikely (chain.in_error ()))
if (unlikely (!chain.push_or_fail (cur)))
{
if (fallback_paint.len)
hb_raster_svg_emit_fill (ctx, fallback_paint, fill_opacity, object_bbox, current_color);
+1 -2
View File
@@ -90,8 +90,7 @@ svg_parse_gradient_stop (hb_svg_xml_parser_t &parser,
stop.offset = offset;
stop.color = color;
stop.is_current_color = is_current_color;
grad.stops.push (stop);
return !grad.stops.in_error ();
return grad.stops.push_or_fail (stop);
}
static void