diff --git a/src/hb-raster-draw.cc b/src/hb-raster-draw.cc index 9333b1a11..cbbcd2fc4 100644 --- a/src/hb-raster-draw.cc +++ b/src/hb-raster-draw.cc @@ -246,8 +246,8 @@ hb_raster_draw_set_scale_factor (hb_raster_draw_t *draw, /** * hb_raster_draw_get_scale_factor: * @draw: a rasterizer - * @x_scale_factor: (out) (optional): x-axis minification factor - * @y_scale_factor: (out) (optional): y-axis minification factor + * @x_scale_factor: (out) (nullable): x-axis minification factor + * @y_scale_factor: (out) (nullable): y-axis minification factor * * Fetches the current post-transform minification factors. * @@ -265,12 +265,12 @@ hb_raster_draw_get_scale_factor (hb_raster_draw_t *draw, /** * hb_raster_draw_get_transform: * @draw: a rasterizer - * @xx: (out) (optional): xx component of the transform matrix - * @yx: (out) (optional): yx component of the transform matrix - * @xy: (out) (optional): xy component of the transform matrix - * @yy: (out) (optional): yy component of the transform matrix - * @dx: (out) (optional): x translation - * @dy: (out) (optional): y translation + * @xx: (out) (nullable): xx component of the transform matrix + * @yx: (out) (nullable): yx component of the transform matrix + * @xy: (out) (nullable): xy component of the transform matrix + * @yy: (out) (nullable): yy component of the transform matrix + * @dx: (out) (nullable): x translation + * @dy: (out) (nullable): y translation * * Fetches the current affine transform of the rasterizer. * diff --git a/src/hb-raster-image.cc b/src/hb-raster-image.cc index 59d477609..7a6fde979 100644 --- a/src/hb-raster-image.cc +++ b/src/hb-raster-image.cc @@ -582,7 +582,7 @@ hb_raster_image_get_buffer (hb_raster_image_t *image) /** * hb_raster_image_get_extents: * @image: a raster image - * @extents: (out): the image extents + * @extents: (out) (nullable): the image extents * * Fetches the pixel-buffer extents of @image. * @@ -592,7 +592,8 @@ void hb_raster_image_get_extents (hb_raster_image_t *image, hb_raster_extents_t *extents) { - *extents = image->extents; + if (extents) + *extents = image->extents; } /** diff --git a/src/hb-raster-paint.cc b/src/hb-raster-paint.cc index b093bf666..22606f08a 100644 --- a/src/hb-raster-paint.cc +++ b/src/hb-raster-paint.cc @@ -1758,6 +1758,34 @@ hb_raster_paint_set_transform (hb_raster_paint_t *paint, paint->base_transform = {xx, yx, xy, yy, dx, dy}; } +/** + * hb_raster_paint_get_transform: + * @paint: a paint context + * @xx: (out) (nullable): xx component of the transform matrix + * @yx: (out) (nullable): yx component of the transform matrix + * @xy: (out) (nullable): xy component of the transform matrix + * @yy: (out) (nullable): yy component of the transform matrix + * @dx: (out) (nullable): x translation + * @dy: (out) (nullable): y translation + * + * Gets the current base 2x3 affine transform. + * + * XSince: REPLACEME + **/ +void +hb_raster_paint_get_transform (hb_raster_paint_t *paint, + float *xx, float *yx, + float *xy, float *yy, + float *dx, float *dy) +{ + if (xx) *xx = paint->base_transform.xx; + if (yx) *yx = paint->base_transform.yx; + if (xy) *xy = paint->base_transform.xy; + if (yy) *yy = paint->base_transform.yy; + if (dx) *dx = paint->base_transform.x0; + if (dy) *dy = paint->base_transform.y0; +} + /** * hb_raster_paint_set_scale_factor: * @paint: a paint context @@ -1781,8 +1809,8 @@ hb_raster_paint_set_scale_factor (hb_raster_paint_t *paint, /** * hb_raster_paint_get_scale_factor: * @paint: a paint context - * @x_scale_factor: (out) (optional): x-axis minification factor - * @y_scale_factor: (out) (optional): y-axis minification factor + * @x_scale_factor: (out) (nullable): x-axis minification factor + * @y_scale_factor: (out) (nullable): y-axis minification factor * * Fetches the current post-transform minification factors. * diff --git a/src/hb-vector-svg.cc b/src/hb-vector-svg.cc index fc8b52333..b7e637877 100644 --- a/src/hb-vector-svg.cc +++ b/src/hb-vector-svg.cc @@ -1856,12 +1856,12 @@ hb_vector_draw_set_transform (hb_vector_draw_t *draw, /** * hb_vector_draw_get_transform: * @draw: a draw context. - * @xx: (out) (optional): transform xx component. - * @yx: (out) (optional): transform yx component. - * @xy: (out) (optional): transform xy component. - * @yy: (out) (optional): transform yy component. - * @dx: (out) (optional): transform x translation. - * @dy: (out) (optional): transform y translation. + * @xx: (out) (nullable): transform xx component. + * @yx: (out) (nullable): transform yx component. + * @xy: (out) (nullable): transform xy component. + * @yy: (out) (nullable): transform yy component. + * @dx: (out) (nullable): transform x translation. + * @dy: (out) (nullable): transform y translation. * * Gets the affine transform used when drawing glyphs. * @@ -1893,8 +1893,8 @@ hb_vector_draw_set_scale_factor (hb_vector_draw_t *draw, /** * hb_vector_draw_get_scale_factor: * @draw: a draw context. - * @x_scale_factor: (out) (optional): x scale factor. - * @y_scale_factor: (out) (optional): y scale factor. + * @x_scale_factor: (out) (nullable): x scale factor. + * @y_scale_factor: (out) (nullable): y scale factor. * * Gets additional output scaling factors. * @@ -2307,12 +2307,12 @@ hb_vector_paint_set_transform (hb_vector_paint_t *paint, /** * hb_vector_paint_get_transform: * @paint: a paint context. - * @xx: (out) (optional): transform xx component. - * @yx: (out) (optional): transform yx component. - * @xy: (out) (optional): transform xy component. - * @yy: (out) (optional): transform yy component. - * @dx: (out) (optional): transform x translation. - * @dy: (out) (optional): transform y translation. + * @xx: (out) (nullable): transform xx component. + * @yx: (out) (nullable): transform yx component. + * @xy: (out) (nullable): transform xy component. + * @yy: (out) (nullable): transform yy component. + * @dx: (out) (nullable): transform x translation. + * @dy: (out) (nullable): transform y translation. * * Gets the affine transform used when painting glyphs. * @@ -2344,8 +2344,8 @@ hb_vector_paint_set_scale_factor (hb_vector_paint_t *paint, /** * hb_vector_paint_get_scale_factor: * @paint: a paint context. - * @x_scale_factor: (out) (optional): x scale factor. - * @y_scale_factor: (out) (optional): y scale factor. + * @x_scale_factor: (out) (nullable): x scale factor. + * @y_scale_factor: (out) (nullable): y scale factor. * * Gets additional output scaling factors. *