[cairo] Use hb_qsort

This commit is contained in:
Behdad Esfahbod 2022-12-26 16:52:53 -07:00
parent 21573265e9
commit 5fdfe6ae5d
1 changed files with 2 additions and 2 deletions

View File

@ -253,7 +253,7 @@ _hb_cairo_normalize_color_line (hb_color_stop_t *stops,
{ {
float min, max; float min, max;
qsort (stops, len, sizeof (hb_color_stop_t), _hb_cairo_cmp_color_stop); hb_qsort (stops, len, sizeof (hb_color_stop_t), _hb_cairo_cmp_color_stop);
min = max = stops[0].offset; min = max = stops[0].offset;
for (unsigned int i = 0; i < len; i++) for (unsigned int i = 0; i < len; i++)
@ -808,7 +808,7 @@ hb_cairo_paint_sweep_gradient (cairo_t *cr,
stops = (hb_color_stop_t *) malloc (len * sizeof (hb_color_stop_t)); stops = (hb_color_stop_t *) malloc (len * sizeof (hb_color_stop_t));
hb_color_line_get_color_stops (color_line, 0, &len, stops); hb_color_line_get_color_stops (color_line, 0, &len, stops);
qsort (stops, len, sizeof (hb_color_stop_t), _hb_cairo_cmp_color_stop); hb_qsort (stops, len, sizeof (hb_color_stop_t), _hb_cairo_cmp_color_stop);
cairo_clip_extents (cr, &x1, &y1, &x2, &y2); cairo_clip_extents (cr, &x1, &y1, &x2, &y2);
max_x = (float) hb_max ((x1 - (double) cx) * (x1 - (double) cx), (x2 - (double) cx) * (x2 - (double) cx)); max_x = (float) hb_max ((x1 - (double) cx) * (x1 - (double) cx), (x2 - (double) cx) * (x2 - (double) cx));