From: Damien Lespiau Date: Fri, 6 Sep 2013 16:26:32 +0000 (+0100) Subject: lib: Split create_image_surface() out of create_cairo_ctx() X-Git-Tag: intel-gpu-tools-1.5~154 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dac45f5f067136496a76bf755a3df0224a2c3ea4;p=profile%2Fextras%2Fintel-gpu-tools.git lib: Split create_image_surface() out of create_cairo_ctx() So we can use it in the next commit. Signed-off-by: Damien Lespiau --- diff --git a/lib/drmtest.c b/lib/drmtest.c index d9749d7..cf442a0 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -1620,9 +1620,8 @@ static cairo_format_t drm_format_to_cairo(uint32_t drm_format) abort(); } -static cairo_t *create_cairo_ctx(int fd, struct kmstest_fb *fb) +static cairo_surface_t *create_image_surface(int fd, struct kmstest_fb *fb) { - cairo_t *cr; cairo_surface_t *surface; cairo_format_t cformat; void *fb_ptr; @@ -1633,6 +1632,16 @@ static cairo_t *create_cairo_ctx(int fd, struct kmstest_fb *fb) cformat, fb->width, fb->height, fb->stride); assert(surface); + + return surface; +} + +static cairo_t *create_cairo_ctx(int fd, struct kmstest_fb *fb) +{ + cairo_t *cr; + cairo_surface_t *surface; + + surface = create_image_surface(fd, fb); cr = cairo_create(surface); cairo_surface_destroy(surface);