From aa2684341170424783f9937d8fe441fb3984d825 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Tue, 30 Jun 2009 13:02:23 +0000 Subject: Improve bitmap plotter API svn path=/trunk/netsurf/; revision=8195 --- image/png.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'image/png.c') diff --git a/image/png.c b/image/png.c index 7fb6358a3..34c517d90 100644 --- a/image/png.c +++ b/image/png.c @@ -270,12 +270,11 @@ bool nspng_redraw(struct content *c, int x, int y, int clip_x0, int clip_y0, int clip_x1, int clip_y1, float scale, colour background_colour) { - if (c->bitmap != NULL) { - return plot.bitmap(x, y, width, height, c->bitmap, - background_colour, c); - } + if (c->bitmap == NULL) + return true; - return true; + return plot.bitmap(x, y, width, height, c->bitmap, + background_colour, BITMAPF_NONE); } bool nspng_redraw_tiled(struct content *c, int x, int y, int width, int height, @@ -283,12 +282,18 @@ bool nspng_redraw_tiled(struct content *c, int x, int y, int width, int height, float scale, colour background_colour, bool repeat_x, bool repeat_y) { - if (c->bitmap != NULL) { - return plot.bitmap_tile(x, y, width, height, c->bitmap, - background_colour, repeat_x, repeat_y, c); - } + bitmap_flags_t flags = 0; - return true; + if (c->bitmap == NULL) + return true; + + if (repeat_x) + flags |= BITMAPF_REPEAT_X; + if (repeat_y) + flags |= BITMAPF_REPEAT_Y; + + return plot.bitmap(x, y, width, height, c->bitmap, + background_colour, flags); } #endif -- cgit v1.2.3