You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-26 15:46:23 +00:00
Update HarfBuzz, ICU and FreeType
HarfBuzz: Update to version 7.3.0 ICU4C: Update to version 73.1 FreeType: Update to version 2.13.0
This commit is contained in:
31
thirdparty/harfbuzz/src/hb-cairo-utils.cc
vendored
31
thirdparty/harfbuzz/src/hb-cairo-utils.cc
vendored
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright © 2022 Red Hat, Inc
|
||||
* Copyright © 2021, 2022 Black Foundry
|
||||
*
|
||||
* This is part of HarfBuzz, a text shaping library.
|
||||
*
|
||||
@@ -32,9 +33,13 @@
|
||||
|
||||
#include <cairo.h>
|
||||
|
||||
#define PREALLOCATED_COLOR_STOPS 16
|
||||
/* Some routines in this file were ported from BlackRenderer by Black Foundry.
|
||||
* Used by permission to relicense to HarfBuzz license.
|
||||
*
|
||||
* https://github.com/BlackFoundryCom/black-renderer
|
||||
*/
|
||||
|
||||
#define _2_M_PIf (2.f * float (M_PI))
|
||||
#define PREALLOCATED_COLOR_STOPS 16
|
||||
|
||||
typedef struct {
|
||||
float r, g, b, a;
|
||||
@@ -518,7 +523,7 @@ _hb_cairo_add_patch (cairo_pattern_t *pattern, hb_cairo_point_t *center, hb_cair
|
||||
cairo_mesh_pattern_end_patch (pattern);
|
||||
}
|
||||
|
||||
#define MAX_ANGLE ((float) M_PI / 8.f)
|
||||
#define MAX_ANGLE (HB_PI / 8.f)
|
||||
|
||||
static void
|
||||
_hb_cairo_add_sweep_gradient_patches1 (float cx, float cy, float radius,
|
||||
@@ -601,7 +606,7 @@ _hb_cairo_add_sweep_gradient_patches (hb_color_stop_t *stops,
|
||||
start_angle, &c,
|
||||
pattern);
|
||||
}
|
||||
if (end_angle < _2_M_PIf)
|
||||
if (end_angle < HB_2_PI)
|
||||
{
|
||||
c.r = hb_color_get_red (stops[n_stops - 1].color) / 255.;
|
||||
c.g = hb_color_get_green (stops[n_stops - 1].color) / 255.;
|
||||
@@ -609,7 +614,7 @@ _hb_cairo_add_sweep_gradient_patches (hb_color_stop_t *stops,
|
||||
c.a = hb_color_get_alpha (stops[n_stops - 1].color) / 255.;
|
||||
_hb_cairo_add_sweep_gradient_patches1 (cx, cy, radius,
|
||||
end_angle, &c,
|
||||
_2_M_PIf, &c,
|
||||
HB_2_PI, &c,
|
||||
pattern);
|
||||
}
|
||||
}
|
||||
@@ -673,7 +678,7 @@ _hb_cairo_add_sweep_gradient_patches (hb_color_stop_t *stops,
|
||||
color0 = colors[n_stops-1];
|
||||
_hb_cairo_add_sweep_gradient_patches1 (cx, cy, radius,
|
||||
0., &color0,
|
||||
_2_M_PIf, &color0,
|
||||
HB_2_PI, &color0,
|
||||
pattern);
|
||||
goto done;
|
||||
}
|
||||
@@ -685,7 +690,7 @@ _hb_cairo_add_sweep_gradient_patches (hb_color_stop_t *stops,
|
||||
|
||||
for (pos++; pos < n_stops; pos++)
|
||||
{
|
||||
if (angles[pos] <= _2_M_PIf)
|
||||
if (angles[pos] <= HB_2_PI)
|
||||
{
|
||||
_hb_cairo_add_sweep_gradient_patches1 (cx, cy, radius,
|
||||
angles[pos - 1], &colors[pos-1],
|
||||
@@ -694,11 +699,11 @@ _hb_cairo_add_sweep_gradient_patches (hb_color_stop_t *stops,
|
||||
}
|
||||
else
|
||||
{
|
||||
float k = (_2_M_PIf - angles[pos - 1]) / (angles[pos] - angles[pos - 1]);
|
||||
float k = (HB_2_PI - angles[pos - 1]) / (angles[pos] - angles[pos - 1]);
|
||||
_hb_cairo_interpolate_colors (&colors[pos - 1], &colors[pos], k, &color1);
|
||||
_hb_cairo_add_sweep_gradient_patches1 (cx, cy, radius,
|
||||
angles[pos - 1], &colors[pos - 1],
|
||||
_2_M_PIf, &color1,
|
||||
HB_2_PI, &color1,
|
||||
pattern);
|
||||
break;
|
||||
}
|
||||
@@ -710,7 +715,7 @@ _hb_cairo_add_sweep_gradient_patches (hb_color_stop_t *stops,
|
||||
color0 = colors[n_stops - 1];
|
||||
_hb_cairo_add_sweep_gradient_patches1 (cx, cy, radius,
|
||||
angles[n_stops - 1], &color0,
|
||||
_2_M_PIf, &color0,
|
||||
HB_2_PI, &color0,
|
||||
pattern);
|
||||
goto done;
|
||||
}
|
||||
@@ -794,14 +799,14 @@ _hb_cairo_add_sweep_gradient_patches (hb_color_stop_t *stops,
|
||||
a1, c1,
|
||||
pattern);
|
||||
}
|
||||
else if (a1 >= _2_M_PIf)
|
||||
else if (a1 >= HB_2_PI)
|
||||
{
|
||||
hb_cairo_color_t color;
|
||||
float f = (_2_M_PIf - a0)/(a1 - a0);
|
||||
float f = (HB_2_PI - a0)/(a1 - a0);
|
||||
_hb_cairo_interpolate_colors (c0, c1, f, &color);
|
||||
_hb_cairo_add_sweep_gradient_patches1 (cx, cy, radius,
|
||||
a0, c0,
|
||||
_2_M_PIf, &color,
|
||||
HB_2_PI, &color,
|
||||
pattern);
|
||||
goto done;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user