From be2f6fc1cba25372837daed6cec19107d44d3eb5 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Thu, 1 Feb 2018 12:48:45 +0100 Subject: lib/igt_fb: Add igt_put_cairo_ctx as counter to igt_get_cairo_ctx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will allow support for NV12 in the future, where igt_get_cairo_ctx will return a RGB image to draw with, which will be converted in igt_put_cairo_ctx so tests don't have to add special support for NV12. This is the same as cairo_destroy + checking for errors, but not all tests use this correctly so it's better to have a single handler for it. Signed-off-by: Maarten Lankhorst Reviewed-by: Ville Syrjälä --- tests/testdisplay.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'tests/testdisplay.c') diff --git a/tests/testdisplay.c b/tests/testdisplay.c index b0156c5c..0ff98a2b 100644 --- a/tests/testdisplay.c +++ b/tests/testdisplay.c @@ -227,9 +227,7 @@ paint_color_key(struct igt_fb *fb_info) cairo_set_source_rgb(cr, .8, .8, .8); cairo_fill(cr); - igt_assert(!cairo_status(cr)); - - cairo_destroy(cr); + igt_put_cairo_ctx(drm_fd, fb_info, cr); } static void paint_image(cairo_t *cr, const char *file) @@ -294,9 +292,7 @@ static void paint_output_info(struct connector *c, struct igt_fb *fb) if (qr_code) paint_image(cr, "pass.png"); - igt_assert(!cairo_status(cr)); - - cairo_destroy(cr); + igt_put_cairo_ctx(drm_fd, fb, cr); } static void sighandler(int signo) -- cgit v1.2.3