зеркало из https://github.com/mozilla/pjs.git
Make _cairo_scaled_font_glyph_device_extents() take an cairo_rectangle_int_t out param instead of cairo_rectangle_int16_t fixing an UMR in the process. b=413169 r+sr=vladimir a=mtschrep
This commit is contained in:
Родитель
f6dd11f2b8
Коммит
8f65a9bf5c
|
@ -586,6 +586,9 @@ static const cairo_surface_backend_t cairo_analysis_surface_backend = {
|
|||
_cairo_analysis_surface_fill,
|
||||
_cairo_analysis_surface_show_glyphs,
|
||||
NULL, /* snapshot */
|
||||
NULL, /* is_similar */
|
||||
NULL, /* reset */
|
||||
NULL, /* fill_stroke */
|
||||
};
|
||||
|
||||
cairo_surface_t *
|
||||
|
|
|
@ -1108,12 +1108,12 @@ cairo_status_t
|
|||
_cairo_scaled_font_glyph_device_extents (cairo_scaled_font_t *scaled_font,
|
||||
const cairo_glyph_t *glyphs,
|
||||
int num_glyphs,
|
||||
cairo_rectangle_int16_t *extents)
|
||||
cairo_rectangle_int_t *extents)
|
||||
{
|
||||
cairo_status_t status = CAIRO_STATUS_SUCCESS;
|
||||
int i;
|
||||
short min_x = INT16_MAX, max_x = INT16_MIN;
|
||||
short min_y = INT16_MAX, max_y = INT16_MIN;
|
||||
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 };
|
||||
|
||||
if (scaled_font->status)
|
||||
return scaled_font->status;
|
||||
|
@ -1140,16 +1140,16 @@ _cairo_scaled_font_glyph_device_extents (cairo_scaled_font_t *scaled_font,
|
|||
right = x + _cairo_fixed_integer_ceil(scaled_glyph->bbox.p2.x);
|
||||
bottom = y + _cairo_fixed_integer_ceil (scaled_glyph->bbox.p2.y);
|
||||
|
||||
if (left < min_x) min_x = left;
|
||||
if (right > max_x) max_x = right;
|
||||
if (top < min_y) min_y = top;
|
||||
if (bottom > max_y) max_y = bottom;
|
||||
if (left < min.x) min.x = left;
|
||||
if (right > max.x) max.x = right;
|
||||
if (top < min.y) min.y = top;
|
||||
if (bottom > max.y) max.y = bottom;
|
||||
}
|
||||
if (min_x < max_x && min_y < max_y) {
|
||||
extents->x = min_x;
|
||||
extents->width = max_x - min_x;
|
||||
extents->y = min_y;
|
||||
extents->height = max_y - min_y;
|
||||
if (min.x < max.x && min.y < max.y) {
|
||||
extents->x = min.x;
|
||||
extents->width = max.x - min.x;
|
||||
extents->y = min.y;
|
||||
extents->height = max.y - min.y;
|
||||
} else {
|
||||
extents->x = extents->y = 0;
|
||||
extents->width = extents->height = 0;
|
||||
|
|
|
@ -997,8 +997,7 @@ _cairo_surface_fallback_show_glyphs (cairo_surface_t *surface,
|
|||
return status;
|
||||
|
||||
if (_cairo_operator_bounded_by_mask (op)) {
|
||||
cairo_rectangle_int16_t glyph_extents;
|
||||
cairo_rectangle_int_t glyph_extents_full;
|
||||
cairo_rectangle_int_t glyph_extents;
|
||||
status = _cairo_scaled_font_glyph_device_extents (scaled_font,
|
||||
glyphs,
|
||||
num_glyphs,
|
||||
|
@ -1006,11 +1005,7 @@ _cairo_surface_fallback_show_glyphs (cairo_surface_t *surface,
|
|||
if (status)
|
||||
return status;
|
||||
|
||||
glyph_extents_full.x = glyph_extents.x;
|
||||
glyph_extents_full.y = glyph_extents.y;
|
||||
glyph_extents_full.width = glyph_extents.width;
|
||||
glyph_extents_full.height = glyph_extents.height;
|
||||
_cairo_rectangle_intersect (&extents, &glyph_extents_full);
|
||||
_cairo_rectangle_intersect (&extents, &glyph_extents);
|
||||
}
|
||||
|
||||
status = _cairo_clip_intersect_to_rectangle (surface->clip, &extents);
|
||||
|
|
|
@ -2411,7 +2411,7 @@ _cairo_xcb_surface_show_glyphs (void *abstract_dst,
|
|||
(cairo_surface_t **) &src,
|
||||
&attributes);
|
||||
} else {
|
||||
cairo_rectangle_int16_t glyph_extents;
|
||||
cairo_rectangle_int_t glyph_extents;
|
||||
|
||||
status = _cairo_scaled_font_glyph_device_extents (scaled_font,
|
||||
glyphs,
|
||||
|
|
|
@ -3215,7 +3215,7 @@ _cairo_xlib_surface_show_glyphs (void *abstract_dst,
|
|||
if (status)
|
||||
goto BAIL0;
|
||||
} else {
|
||||
cairo_rectangle_int16_t glyph_extents;
|
||||
cairo_rectangle_int_t glyph_extents;
|
||||
|
||||
status = _cairo_scaled_font_glyph_device_extents (scaled_font,
|
||||
glyphs,
|
||||
|
|
|
@ -1423,7 +1423,7 @@ cairo_private cairo_status_t
|
|||
_cairo_scaled_font_glyph_device_extents (cairo_scaled_font_t *scaled_font,
|
||||
const cairo_glyph_t *glyphs,
|
||||
int num_glyphs,
|
||||
cairo_rectangle_int16_t *extents);
|
||||
cairo_rectangle_int_t *extents);
|
||||
|
||||
cairo_private cairo_status_t
|
||||
_cairo_scaled_font_show_glyphs (cairo_scaled_font_t *scaled_font,
|
||||
|
|
Загрузка…
Ссылка в новой задаче