kmstest: Fix up lifetimes of cairo objects

cairo_t is the short lived drawing context, whereas cairo_surface_t is
the heavyweight object that persists and is also tied to underlying GEM
objects. So make the kmstest API reflect the different weights and fix
the lifetime and underlying object reference leaks.

Based on the fix by Paulo Zanoni.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson
2013-12-30 17:48:43 +00:00
parent 9d6cfa6b59
commit 164d9d26ac
11 changed files with 48 additions and 37 deletions
+1
View File
@@ -100,6 +100,7 @@ connector_set_mode(data_t *data, connector_t *connector, drmModeModeInfo *mode)
kmstest_paint_color(cr, 0, 0, mode->hdisplay, mode->vdisplay,
0.0, 1.0, 0.0);
igt_assert(cairo_status(cr) == 0);
cairo_destroy(cr);
#if 0
fprintf(stdout, "Using pipe %c, %dx%d\n", pipe_name(config->pipe),