mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-06-09 07:28:22 +02:00
quartz-font: silence compiler warnings
Remove an unused function, explicitly ignore or check return values, don't define unused variables.
This commit is contained in:
parent
ca161a585a
commit
9068b5768b
1 changed files with 30 additions and 54 deletions
|
|
@ -333,7 +333,8 @@ cairo_quartz_font_face_create_for_cgfont (CGFontRef font)
|
|||
|
||||
font_face = malloc (sizeof (cairo_quartz_font_face_t));
|
||||
if (!font_face) {
|
||||
_cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
cairo_status_t ignore_status;
|
||||
ignore_status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
return (cairo_font_face_t *)&_cairo_font_face_nil;
|
||||
}
|
||||
|
||||
|
|
@ -372,36 +373,6 @@ _cairo_quartz_scaled_glyph_index (cairo_scaled_glyph_t *scaled_glyph) {
|
|||
return (CGGlyph) index;
|
||||
}
|
||||
|
||||
static inline cairo_status_t
|
||||
_cairo_matrix_to_unit_quartz_matrix (const cairo_matrix_t *m, CGAffineTransform *txout,
|
||||
double *xout, double *yout)
|
||||
{
|
||||
CGAffineTransform transform;
|
||||
double xscale, yscale;
|
||||
cairo_status_t status;
|
||||
|
||||
status = _cairo_matrix_compute_basis_scale_factors (m, &xscale, &yscale, 1);
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
transform = CGAffineTransformMake (m->xx, - m->yx,
|
||||
- m->xy, m->yy,
|
||||
0.0f, 0.0f);
|
||||
if (xout)
|
||||
*xout = xscale;
|
||||
if (yout)
|
||||
*yout = yscale;
|
||||
|
||||
if (xscale)
|
||||
xscale = 1.0 / xscale;
|
||||
if (yscale)
|
||||
yscale = 1.0 / yscale;
|
||||
|
||||
*txout = CGAffineTransformScale (transform, xscale, yscale);
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static cairo_int_status_t
|
||||
_cairo_quartz_init_glyph_metrics (cairo_quartz_scaled_font_t *font,
|
||||
cairo_scaled_glyph_t *scaled_glyph)
|
||||
|
|
@ -410,7 +381,6 @@ _cairo_quartz_init_glyph_metrics (cairo_quartz_scaled_font_t *font,
|
|||
|
||||
cairo_quartz_font_face_t *font_face = _cairo_quartz_scaled_to_face(font);
|
||||
cairo_text_extents_t extents = {0, 0, 0, 0, 0, 0};
|
||||
CGAffineTransform textMatrix;
|
||||
CGGlyph glyph = _cairo_quartz_scaled_glyph_index (scaled_glyph);
|
||||
int advance;
|
||||
CGRect bbox;
|
||||
|
|
@ -497,17 +467,20 @@ static void
|
|||
_cairo_quartz_path_apply_func (void *info, const CGPathElement *el)
|
||||
{
|
||||
cairo_path_fixed_t *path = (cairo_path_fixed_t *) info;
|
||||
cairo_status_t status;
|
||||
|
||||
switch (el->type) {
|
||||
case kCGPathElementMoveToPoint:
|
||||
_cairo_path_fixed_move_to (path,
|
||||
_cairo_fixed_from_double(el->points[0].x),
|
||||
_cairo_fixed_from_double(el->points[0].y));
|
||||
status = _cairo_path_fixed_move_to (path,
|
||||
_cairo_fixed_from_double(el->points[0].x),
|
||||
_cairo_fixed_from_double(el->points[0].y));
|
||||
assert(!status);
|
||||
break;
|
||||
case kCGPathElementAddLineToPoint:
|
||||
_cairo_path_fixed_line_to (path,
|
||||
_cairo_fixed_from_double(el->points[0].x),
|
||||
_cairo_fixed_from_double(el->points[0].y));
|
||||
status = _cairo_path_fixed_line_to (path,
|
||||
_cairo_fixed_from_double(el->points[0].x),
|
||||
_cairo_fixed_from_double(el->points[0].y));
|
||||
assert(!status);
|
||||
break;
|
||||
case kCGPathElementAddQuadCurveToPoint: {
|
||||
cairo_fixed_t fx, fy;
|
||||
|
|
@ -517,26 +490,29 @@ _cairo_quartz_path_apply_func (void *info, const CGPathElement *el)
|
|||
x = _cairo_fixed_to_double (fx);
|
||||
y = _cairo_fixed_to_double (fy);
|
||||
|
||||
_cairo_path_fixed_curve_to (path,
|
||||
_cairo_fixed_from_double((x + el->points[0].x * 2.0) / 3.0),
|
||||
_cairo_fixed_from_double((y + el->points[0].y * 2.0) / 3.0),
|
||||
_cairo_fixed_from_double((el->points[0].x * 2.0 + el->points[1].x) / 3.0),
|
||||
_cairo_fixed_from_double((el->points[0].y * 2.0 + el->points[1].y) / 3.0),
|
||||
_cairo_fixed_from_double(el->points[1].x),
|
||||
_cairo_fixed_from_double(el->points[1].y));
|
||||
status = _cairo_path_fixed_curve_to (path,
|
||||
_cairo_fixed_from_double((x + el->points[0].x * 2.0) / 3.0),
|
||||
_cairo_fixed_from_double((y + el->points[0].y * 2.0) / 3.0),
|
||||
_cairo_fixed_from_double((el->points[0].x * 2.0 + el->points[1].x) / 3.0),
|
||||
_cairo_fixed_from_double((el->points[0].y * 2.0 + el->points[1].y) / 3.0),
|
||||
_cairo_fixed_from_double(el->points[1].x),
|
||||
_cairo_fixed_from_double(el->points[1].y));
|
||||
}
|
||||
assert(!status);
|
||||
break;
|
||||
case kCGPathElementAddCurveToPoint:
|
||||
_cairo_path_fixed_curve_to (path,
|
||||
_cairo_fixed_from_double(el->points[0].x),
|
||||
_cairo_fixed_from_double(el->points[0].y),
|
||||
_cairo_fixed_from_double(el->points[1].x),
|
||||
_cairo_fixed_from_double(el->points[1].y),
|
||||
_cairo_fixed_from_double(el->points[2].x),
|
||||
_cairo_fixed_from_double(el->points[2].y));
|
||||
status = _cairo_path_fixed_curve_to (path,
|
||||
_cairo_fixed_from_double(el->points[0].x),
|
||||
_cairo_fixed_from_double(el->points[0].y),
|
||||
_cairo_fixed_from_double(el->points[1].x),
|
||||
_cairo_fixed_from_double(el->points[1].y),
|
||||
_cairo_fixed_from_double(el->points[2].x),
|
||||
_cairo_fixed_from_double(el->points[2].y));
|
||||
assert(!status);
|
||||
break;
|
||||
case kCGPathElementCloseSubpath:
|
||||
_cairo_path_fixed_close_path (path);
|
||||
status = _cairo_path_fixed_close_path (path);
|
||||
assert(!status);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -683,7 +659,7 @@ _cairo_quartz_init_glyph_surface (cairo_quartz_scaled_font_t *font,
|
|||
kCGImageAlphaOnly);
|
||||
|
||||
if (cgContext == NULL) {
|
||||
cairo_surface_destroy (surface);
|
||||
cairo_surface_destroy (&surface->base);
|
||||
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue