diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2017-04-18 12:33:09 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2017-04-18 12:33:09 +0200 |
commit | 85bb618f1bb8b2a73f3a37df56a88b858b1f1d46 (patch) | |
tree | 322e96e8a6ef1a35bda6e1eb9ebd5b489ae7ea14 /drmtest.c | |
parent | ec2fd3af076bacdfa90185b3e3bc26dd76f964c7 (diff) | |
download | drminfo-85bb618f1bb8b2a73f3a37df56a88b858b1f1d46.tar.gz |
image loading update
Diffstat (limited to 'drmtest.c')
-rw-r--r-- | drmtest.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -26,6 +26,7 @@ #include "drmtools.h" #include "render.h" +#include "image.h" /* ------------------------------------------------------------------ */ @@ -54,6 +55,9 @@ cairo_device_t *cd; cairo_surface_t *cs; cairo_t *cc; +/* user options */ +cairo_surface_t *image; + /* ------------------------------------------------------------------ */ static void drm_init_dev(int devnr, const char *output, @@ -178,7 +182,11 @@ static void drm_draw(const char *text) snprintf(info, sizeof(info), "drmtest: %dx%d at %s", mode->hdisplay, mode->vdisplay, name); cr = cairo_create(cs); - render_test(cr, mode->hdisplay, mode->vdisplay, info, text); + if (image) { + render_image(cr, mode->hdisplay, mode->vdisplay, image); + } else { + render_test(cr, mode->hdisplay, mode->vdisplay, info, text); + } cairo_destroy(cr); } @@ -401,6 +409,7 @@ static void usage(FILE *fp) " -c <nr> pick card\n" " -o <name> pick output\n" " -s <secs> set sleep time\n" + " -i <file> load and display image <file>\n" " -g openngl mode\n" #if 0 " -d debug mode (opengl)\n" @@ -418,7 +427,7 @@ int main(int argc, char **argv) int c; for (;;) { - c = getopt(argc, argv, "hgdc:s:o:"); + c = getopt(argc, argv, "hgdc:s:o:i:"); if (c == -1) break; switch (c) { @@ -428,6 +437,9 @@ int main(int argc, char **argv) case 's': secs = atoi(optarg); break; + case 'i': + image = load_image(optarg); + break; case 'o': output = optarg; break; |