Merge branch 'various-fixes' into 'master'

Various fixes

Closes #851, #850, #849, #848, #847, #846, and #845

See merge request cairo/cairo!570
This commit is contained in:
Adrian Johnson 2024-06-26 22:15:15 +00:00
commit 19c15cedbf
8 changed files with 23 additions and 11 deletions

View file

@ -318,7 +318,10 @@ _cairo_clip_intersect_boxes (cairo_clip_t *clip,
goto out;
}
_cairo_boxes_copy_to_clip (boxes, clip);
if (!_cairo_boxes_copy_to_clip (boxes, clip)) {
clip = _cairo_clip_set_all_clipped (clip);
goto out;
}
_cairo_boxes_extents (boxes, &limits);

View file

@ -2808,8 +2808,8 @@ _cairo_ft_scaled_glyph_init_record_colr_v1_glyph (cairo_ft_scaled_font_t *scaled
/* Copied from cairo-user-font.c */
cairo_matrix_t extent_scale;
double extent_x_scale;
double extent_y_scale;
double extent_x_scale = 1.0;
double extent_y_scale = 1.0;
double snap_x_scale;
double snap_y_scale;
double fixed_scale, x_scale, y_scale;

View file

@ -162,6 +162,10 @@ _cairo_stroker_init (cairo_stroker_t *stroker,
stroker->has_first_face = FALSE;
stroker->has_initial_sub_path = FALSE;
/* Coverity complains these may be unitialized. */
memset (&stroker->current_face, 0, sizeof (cairo_stroke_face_t));
memset (&stroker->first_face, 0, sizeof (cairo_stroke_face_t));
_cairo_stroker_dash_init (&stroker->dash, stroke_style);
stroker->add_external_edge = NULL;

View file

@ -1959,6 +1959,8 @@ _cairo_pdf_interchange_tag_end (cairo_pdf_surface_t *surface,
} else if (surface->paginated_mode == CAIRO_PAGINATED_MODE_RENDER) {
status = _cairo_tag_stack_pop (&ic->render_tag_stack, name, &elem);
} else {
ASSERT_NOT_REACHED;
}
if (unlikely (status))
return status;

View file

@ -3507,13 +3507,13 @@ _cairo_ps_surface_use_form (cairo_ps_surface_t *surface,
if (surface->ps_level == CAIRO_PS_LEVEL_3)
max_size = MAX_L3_FORM_DATA;
else
max_size = MAX_L3_FORM_DATA;
max_size = MAX_L2_FORM_DATA;
/* Don't add any more Forms if we exceed the form memory limit */
if (surface->total_form_size + params->approx_size > max_size)
return CAIRO_INT_STATUS_UNSUPPORTED;
surface->total_form_size += params->approx_size > max_size;
surface->total_form_size += params->approx_size;
unique_id = _cairo_malloc (source_key.unique_id_length);
if (unique_id == NULL)
return _cairo_error (CAIRO_STATUS_NO_MEMORY);

View file

@ -3013,11 +3013,11 @@ cairo_tag_end (cairo_t *cr, const char *tag_name)
* "sans-serif", "cursive", "fantasy", "monospace"), are likely to
* work as expected.
*
* If @family starts with the string "@cairo:", or if no native font
* If @family starts with the string "\@cairo:", or if no native font
* backends are compiled in, cairo will use an internal font family.
* The internal font family recognizes many modifiers in the @family
* string, most notably, it recognizes the string "monospace". That is,
* the family name "@cairo:monospace" will use the monospace version of
* the family name "\@cairo:monospace" will use the monospace version of
* the internal font family.
*
* For "real" font selection, see the font-backend-specific

View file

@ -79,10 +79,13 @@
*
* If the size check fails, manually check the output and if the
* surfaces are still embedded only once, update the expected sizes.
*
* Note: The PS2 output will embed the image more than once due to the
* lower MAX_L2_FORM_DATA for PS2 in cairo-ps-surface.c.
*/
#define PS2_EXPECTED_SIZE 417510
#define PS3_EXPECTED_SIZE 381554
#define PDF_EXPECTED_SIZE 162923
#define PS2_EXPECTED_SIZE 626926
#define PS3_EXPECTED_SIZE 381555
#define PDF_EXPECTED_SIZE 162692
#define SIZE_TOLERANCE 5000
static const char *png_filename = "romedalen.png";

View file

@ -1742,7 +1742,7 @@ _emit_image (cairo_surface_t *image,
break;
case CAIRO_FORMAT_A8:
for (row = height; row--; ) {
_write_data (&stream, rowdata, width);
_write_data (&stream, data, width);
data += stride;
}
break;