mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-18 21:36:27 +00:00
lib: Add a helper to write a png from a struct kmstest_fb
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
This commit is contained in:
parent
dac45f5f06
commit
79f4cfedbf
@ -1648,6 +1648,17 @@ static cairo_t *create_cairo_ctx(int fd, struct kmstest_fb *fb)
|
|||||||
return cr;
|
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)
|
cairo_t *kmstest_get_cairo_ctx(int fd, struct kmstest_fb *fb)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -357,6 +357,7 @@ void kmstest_paint_color_gradient(cairo_t *cr, int x, int y, int w, int h,
|
|||||||
void kmstest_paint_test_pattern(cairo_t *cr, int width, int height);
|
void kmstest_paint_test_pattern(cairo_t *cr, int width, int height);
|
||||||
void kmstest_paint_image(cairo_t *cr, const char *filename,
|
void kmstest_paint_image(cairo_t *cr, const char *filename,
|
||||||
int dst_x, int dst_y, int dst_width, int dst_height);
|
int dst_x, int dst_y, int dst_width, int dst_height);
|
||||||
|
void kmstest_write_fb(int fd, struct kmstest_fb *fb, const char *filename);
|
||||||
void kmstest_dump_mode(drmModeModeInfo *mode);
|
void kmstest_dump_mode(drmModeModeInfo *mode);
|
||||||
int kmstest_get_pipe_from_crtc_id(int fd, int crtc_id);
|
int kmstest_get_pipe_from_crtc_id(int fd, int crtc_id);
|
||||||
const char *kmstest_format_str(uint32_t drm_format);
|
const char *kmstest_format_str(uint32_t drm_format);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user