From 4cc85469cb26f8ea1a8f14f17bddb6a5cbea1e88 Mon Sep 17 00:00:00 2001 From: Richard Wilson Date: Tue, 21 Feb 2006 20:49:12 +0000 Subject: [project @ 2006-02-21 20:49:11 by rjw] Allow any content to be used as a background. Simplify bitmap code. svn path=/import/netsurf/; revision=2087 --- image/jpeg.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'image/jpeg.c') diff --git a/image/jpeg.c b/image/jpeg.c index 86f205964..3efe698df 100644 --- a/image/jpeg.c +++ b/image/jpeg.c @@ -94,7 +94,7 @@ bool nsjpeg_convert(struct content *c, int w, int h) width = cinfo.output_width; height = cinfo.output_height; - bitmap = bitmap_create(width, height, false); + bitmap = bitmap_create(width, height, BITMAP_ALLOCATE_MEMORY); if (bitmap) pixels = bitmap_get_buffer(bitmap); if ((!bitmap) || (!pixels)) { @@ -226,6 +226,22 @@ bool nsjpeg_redraw(struct content *c, int x, int y, } +/** + * Redraw a CONTENT_JPEG with appropriate tiling. + */ + +bool nsjpeg_redraw_tiled(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 repeat_x, bool repeat_y) +{ + return plot.bitmap_tile(x, y, width, height, + c->bitmap, background_colour, + repeat_x, repeat_y); +} + + /** * Destroy a CONTENT_JPEG and free all resources it owns. */ -- cgit v1.2.3