From 63a4269651952a83e0ccb71a8eebb682395e4697 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Sun, 17 Oct 2004 21:12:32 +0000 Subject: [project @ 2004-10-17 21:12:32 by bursa] Replace bitmap_redraw() with plot.bitmap(). svn path=/import/netsurf/; revision=1316 --- content/content.c | 2 +- image/bitmap.h | 4 ---- image/gif.c | 6 +++--- image/jpeg.c | 15 +++++++++++++++ image/jpeg.h | 4 ++++ image/mng.c | 8 ++++---- 6 files changed, 27 insertions(+), 12 deletions(-) diff --git a/content/content.c b/content/content.c index 2999e2676..6e988814d 100644 --- a/content/content.c +++ b/content/content.c @@ -170,7 +170,7 @@ static const struct handler_entry handler_map[] = { {0, 0, css_convert, 0, css_destroy, 0, 0, 0, 0, false}, #ifdef WITH_JPEG {0, 0, nsjpeg_convert, - 0, nsjpeg_destroy, 0, bitmap_redraw, 0, 0, false}, + 0, nsjpeg_destroy, 0, nsjpeg_redraw, 0, 0, false}, #endif #ifdef WITH_GIF {nsgif_create, 0, nsgif_convert, diff --git a/image/bitmap.h b/image/bitmap.h index 0c06f836f..058e03a46 100644 --- a/image/bitmap.h +++ b/image/bitmap.h @@ -31,10 +31,6 @@ bool bitmap_test_opaque(struct bitmap *bitmap); char *bitmap_get_buffer(struct bitmap *bitmap); size_t bitmap_get_rowstride(struct bitmap *bitmap); void bitmap_destroy(struct bitmap *bitmap); -bool bitmap_redraw(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, - float scale, unsigned long background_colour); bool bitmap_save(struct bitmap *bitmap, const char *path); #endif diff --git a/image/gif.c b/image/gif.c index 7f66a03ae..042ceeef0 100644 --- a/image/gif.c +++ b/image/gif.c @@ -14,6 +14,7 @@ #include "netsurf/content/content.h" #include "netsurf/desktop/browser.h" #include "netsurf/desktop/options.h" +#include "netsurf/desktop/plotters.h" #include "netsurf/image/bitmap.h" #include "netsurf/image/gif.h" #include "netsurf/image/gifread.h" @@ -161,9 +162,8 @@ bool nsgif_redraw(struct content *c, int x, int y, } c->bitmap = c->data.gif.gif->frame_image; - return bitmap_redraw(c, x, y, width, height, - clip_x0, clip_y0, clip_x1, clip_y1, - scale, background_colour); + return plot.bitmap(x, y, width, height, + c->bitmap, background_colour); } diff --git a/image/jpeg.c b/image/jpeg.c index f607ebb14..7f57d62b2 100644 --- a/image/jpeg.c +++ b/image/jpeg.c @@ -21,6 +21,7 @@ #include "libjpeg/jpeglib.h" #include "netsurf/utils/config.h" #include "netsurf/content/content.h" +#include "netsurf/desktop/plotters.h" #include "netsurf/image/bitmap.h" #include "netsurf/image/jpeg.h" #include "netsurf/utils/log.h" @@ -207,6 +208,20 @@ void nsjpeg_term_source(j_decompress_ptr cinfo) } +/** + * Redraw a CONTENT_JPEG. + */ + +bool nsjpeg_redraw(struct content *c, int x, int y, + int width, int height, + int clip_x0, int clip_y0, int clip_x1, int clip_y1, + float scale, unsigned long background_colour) +{ + return plot.bitmap(x, y, width, height, + c->bitmap, background_colour); +} + + /** * Destroy a CONTENT_JPEG and free all resources it owns. */ diff --git a/image/jpeg.h b/image/jpeg.h index 5acc4b75c..281c02111 100644 --- a/image/jpeg.h +++ b/image/jpeg.h @@ -20,6 +20,10 @@ struct content_jpeg_data { }; bool nsjpeg_convert(struct content *c, int width, int height); +bool nsjpeg_redraw(struct content *c, int x, int y, + int width, int height, + int clip_x0, int clip_y0, int clip_x1, int clip_y1, + float scale, unsigned long background_colour); void nsjpeg_destroy(struct content *c); #endif diff --git a/image/mng.c b/image/mng.c index d1b9c9cfc..008e8363f 100644 --- a/image/mng.c +++ b/image/mng.c @@ -19,6 +19,7 @@ #include "netsurf/utils/config.h" #include "netsurf/content/content.h" #include "netsurf/desktop/browser.h" +#include "netsurf/desktop/plotters.h" #include "netsurf/image/bitmap.h" #include "netsurf/image/mng.h" #include "netsurf/utils/log.h" @@ -258,7 +259,7 @@ bool nsmng_convert(struct content *c, int width, int height) { LOG(("Unable to start display (%i)", status)); return nsmng_broadcast_error(c); } - + /* Optimise the plotting of JNG/PNGs */ if ((c->type == CONTENT_PNG) || (c->type == CONTENT_JNG)) { @@ -381,9 +382,8 @@ bool nsmng_redraw(struct content *c, int x, int y, { bool ret; - ret = bitmap_redraw(c, x, y, width, height, - clip_x0, clip_y0, clip_x1, clip_y1, - scale, background_colour); + ret = plot.bitmap(x, y, width, height, + c->bitmap, background_colour); /* Check if we need to restart the animation */ -- cgit v1.2.3