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/kms_plane.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'tests/kms_plane.c') diff --git a/tests/kms_plane.c b/tests/kms_plane.c index 9672763f..54bcffc1 100644 --- a/tests/kms_plane.c +++ b/tests/kms_plane.c @@ -138,8 +138,7 @@ create_fb_for_mode__position(data_t *data, drmModeModeInfo *mode, igt_paint_color(cr, 0, 0, mode->hdisplay, mode->vdisplay, 0.0, 1.0, 0.0); igt_paint_color(cr, rect_x, rect_y, rect_w, rect_h, 0.0, 0.0, 0.0); - igt_assert(cairo_status(cr) == 0); - cairo_destroy(cr); + igt_put_cairo_ctx(data->drm_fd, fb, cr); } enum { @@ -279,8 +278,7 @@ create_fb_for_mode__panning(data_t *data, drmModeModeInfo *mode, mode->hdisplay, mode->vdisplay, 0.0, 0.0, 1.0); - igt_assert(cairo_status(cr) == 0); - cairo_destroy(cr); + igt_put_cairo_ctx(data->drm_fd, fb, cr); } enum { @@ -436,8 +434,7 @@ static void test_format_plane(data_t *data, enum pipe pipe, 0.0, 1.0, 0.0); if (width >= 164 && height >= 164) igt_paint_color(cr, 100, 100, 64, 64, 0.0, 0.0, 0.0); - igt_assert(cairo_status(cr) == 0); - cairo_destroy(cr); + igt_put_cairo_ctx(data->drm_fd, &fb, cr); igt_plane_set_fb(plane, &fb); igt_display_commit2(&data->display, COMMIT_UNIVERSAL); -- cgit v1.2.3