[project @ 2004-10-17 21:12:32 by bursa]

Replace bitmap_redraw() with plot.bitmap().

svn path=/import/netsurf/; revision=1316
This commit is contained in:
James Bursa 2004-10-17 21:12:32 +00:00
parent de33b16b87
commit 63a4269651
6 changed files with 27 additions and 12 deletions

View File

@ -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,

View File

@ -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

View File

@ -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);
}

View File

@ -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.
*/

View File

@ -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

View File

@ -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"
@ -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
*/