diff options
author | Andrew Stormont <astormont@racktopsystems.com> | 2020-08-13 16:26:52 +0100 |
---|---|---|
committer | Andrew Stormont <astormont@racktopsystems.com> | 2020-11-25 09:25:26 +0000 |
commit | d45f07cb8d28ca0e38cd96d8f00243ba58192eec (patch) | |
tree | 4156f9a8b96de524dba96c431646f7675e711434 /usr/src/common | |
parent | c74a40a584c9d875009f725565896fd7e8ee38d6 (diff) | |
download | illumos-joyent-d45f07cb8d28ca0e38cd96d8f00243ba58192eec.tar.gz |
13060 loader: fb-putimage fails silently even with debug flag set
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Andy Fiddaman <andy@omniosce.org>
Approved by: Robert Mustacchi <rm@fingolfin.org>
Diffstat (limited to 'usr/src/common')
-rw-r--r-- | usr/src/common/ficl/emu/gfx_fb.h | 6 | ||||
-rw-r--r-- | usr/src/common/ficl/loader.c | 7 |
2 files changed, 12 insertions, 1 deletions
diff --git a/usr/src/common/ficl/emu/gfx_fb.h b/usr/src/common/ficl/emu/gfx_fb.h index 4dfb386f5b..8499bff455 100644 --- a/usr/src/common/ficl/emu/gfx_fb.h +++ b/usr/src/common/ficl/emu/gfx_fb.h @@ -11,6 +11,7 @@ /* * Copyright 2016 Toomas Some <tsoome@me.com> + * Copyright 2020 RackTop Systems, Inc. */ #ifndef _GFX_FB_H @@ -59,6 +60,11 @@ void gfx_term_drawrect(uint32_t, uint32_t, uint32_t, uint32_t); void gfx_fb_line(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); void gfx_fb_bezier(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); + +#define FL_PUTIMAGE_BORDER 0x1 +#define FL_PUTIMAGE_NOSCROLL 0x2 +#define FL_PUTIMAGE_DEBUG 0x80 + int gfx_fb_putimage(png_t *, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); #ifdef __cplusplus diff --git a/usr/src/common/ficl/loader.c b/usr/src/common/ficl/loader.c index f1a1827eb0..c41c86c7c2 100644 --- a/usr/src/common/ficl/loader.c +++ b/usr/src/common/ficl/loader.c @@ -1,6 +1,7 @@ /* * Copyright (c) 2000 Daniel Capo Sobral * Copyright 2019 OmniOS Community Edition (OmniOSce) Association. + * Copyright 2020 RackTop Systems, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -79,6 +80,7 @@ ficl_fb_putimage(ficlVm *pVM) ficlInteger ret = FICL_FALSE; uint32_t x1, y1, x2, y2, f; png_t png; + int error; FICL_STACK_CHECK(ficlVmGetDataStack(pVM), 7, 1); @@ -96,7 +98,10 @@ ficl_fb_putimage(ficlVm *pVM) (void) strncpy(name, namep, names); name[names] = '\0'; - if (png_open(&png, name) == PNG_NO_ERROR) { + if ((error = png_open(&png, name)) != PNG_NO_ERROR) { + if (f & FL_PUTIMAGE_DEBUG) + printf("%s\n", png_error_string(error)); + } else { if (gfx_fb_putimage(&png, x1, y1, x2, y2, f) == 0) ret = FICL_TRUE; /* success */ (void) png_close(&png); |