b=413878, even more cairo upgrades

This commit is contained in:
vladimir@pobox.com 2008-01-25 16:25:22 -08:00
Родитель 6490b1452b
Коммит 887e5c650b
5 изменённых файлов: 37 добавлений и 24 удалений

Просмотреть файл

@ -7,7 +7,7 @@ http://www.cairographics.org/.
VERSIONS:
cairo (1.5.x - 1.5.6-65-gea9afec)
cairo (1.5.x - 1.5.6-75-gc621d8d)
pixman (0.9.x - pixman-0.9.6-34-g787cc57)
glitz 0.5.2 (cvs - 2006-01-10)

Просмотреть файл

@ -3575,10 +3575,7 @@ _cairo_pdf_surface_emit_type3_font_subset (cairo_pdf_surface_t *surface,
}
_cairo_pdf_surface_update_object (surface, subset_resource);
matrix = font_subset->scaled_font->scale;
status = cairo_matrix_invert (&matrix);
/* _cairo_scaled_font_init ensures the matrix is invertible */
assert (status == CAIRO_STATUS_SUCCESS);
matrix = font_subset->scaled_font->scale_inverse;
_cairo_output_stream_printf (surface->output,
"%d 0 obj\r\n"
"<< /Type /Font\r\n"

Просмотреть файл

@ -1,3 +1,4 @@
/* -*- Mode: c; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 8; -*- */
/* cairo - a vector graphics library with display and print output
*
* Copyright © 2003 University of Southern California
@ -754,10 +755,7 @@ _cairo_ps_surface_emit_type3_font_subset (cairo_ps_surface_t *surface,
"%% _cairo_ps_surface_emit_type3_font_subset\n");
#endif
matrix = font_subset->scaled_font->scale;
status = cairo_matrix_invert (&matrix);
/* _cairo_scaled_font_init ensures the matrix is invertible */
assert (status == CAIRO_STATUS_SUCCESS);
matrix = font_subset->scaled_font->scale_inverse;
_cairo_output_stream_printf (surface->final_stream,
"8 dict begin\n"
"/FontType 3 def\n"
@ -2104,7 +2102,7 @@ _cairo_ps_surface_emit_image (cairo_ps_surface_t *surface,
}
if (use_mask) {
mask_size = (image->width * image->height + 7)/8;
mask_size = ((image->width+7) / 8) * image->height;
mask = malloc (mask_size);
if (mask == NULL) {
status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
@ -2132,6 +2130,11 @@ _cairo_ps_surface_emit_image (cairo_ps_surface_t *surface,
rgb[i++] = (*pixel & 0x0000ff00) >> 8;
rgb[i++] = (*pixel & 0x000000ff) >> 0;
}
if (bit != 7) {
bit = 7;
byte++;
}
}
} else {
i = 0;

Просмотреть файл

@ -91,6 +91,7 @@ struct _cairo_scaled_font {
/* "live" scaled_font members */
cairo_matrix_t scale; /* font space => device space */
cairo_matrix_t scale_inverse; /* device space => font space */
cairo_font_extents_t extents; /* user space */
/* The mutex protects modification to all subsequent fields. */

Просмотреть файл

@ -191,6 +191,7 @@ const cairo_scaled_font_t _cairo_scaled_font_nil = {
CAIRO_HINT_STYLE_DEFAULT,
CAIRO_HINT_METRICS_DEFAULT} ,
{ 1., 0., 0., 1., 0, 0}, /* scale */
{ 1., 0., 0., 1., 0, 0}, /* scale_inverse */
{ 0., 0., 0., 0., 0. }, /* extents */
CAIRO_MUTEX_NIL_INITIALIZER,/* mutex */
NULL, /* glyphs */
@ -463,7 +464,6 @@ _cairo_scaled_font_init (cairo_scaled_font_t *scaled_font,
const cairo_font_options_t *options,
const cairo_scaled_font_backend_t *backend)
{
cairo_matrix_t inverse;
cairo_status_t status;
if (options != NULL) {
@ -472,8 +472,6 @@ _cairo_scaled_font_init (cairo_scaled_font_t *scaled_font,
return status;
}
/* Initialize scaled_font->scale early for easier bail out on an
* invalid matrix. */
_cairo_scaled_font_init_key (scaled_font, font_face,
font_matrix, ctm, options);
@ -481,10 +479,27 @@ _cairo_scaled_font_init (cairo_scaled_font_t *scaled_font,
&scaled_font->font_matrix,
&scaled_font->ctm);
inverse = scaled_font->scale;
status = cairo_matrix_invert (&inverse);
if (status)
return status;
scaled_font->scale_inverse = scaled_font->scale;
status = cairo_matrix_invert (&scaled_font->scale_inverse);
if (status) {
/* If the font scale matrix is rank 0, just using an all-zero inverse matrix
* makes everything work correctly. This make font size 0 work without
* producing an error.
*
* FIXME: If the scale is rank 1, we still go into error mode. But then
* again, that's what we doo everywhere in cairo.
*
* Also, the check for == 0. below may bee too harsh...
*/
if (scaled_font->scale.xx == 0. && scaled_font->scale.xy == 0. &&
scaled_font->scale.yx == 0. && scaled_font->scale.yy == 0.)
cairo_matrix_init (&scaled_font->scale_inverse,
0, 0, 0, 0,
-scaled_font->scale.x0,
-scaled_font->scale.y0);
else
return status;
}
scaled_font->glyphs = _cairo_cache_create (_cairo_scaled_glyph_keys_equal,
_cairo_scaled_glyph_destroy,
@ -611,11 +626,8 @@ cairo_scaled_font_create (cairo_font_face_t *font_face,
return (cairo_scaled_font_t *)&_cairo_scaled_font_nil;
}
if (! _cairo_matrix_is_invertible (font_matrix))
return (cairo_scaled_font_t *)&_cairo_scaled_font_nil;
if (! _cairo_matrix_is_invertible (ctm))
return (cairo_scaled_font_t *)&_cairo_scaled_font_nil;
/* Note that degenerate ctm or font_matrix *are* allowed.
* We want to support a font size of 0. */
font_map = _cairo_scaled_font_map_lock ();
if (font_map == NULL)
@ -1130,8 +1142,8 @@ _cairo_scaled_font_glyph_device_extents (cairo_scaled_font_t *scaled_font,
{
cairo_status_t status = CAIRO_STATUS_SUCCESS;
int i;
cairo_point_int_t min = { CAIRO_RECT_INT_MIN, CAIRO_RECT_INT_MIN };
cairo_point_int_t max = { CAIRO_RECT_INT_MAX, CAIRO_RECT_INT_MAX };
cairo_point_int_t min = { CAIRO_RECT_INT_MAX, CAIRO_RECT_INT_MAX };
cairo_point_int_t max = { CAIRO_RECT_INT_MIN, CAIRO_RECT_INT_MIN };
if (scaled_font->status)
return scaled_font->status;