[paint] Continue returning bool from paint_image()

6ccbfabd4f (commitcomment-94127307)
This commit is contained in:
Behdad Esfahbod 2022-12-24 10:56:06 -07:00
parent 6ccbfabd4f
commit f70c5d6f0d
4 changed files with 28 additions and 25 deletions

View File

@ -882,13 +882,16 @@ hb_ft_paint_glyph (hb_font_t *font,
if (!hb_font_get_glyph_extents (font, gid, &extents))
goto out;
paint_funcs->image (paint_data,
blob,
bitmap.width,
bitmap.rows,
HB_PAINT_IMAGE_FORMAT_BGRA,
font->slant_xy,
&extents);
if (!paint_funcs->image (paint_data,
blob,
bitmap.width,
bitmap.rows,
HB_PAINT_IMAGE_FORMAT_BGRA,
font->slant_xy,
&extents))
{
/* TODO Try a forced outline load and paint? */
}
out:
hb_blob_destroy (blob);

View File

@ -961,17 +961,17 @@ struct CBDT
extents.x_bearing + extents.width,
extents.y_bearing + extents.height);
funcs->image (data,
blob,
pixel_extents.width, -pixel_extents.height,
HB_PAINT_IMAGE_FORMAT_PNG,
font->slant_xy,
&extents);
bool ret = funcs->image (data,
blob,
pixel_extents.width, -pixel_extents.height,
HB_PAINT_IMAGE_FORMAT_PNG,
font->slant_xy,
&extents);
funcs->pop_clip (data);
hb_blob_destroy (blob);
return true;
return ret;
}
private:

View File

@ -253,15 +253,15 @@ struct sbix
if (unlikely (!get_extents (font, glyph, &pixel_extents, false)))
return false;
funcs->image (data,
blob,
pixel_extents.width, -pixel_extents.height,
HB_PAINT_IMAGE_FORMAT_PNG,
font->slant_xy,
&extents);
bool ret = funcs->image (data,
blob,
pixel_extents.width, -pixel_extents.height,
HB_PAINT_IMAGE_FORMAT_PNG,
font->slant_xy,
&extents);
hb_blob_destroy (blob);
return true;
return ret;
}
private:

View File

@ -97,15 +97,15 @@ struct hb_paint_funcs_t
{ func.color (this, paint_data,
is_foreground, color,
!user_data ? nullptr : user_data->color); }
void image (void *paint_data,
bool image (void *paint_data,
hb_blob_t *image,
unsigned width, unsigned height,
hb_tag_t format,
float slant,
hb_glyph_extents_t *extents)
{ func.image (this, paint_data,
image, width, height, format, slant, extents,
!user_data ? nullptr : user_data->image); }
{ return func.image (this, paint_data,
image, width, height, format, slant, extents,
!user_data ? nullptr : user_data->image); }
void linear_gradient (void *paint_data,
hb_color_line_t *color_line,
float x0, float y0,