[igt-dev] [PATCH i-g-t 6/6] HACK: lib/igt_fb: Paint diagonals
Ville Syrjala
ville.syrjala at linux.intel.com
Tue Mar 10 14:18:30 UTC 2020
From: Ville Syrjälä <ville.syrjala at linux.intel.com>
Paint diagonals on the standard test pattern so that scaling
artifacts are more readily visible.
Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
lib/igt_fb.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 0c4fdc5d4889..cc57493e01c5 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1479,6 +1479,18 @@ paint_marker(cairo_t *cr, int x, int y)
igt_cairo_printf_line(cr, align, 0, "(%d, %d)", x, y);
}
+static void
+paint_diagonals(cairo_t *cr, int w, int h)
+{
+ cairo_move_to(cr, 0, 0);
+ cairo_line_to(cr, w, h);
+ cairo_move_to(cr, 0, h);
+ cairo_line_to(cr, w, 0);
+ cairo_set_source_rgb(cr, 1, 1, 1);
+ cairo_set_line_width(cr, 1);
+ cairo_stroke(cr);
+}
+
/**
* igt_paint_test_pattern:
* @cr: cairo drawing context
@@ -1499,6 +1511,8 @@ void igt_paint_test_pattern(cairo_t *cr, int width, int height)
cairo_set_line_cap(cr, CAIRO_LINE_CAP_SQUARE);
+ paint_diagonals(cr, width, height);
+
/* Paint corner markers */
paint_marker(cr, 0, 0);
paint_marker(cr, width, 0);
--
2.24.1
More information about the igt-dev
mailing list