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 ff6f39694f9b44497c6ec7f4d3b9c27ab180510a (commit) via 3f9f0c9b1e899fb28031ea3f11671f9bce3c1caa (commit) from 5109c64bfb2ac61e8fe89114c3843c0782e22543 (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/ff6f39694f9b44497c6ec7f4d3b9c27ab1805...
commit ff6f39694f9b44497c6ec7f4d3b9c27ab180510a Author: Cyril Hrubis metan@ucw.cz Date: Wed Jan 30 13:34:20 2013 +0100
spiv: A few fixes for -zf (fixed zoom mode).
diff --git a/demos/spiv/spiv.c b/demos/spiv/spiv.c index 6059199..f681b1a 100644 --- a/demos/spiv/spiv.c +++ b/demos/spiv/spiv.c @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * - * Copyright (C) 2009-2012 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2013 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
@@ -528,15 +528,10 @@ static void show_image(struct loader_params *params, const char *path) } }
-static void zoom_offset_horiz(struct loader_params *params, int size) +static void set_zoom_offset(struct loader_params *params, int dx, int dy) { - params->zoom_x_offset += size; - show_image(params, NULL); -} - -static void zoom_offset_vert(struct loader_params *params, int size) -{ - params->zoom_y_offset += size; + params->zoom_x_offset += dx; + params->zoom_y_offset += dy; show_image(params, NULL); }
@@ -863,7 +858,6 @@ int main(int argc, char *argv[]) GP_Fill(context, black_pixel); GP_BackendFlip(backend);
- struct image_list *list = image_list_create((const char**)argv + optind);
params.show_progress_once = 1; @@ -892,6 +886,12 @@ int main(int argc, char *argv[]) if (ev.val.val < 0) goto prev; break; + case GP_EV_REL_POS: + if (GP_EventGetKey(&ev, GP_BTN_LEFT)) + set_zoom_offset(¶ms, + ev.val.rel.rx, + ev.val.rel.ry); + break; } break; case GP_EV_KEY: @@ -992,12 +992,12 @@ int main(int argc, char *argv[]) next: case GP_KEY_RIGHT: if (shift_flag) { - zoom_offset_horiz(¶ms, 10); + set_zoom_offset(¶ms, 10, 0); break; } case GP_KEY_UP: if (shift_flag) { - zoom_offset_vert(¶ms, -10); + set_zoom_offset(¶ms, 0, -10); break; } case GP_KEY_SPACE: @@ -1007,12 +1007,12 @@ int main(int argc, char *argv[]) prev: case GP_KEY_LEFT: if (shift_flag) { - zoom_offset_horiz(¶ms, -10); + set_zoom_offset(¶ms, -10, 0); break; } case GP_KEY_DOWN: if (shift_flag) { - zoom_offset_vert(¶ms, 10); + set_zoom_offset(¶ms, 0, 10); break; } case GP_KEY_BACKSPACE: @@ -1047,9 +1047,11 @@ int main(int argc, char *argv[]) resize_backend(¶ms, 9, shift_flag); break; case GP_KEY_DOT: + params.show_progress_once = 1; zoom_mul(¶ms, 1.5); break; case GP_KEY_COMMA: + params.show_progress_once = 1; zoom_mul(¶ms, 1/1.5); break; } @@ -1062,6 +1064,7 @@ int main(int argc, char *argv[]) GP_BackendResizeAck(backend); GP_Fill(backend->context, 0); params.show_progress_once = 1; + GP_EventSetScreenSize(ev.val.sys.w, ev.val.sys.h); show_image(¶ms, NULL); break; case GP_EV_SYS_QUIT:
http://repo.or.cz/w/gfxprim.git/commit/3f9f0c9b1e899fb28031ea3f11671f9bce3c1...
commit 3f9f0c9b1e899fb28031ea3f11671f9bce3c1caa Author: Cyril Hrubis metan@ucw.cz Date: Wed Jan 30 13:32:34 2013 +0100
spiv: image_cache: Store at least one image.
This fixes memory leaks and crashes when image is too big to be stored in image cache maximal size.
diff --git a/demos/spiv/image_cache.c b/demos/spiv/image_cache.c index 00712c9..496489e 100644 --- a/demos/spiv/image_cache.c +++ b/demos/spiv/image_cache.c @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * - * Copyright (C) 2009-2012 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2013 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
@@ -229,8 +229,12 @@ int image_cache_put(struct image_cache *self, GP_Context *ctx, const char *path, size = image_size2(ctx, path);
- if (assert_size(self, size)) - return 1; + /* + * We try to create room for the image. If this fails we add the image + * anyway because we need to store it while we are showing it (and it + * will be removed from cache by next image for sure). + */ + assert_size(self, size);
struct image *img = malloc(sizeof(struct image) + strlen(path) + 1);
-----------------------------------------------------------------------
Summary of changes: demos/spiv/image_cache.c | 10 +++++++--- demos/spiv/spiv.c | 31 +++++++++++++++++-------------- 2 files changed, 24 insertions(+), 17 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.