summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2009-12-05 13:08:16 +0000
committerVincent Sanders <vince@netsurf-browser.org>2009-12-05 13:08:16 +0000
commit647f6e17e68c53d6451a86fd4a71702fb780235f (patch)
tree4746c4aa2451856a93c421d0a0702b0c14685d01
parent6c271f148b654f011acb8ad9828f5b0099172ceb (diff)
downloadnetsurf-647f6e17e68c53d6451a86fd4a71702fb780235f.tar.gz
netsurf-647f6e17e68c53d6451a86fd4a71702fb780235f.tar.bz2
optimise 1x1 bitmap plotting
svn path=/trunk/netsurf/; revision=9717
-rw-r--r--framebuffer/framebuffer.c23
1 files 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;
}