diff options
author | Paul Kocialkowski <paul.kocialkowski@linux.intel.com> | 2017-07-19 16:46:04 +0300 |
---|---|---|
committer | Lyude <lyude@redhat.com> | 2017-07-19 12:02:36 -0400 |
commit | b4ad397e1741529aade88c4421430c12f0eaf209 (patch) | |
tree | 5693f33378b74bc5dbbf2bd0d160fa0e92fdcfe7 /lib/igt_chamelium.c | |
parent | fb1ddc47003ad6a683db79beeb81b6cbab1feb7c (diff) |
lib/igt_fb: Export the cairo surface instead of writing to a png
This removes the igt_write_fb_to_png function (that was unused thus far)
and exports the igt_get_cairo_surface function to grab the matching
cairo surface. Writing to a png is now handled by the common frame
handling code in lib/igt_frame.
This also fixes how the surface is retreived in chamelium code,
which avoids destroying it too early.
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com>
Reviewed-by: Lyude <lyude@redhat.com>
Diffstat (limited to 'lib/igt_chamelium.c')
-rw-r--r-- | lib/igt_chamelium.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c index bff08c0e..93392af7 100644 --- a/lib/igt_chamelium.c +++ b/lib/igt_chamelium.c @@ -936,17 +936,13 @@ void chamelium_assert_frame_eq(const struct chamelium *chamelium, const struct chamelium_frame_dump *dump, struct igt_fb *fb) { - cairo_t *cr; cairo_surface_t *fb_surface; pixman_image_t *reference_src, *reference_bgr; int w = dump->width, h = dump->height; bool eq; /* Get the cairo surface for the framebuffer */ - cr = igt_get_cairo_ctx(chamelium->drm_fd, fb); - fb_surface = cairo_get_target(cr); - cairo_surface_reference(fb_surface); - cairo_destroy(cr); + fb_surface = igt_get_cairo_surface(chamelium->drm_fd, fb); /* * Convert the reference image into the same format as the chamelium @@ -964,7 +960,6 @@ void chamelium_assert_frame_eq(const struct chamelium *chamelium, dump->size) == 0; pixman_image_unref(reference_bgr); - cairo_surface_destroy(fb_surface); igt_fail_on_f(!eq, "Chamelium frame dump didn't match reference image\n"); |