diff options
author | Richard Wilson <rjw@netsurf-browser.org> | 2006-02-22 01:58:19 +0000 |
---|---|---|
committer | Richard Wilson <rjw@netsurf-browser.org> | 2006-02-22 01:58:19 +0000 |
commit | 3d9a1198db571973e2760d6f27c771cbe31c844b (patch) | |
tree | 5a306a7fdf135f63fa1bd031924fb18edc5ecc2b /image/gif.c | |
parent | 01cc7987c7af26c70269c81e9d344fd2e91a8793 (diff) | |
download | netsurf-3d9a1198db571973e2760d6f27c771cbe31c844b.tar.gz netsurf-3d9a1198db571973e2760d6f27c771cbe31c844b.tar.bz2 |
[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
Diffstat (limited to 'image/gif.c')
-rw-r--r-- | image/gif.c | 8 |
1 files changed, 8 insertions, 0 deletions
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, |