test: dump color lines

This commit is contained in:
Matthias Clasen 2022-12-14 23:58:59 -05:00 committed by Behdad Esfahbod
parent 3937d6b0aa
commit d07fdc69dd
1 changed files with 21 additions and 5 deletions

View File

@ -28,13 +28,13 @@ print (paint_data_t *data,
static void static void
push_transform (hb_paint_funcs_t *funcs, push_transform (hb_paint_funcs_t *funcs,
void *paint_data, void *paint_data,
float xx, float xy, float xx, float yx,
float yx, float yy, float xy, float yy,
float x0, float y0, float dx, float dy,
void *user_data) void *user_data)
{ {
paint_data_t *data = user_data; paint_data_t *data = user_data;
print (data, "start transform %f %f %f %f %f %f", xx, xy, yx, yy, x0, y0); print (data, "start transform %f %f %f %f %f %f", xx, yx, xy, yy, dx, dy);
data->level++; data->level++;
} }
@ -101,7 +101,23 @@ linear_gradient (hb_paint_funcs_t *funcs,
void *user_data) void *user_data)
{ {
paint_data_t *data = user_data; paint_data_t *data = user_data;
unsigned int len;
hb_color_stop_t *stops;
len = hb_color_line_get_color_stops (color_line, 0, NULL, NULL);
stops = alloca (len * sizeof (hb_color_stop_t));
hb_color_line_get_color_stops (color_line, 0, &len, stops);
print (data, "linear gradient"); print (data, "linear gradient");
data->level += 1;
print (data, "p0 %f %f", x0, y0);
print (data, "p1 %f %f", x1, y1);
print (data, "p2 %f %f", x2, y2);
print (data, "colors");
data->level += 1;
for (unsigned int i = 0; i < len; i++)
print (data, "%f %u %f", stops[i].offset, stops[i].color_index, stops[i].alpha);
data->level -= 2;
} }
static void static void