diff options
author | Damien Lespiau <damien.lespiau@intel.com> | 2013-09-06 18:22:53 +0100 |
---|---|---|
committer | Damien Lespiau <damien.lespiau@intel.com> | 2013-09-30 18:04:21 +0100 |
commit | 79f4cfedbf8f4249291c0915d040d79af97d1389 (patch) | |
tree | 9d66ba4710e84187b85618c24efe1393b059fcd6 /lib/drmtest.c | |
parent | dac45f5f067136496a76bf755a3df0224a2c3ea4 (diff) |
lib: Add a helper to write a png from a struct kmstest_fb
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Diffstat (limited to 'lib/drmtest.c')
-rw-r--r-- | lib/drmtest.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/drmtest.c b/lib/drmtest.c index cf442a00..5ff9b5f5 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -1648,6 +1648,17 @@ static cairo_t *create_cairo_ctx(int fd, struct kmstest_fb *fb) return cr; } +void kmstest_write_fb(int fd, struct kmstest_fb *fb, const char *filename) +{ + cairo_surface_t *surface; + cairo_status_t status; + + surface = create_image_surface(fd, fb); + status = cairo_surface_write_to_png(surface, filename); + assert(status == CAIRO_STATUS_SUCCESS); + cairo_surface_destroy(surface); +} + cairo_t *kmstest_get_cairo_ctx(int fd, struct kmstest_fb *fb) { |