From 87f6314dabdc2067a19e01f8b29f9ecc38ed825b Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 8 Mar 2014 14:13:27 +0000 Subject: move scheduleing into browser operation table --- image/gif.c | 17 ++++++++++------- image/image_cache.c | 16 ++++++++-------- 2 files changed, 18 insertions(+), 15 deletions(-) (limited to 'image') diff --git a/image/gif.c b/image/gif.c index 4bd45c7fe..5c1b3abe8 100644 --- a/image/gif.c +++ b/image/gif.c @@ -39,14 +39,15 @@ #include "content/hlcache.h" #include "utils/nsoption.h" #include "desktop/plotters.h" -#include "image/image.h" -#include "image/bitmap.h" -#include "image/gif.h" +#include "desktop/gui_factory.h" #include "utils/log.h" #include "utils/messages.h" -#include "utils/schedule.h" #include "utils/utils.h" +#include "image/image.h" +#include "image/bitmap.h" +#include "image/gif.h" + typedef struct nsgif_content { struct content base; @@ -159,7 +160,7 @@ static void nsgif_animate(void *p) delay = gif->gif->frames[gif->current_frame].frame_delay; if (delay < nsoption_int(minimum_gif_delay)) delay = nsoption_int(minimum_gif_delay); - schedule(delay, nsgif_animate, gif); + guit->browser->schedule(delay * 10, nsgif_animate, gif); } if ((!nsoption_bool(animate_images)) || @@ -292,7 +293,9 @@ static bool nsgif_convert(struct content *c) /* Schedule the animation if we have one */ gif->current_frame = 0; if (gif->gif->frame_count_partial > 1) - schedule(gif->gif->frames[0].frame_delay, nsgif_animate, c); + guit->browser->schedule(gif->gif->frames[0].frame_delay * 10, + nsgif_animate, + c); /* Exit as a success */ content_set_ready(c); @@ -351,7 +354,7 @@ static void nsgif_destroy(struct content *c) nsgif_content *gif = (nsgif_content *) c; /* Free all the associated memory buffers */ - schedule_remove(nsgif_animate, c); + guit->browser->schedule(-1, nsgif_animate, c); gif_finalise(gif->gif); free(gif->gif); } diff --git a/image/image_cache.c b/image/image_cache.c index c1369086f..051243944 100644 --- a/image/image_cache.c +++ b/image/image_cache.c @@ -22,7 +22,7 @@ #include #include -#include "utils/schedule.h" +#include "desktop/gui_factory.h" #include "utils/log.h" #include "content/content_protected.h" @@ -290,9 +290,9 @@ static void image_cache__background_update(void *p) image_cache__clean(icache); - schedule((icache->params.bg_clean_time / 10), - image_cache__background_update, - icache); + guit->browser->schedule(icache->params.bg_clean_time, + image_cache__background_update, + icache); } /* exported interface documented in image_cache.h */ @@ -372,9 +372,9 @@ image_cache_init(const struct image_cache_parameters *image_cache_parameters) image_cache->params = *image_cache_parameters; - schedule((image_cache->params.bg_clean_time / 10), - image_cache__background_update, - image_cache); + guit->browser->schedule(image_cache->params.bg_clean_time, + image_cache__background_update, + image_cache); LOG(("Image cache initilised with a limit of %d hysteresis of %d", image_cache->params.limit, image_cache->params.hysteresis)); @@ -387,7 +387,7 @@ nserror image_cache_fini(void) { unsigned int op_count; - schedule_remove(image_cache__background_update, image_cache); + guit->browser->schedule(-1, image_cache__background_update, image_cache); LOG(("Size at finish %d (in %d)", image_cache->total_bitmap_size, -- cgit v1.2.3