From 3d9a1198db571973e2760d6f27c771cbe31c844b Mon Sep 17 00:00:00 2001 From: Richard Wilson Date: Wed, 22 Feb 2006 01:58:19 +0000 Subject: [project @ 2006-02-22 01:58:19 by rjw] Reduce constant bitmap overhead per reference by moving to a flag word. Allow bitmaps to be reduced back to their raw data to free extra memory in a highly efficient manner. svn path=/import/netsurf/; revision=2089 --- image/gif.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'image/gif.c') diff --git a/image/gif.c b/image/gif.c index 312139173..5bd2c25aa 100644 --- a/image/gif.c +++ b/image/gif.c @@ -35,6 +35,7 @@ #ifdef WITH_GIF +static void nsgif_invalidate(struct bitmap *bitmap, void *private_word); static void nsgif_animate(void *p); static void nsgif_get_frame(struct content *c); @@ -105,6 +106,8 @@ bool nsgif_convert(struct content *c, int iwidth, int iheight) { c->data.gif.current_frame = 0; if (gif->frame_count_partial > 1) schedule(gif->frames[0].frame_delay, nsgif_animate, c); + else + bitmap_set_suspendable(gif->frame_image, gif, nsgif_invalidate); /* Exit as a success */ @@ -113,6 +116,11 @@ bool nsgif_convert(struct content *c, int iwidth, int iheight) { return true; } +void nsgif_invalidate(struct bitmap *bitmap, void *private_word) { + struct gif_animation *gif = (struct gif_animation *)private_word; + + gif->decoded_frame = -1; +} bool nsgif_redraw(struct content *c, int x, int y, int width, int height, -- cgit v1.2.3