This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via 62f3b9db48fe5159efdfd4dd01d51242d37e4375 (commit) via 3f78c26fead7c7c20057735c752c841f754010a9 (commit) via 5f3a2c0ec123ae0b6db9994fa948b1b032204acc (commit) from cb3020fdd8ac170c98633ace520842f3c7d72896 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/62f3b9db48fe5159efdfd4dd01d51242d37e4...
commit 62f3b9db48fe5159efdfd4dd01d51242d37e4375 Author: Cyril Hrubis metan@ucw.cz Date: Mon Sep 2 21:21:08 2013 +0200
loaders: ZIP: Silence unused warning.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/libs/loaders/GP_ZIP.c b/libs/loaders/GP_ZIP.c index 42d08d5..83fe617 100644 --- a/libs/loaders/GP_ZIP.c +++ b/libs/loaders/GP_ZIP.c @@ -709,6 +709,7 @@ err0:
GP_Container *GP_OpenZip(const char *path) { + (void) path; GP_FATAL("zlib support not compiled in"); errno = ENOSYS; return NULL;
http://repo.or.cz/w/gfxprim.git/commit/3f78c26fead7c7c20057735c752c841f75401...
commit 3f78c26fead7c7c20057735c752c841f754010a9 Author: Cyril Hrubis metan@ucw.cz Date: Mon Sep 2 23:00:40 2013 +0200
backends: Linux FB: Fix error codepath.
Correctly uninitialize keyboard and console on failure.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/libs/backends/GP_LinuxFB.c b/libs/backends/GP_LinuxFB.c index 8e96684..2849a7a 100644 --- a/libs/backends/GP_LinuxFB.c +++ b/libs/backends/GP_LinuxFB.c @@ -202,6 +202,19 @@ static int allocate_console(struct fb_priv *fb, int flags) return 0; }
+void free_console(struct fb_priv *fb) +{ + /* restore blinking cursor */ + if (ioctl(fb->con_fd, KDSETMODE, KD_TEXT)) + GP_WARN("Failed to ioctl KDSETMODE (restore KDMODE)"); + + /* switch back console */ + if (fb->last_con_nr != -1) + ioctl(fb->con_fd, VT_ACTIVATE, fb->last_con_nr); + + close(fb->con_fd); +} + /* Backend API callbacks */
static void fb_poll(GP_Backend *self) @@ -239,19 +252,11 @@ static void fb_exit(GP_Backend *self) munmap(fb->fb_mem, fb->bsize); close(fb->fb_fd);
- /* restore blinking cursor */ - if (ioctl(fb->con_fd, KDSETMODE, KD_TEXT)) - GP_WARN("Failed to ioctl KDSETMODE (restore KDMODE)"); - - /* restore keyboard mode */ if (fb->flags & GP_FB_INPUT_KBD) exit_kbd(fb);
- /* switch back console */ - if (fb->last_con_nr != -1) - ioctl(fb->con_fd, VT_ACTIVATE, fb->last_con_nr); + free_console(fb);
- close(fb->con_fd); free(self); }
@@ -298,8 +303,8 @@ GP_Backend *GP_BackendLinuxFBInit(const char *path, int flags)
fb = GP_BACKEND_PRIV(backend);
- if (allocate_console(fb, flags & GP_FB_INPUT_KBD)) - goto err1; + if (allocate_console(fb, flags)) + goto err0;
if (flags & GP_FB_INPUT_KBD) { if (init_kbd(fb)) @@ -412,15 +417,11 @@ err4: err3: close(fd); err2: - close(fb->con_fd); - - /* reset keyboard */ - ioctl(fb->con_fd, KDSETMODE, KD_TEXT); - - /* switch back console */ - if (fb->last_con_nr != -1) - ioctl(fb->con_fd, VT_ACTIVATE, fb->last_con_nr); + if (flags & GP_FB_INPUT_KBD) + exit_kbd(fb); err1: + free_console(fb); +err0: free(backend); return NULL; }
http://repo.or.cz/w/gfxprim.git/commit/5f3a2c0ec123ae0b6db9994fa948b1b032204...
commit 5f3a2c0ec123ae0b6db9994fa948b1b032204acc Author: Cyril Hrubis metan@ucw.cz Date: Tue Aug 27 00:54:09 2013 +0200
loaders: BMP: Implement BGR888 Save.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/libs/loaders/GP_BMP.c b/libs/loaders/GP_BMP.c index effb301..430e9d7 100644 --- a/libs/loaders/GP_BMP.c +++ b/libs/loaders/GP_BMP.c @@ -182,7 +182,7 @@ static int read_alphabitfields(FILE *f, struct bitmap_info_header *header) int ret;
ret = GP_FRead(f, "L4 L4 L4 L4", - &header->R_mask, + &header->R_mask, &header->G_mask, &header->B_mask, &header->A_mask); @@ -467,7 +467,7 @@ static uint8_t get_idx(struct bitmap_info_header *header, { switch (header->bpp) { case 1: - return !!(row[x/8] & (1<<(7 - x%8))); + return !!(row[x/8] & (1<<(7 - x%8))); case 2: return (row[x/4] >> (2*(3 - x%4))) & 0x03; case 4: @@ -653,7 +653,7 @@ int GP_OpenBMP(const char *src_path, FILE **f, *h = header.h;
if (pixel_type != NULL) - *pixel_type = match_pixel_type(&header); + *pixel_type = match_pixel_type(&header); }
return 0; @@ -775,6 +775,7 @@ static int bmp_fill_header(const GP_Context *src, struct bitmap_info_header *hea { switch (src->pixel_type) { case GP_PIXEL_RGB888: + case GP_PIXEL_BGR888: header->bpp = 24; break; default: @@ -802,8 +803,9 @@ static int bmp_fill_header(const GP_Context *src, struct bitmap_info_header *hea static int bmp_write_data(FILE *f, const GP_Context *src, GP_ProgressCallback *callback) { int y; - uint32_t padd_len = 0; + uint32_t padd_len = 0, x; char padd[3] = {0}; + uint8_t tmp[3 * src->w];
if (src->bytes_per_row%4) padd_len = 4 - src->bytes_per_row%4; @@ -811,6 +813,17 @@ static int bmp_write_data(FILE *f, const GP_Context *src, GP_ProgressCallback *c for (y = src->h - 1; y >= 0; y--) { void *row = GP_PIXEL_ADDR(src, 0, y);
+ if (src->pixel_type == GP_PIXEL_BGR888) { + memcpy(tmp, row, 3 * src->w); + + for (x = 0; x < src->w; x++) { + uint8_t *pix = tmp + 3 * x; + GP_SWAP(pix[0], pix[2]); + } + + row = tmp; + } + if (fwrite(row, src->bytes_per_row, 1, f) != 1) return EIO;
-----------------------------------------------------------------------
Summary of changes: libs/backends/GP_LinuxFB.c | 39 ++++++++++++++++++++------------------- libs/loaders/GP_BMP.c | 21 +++++++++++++++++---- libs/loaders/GP_ZIP.c | 1 + 3 files changed, 38 insertions(+), 23 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.