diff options
author | Vincent Sanders <vince@netsurf-browser.org> | 2009-02-26 14:35:14 +0000 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2009-02-26 14:35:14 +0000 |
commit | 762b69875572766d335a736a37d1940d9e2557b0 (patch) | |
tree | ec3e8befc83b68b2b6e92b6d0d9dde5e3adfc018 /framebuffer | |
parent | 6dd7157ffb8c2cd6fd6ff8076ab765000a2c8e40 (diff) | |
download | netsurf-762b69875572766d335a736a37d1940d9e2557b0.tar.gz netsurf-762b69875572766d335a736a37d1940d9e2557b0.tar.bz2 |
rewrite the fb_32bpp_fill routine to be more efficient
svn path=/trunk/netsurf/; revision=6632
Diffstat (limited to 'framebuffer')
-rw-r--r-- | framebuffer/fb_32bpp_plotters.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/framebuffer/fb_32bpp_plotters.c b/framebuffer/fb_32bpp_plotters.c index 1237f01a0..89be218fc 100644 --- a/framebuffer/fb_32bpp_plotters.c +++ b/framebuffer/fb_32bpp_plotters.c @@ -153,23 +153,29 @@ static bool fb_32bpp_polygon(const int *p, unsigned int n, colour fill) static bool fb_32bpp_fill(int x0, int y0, int x1, int y1, colour c) { int w; - int y; + uint32_t *pvid_line; uint32_t *pvid; uint32_t ent; + uint32_t llen; + uint32_t width; + uint32_t height; if (!fb_plotters_clip_rect_ctx(&x0, &y0, &x1, &y1)) return true; /* fill lies outside current clipping region */ + llen = (framebuffer->linelen >> 2); ent = ((c & 0xff0000) >> 16) | (c & 0xff00) | ((c & 0xff) << 16); + width = x1 - x0; + height = y1 - y0; - pvid = fb_32bpp_get_xy_loc(x0, y0); + pvid_line = fb_32bpp_get_xy_loc(x0, y0); - for (y = y0; y < y1; y++) { - w = x1 - x0; - while (w-- > 0) { - *(pvid + w) = ent; - } - pvid += (framebuffer->linelen >> 2); + while (height > 0) { + height--; + pvid = pvid_line; + pvid_line += llen; + w = width; + while (w-- > 0) *pvid++ = ent; } return true; @@ -193,7 +199,7 @@ fb_32bpp_draw_ft_monobitmap(FT_Bitmap *bp, int x, int y, colour c) { int height = bp->rows; int width = bp->width; - uint32_t row; + uint32_t row = 0; int xloop, yloop; uint32_t *pvideo; |