From bffa2b64dee70c29d0b16dcfe9ecde7c46f4f393 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 8 Jul 2010 20:38:48 +0000 Subject: Treat tiled images scaled to 1x1 as flat fills of the tiled area. svn path=/trunk/netsurf/; revision=10616 --- framebuffer/framebuffer.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'framebuffer') diff --git a/framebuffer/framebuffer.c b/framebuffer/framebuffer.c index e97d63ab4..bed356863 100644 --- a/framebuffer/framebuffer.c +++ b/framebuffer/framebuffer.c @@ -215,6 +215,18 @@ framebuffer_plot_bitmap(int x, int y, } } + /* Optimise tiled plots of bitmaps scaled to 1x1 by replacing with + * a flat fill of the area. Can only be done when image is fully + * opaque. */ + if ((width == 1) && (height == 1)) { + if (bitmap->opaque) { + /** TODO: Currently using top left pixel. Maybe centre + * pixel or average value would be better. */ + 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); -- cgit v1.2.3