summaryrefslogtreecommitdiff
path: root/framebuffer
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2010-07-07 18:12:07 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2010-07-07 18:12:07 +0000
commit2204f9da165a879ac75abd6aab4c4050d6a64fce (patch)
treedd4bf5895b9da7561a817db7b943ff380f8c0084 /framebuffer
parent5bebf2f2fc27a31c8b2efa7a837baef63c1b0a97 (diff)
downloadnetsurf-2204f9da165a879ac75abd6aab4c4050d6a64fce.tar.gz
netsurf-2204f9da165a879ac75abd6aab4c4050d6a64fce.tar.bz2
More useful optimisation for 1x1 tiled image plots.
svn path=/trunk/netsurf/; revision=10606
Diffstat (limited to 'framebuffer')
-rw-r--r--framebuffer/framebuffer.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/framebuffer/framebuffer.c b/framebuffer/framebuffer.c
index 6c7ba102b..e97d63ab4 100644
--- a/framebuffer/framebuffer.c
+++ b/framebuffer/framebuffer.c
@@ -206,6 +206,15 @@ framebuffer_plot_bitmap(int x, int y,
}
}
+ /* Optimise tiled plots of 1x1 bitmaps by replacing with a flat fill
+ * of the area. Can only be done when image is fully opaque. */
+ if ((bitmap->width == 1) && (bitmap->height == 1)) {
+ if ((*(nsfb_colour_t *)bitmap->pixdata & 0xff000000) != 0) {
+ return nsfb_plot_rectangle_fill(nsfb, &clipbox,
+ *(nsfb_colour_t *)bitmap->pixdata);
+ }
+ }
+
/* get left most tile position */
if (repeat_x)
for (; x > clipbox.x0; x -= width);
@@ -223,16 +232,10 @@ 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;
}