summaryrefslogtreecommitdiff
path: root/image/gif.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-04-13 23:19:04 +0100
committerVincent Sanders <vince@kyllikki.org>2015-04-13 23:19:04 +0100
commitf37e52c39475e6efd3740c5ae1ec4f290662928f (patch)
tree88d01618e903975743a3cb74bff9bf8df54c2a45 /image/gif.c
parent7a28131e4953934150967eb7886bc06678e249e8 (diff)
downloadnetsurf-f37e52c39475e6efd3740c5ae1ec4f290662928f.tar.gz
netsurf-f37e52c39475e6efd3740c5ae1ec4f290662928f.tar.bz2
Move bitmap operations into an operation table.
The generic bitmap handlers provided by each frontend are called back from the core and therefore should be in an operation table. This was one of the very few remaining interfaces stopping the core code from being split into a library.
Diffstat (limited to 'image/gif.c')
-rw-r--r--image/gif.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/image/gif.c b/image/gif.c
index c2f0ae477..871b1cc2c 100644
--- a/image/gif.c
+++ b/image/gif.c
@@ -36,14 +36,9 @@
#include <stdlib.h>
#include <libnsgif.h>
-#include "utils/config.h"
-#include "utils/log.h"
#include "utils/messages.h"
-#include "utils/utils.h"
#include "utils/nsoption.h"
#include "content/content_protected.h"
-#include "content/hlcache.h"
-#include "desktop/plotters.h"
#include "desktop/gui_misc.h"
#include "desktop/gui_internal.h"
@@ -68,24 +63,21 @@ typedef struct nsgif_content {
*/
static void *nsgif_bitmap_create(int width, int height)
{
- return bitmap_create(width, height, BITMAP_NEW);
+ return guit->bitmap->create(width, height, BITMAP_NEW);
}
-/* The Bitmap callbacks function table;
- * necessary for interaction with nsgiflib.
- */
-static gif_bitmap_callback_vt gif_bitmap_callbacks = {
- .bitmap_create = nsgif_bitmap_create,
- .bitmap_destroy = bitmap_destroy,
- .bitmap_get_buffer = bitmap_get_buffer,
- .bitmap_set_opaque = bitmap_set_opaque,
- .bitmap_test_opaque = bitmap_test_opaque,
- .bitmap_modified = bitmap_modified
-};
static nserror nsgif_create_gif_data(nsgif_content *c)
{
union content_msg_data msg_data;
+ gif_bitmap_callback_vt gif_bitmap_callbacks = {
+ .bitmap_create = nsgif_bitmap_create,
+ .bitmap_destroy = guit->bitmap->destroy,
+ .bitmap_get_buffer = guit->bitmap->get_buffer,
+ .bitmap_set_opaque = guit->bitmap->set_opaque,
+ .bitmap_test_opaque = guit->bitmap->test_opaque,
+ .bitmap_modified = guit->bitmap->modified
+ };
/* Initialise our data structure */
c->gif = calloc(sizeof(gif_animation), 1);