From 647f6e17e68c53d6451a86fd4a71702fb780235f Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 5 Dec 2009 13:08:16 +0000 Subject: optimise 1x1 bitmap plotting svn path=/trunk/netsurf/; revision=9717 --- framebuffer/framebuffer.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/framebuffer/framebuffer.c b/framebuffer/framebuffer.c index fe3fe12e2..a9598e80e 100644 --- a/framebuffer/framebuffer.c +++ b/framebuffer/framebuffer.c @@ -191,10 +191,18 @@ framebuffer_plot_bitmap(int x, int y, loc.x1 = loc.x0 + width; loc.y1 = loc.y0 + height; - return nsfb_plot_bitmap(nsfb, &loc, - (nsfb_colour_t *)bitmap->pixdata, - bitmap->width, bitmap->height, - bitmap->width, !bitmap->opaque); + if ((bitmap->width == 1) && (bitmap->height == 1)) { + if ((*(nsfb_colour_t *)bitmap->pixdata & 0xff000000) == 0) { + return true; + } + return nsfb_plot_rectangle_fill(nsfb, &loc, *(nsfb_colour_t *)bitmap->pixdata); + + } else { + return nsfb_plot_bitmap(nsfb, &loc, + (nsfb_colour_t *)bitmap->pixdata, + bitmap->width, bitmap->height, + bitmap->width, !bitmap->opaque); + } } /* get left most tile position */ @@ -214,11 +222,16 @@ framebuffer_plot_bitmap(int x, int y, loc.x1 = loc.x0 + width; loc.y1 = loc.y0 + height; + if ((bitmap->width == 1) && (bitmap->height == 1)) { + if ((*(nsfb_colour_t *)bitmap->pixdata & 0xff000000) != 0) { + nsfb_plot_rectangle_fill(nsfb, &loc, *(nsfb_colour_t *)bitmap->pixdata); + } + } else { nsfb_plot_bitmap(nsfb, &loc, (nsfb_colour_t *)bitmap->pixdata, bitmap->width, bitmap->height, bitmap->width, !bitmap->opaque); - + } if (!repeat_y) break; } -- cgit v1.2.3