From cdd940897c917042eef200059b4edb7e7e513207 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Fri, 27 Feb 2009 11:36:18 +0000 Subject: Unroll some fill loops, enable adrianl improved ablend function svn path=/trunk/netsurf/; revision=6657 --- framebuffer/fb_16bpp_plotters.c | 23 ++++++++++++++++++++++- framebuffer/fb_32bpp_plotters.c | 41 +++++++++++++++++++---------------------- framebuffer/fb_frontend_sdl.c | 8 ++++---- framebuffer/fb_plotters.h | 4 ++-- 4 files changed, 47 insertions(+), 29 deletions(-) (limited to 'framebuffer') diff --git a/framebuffer/fb_16bpp_plotters.c b/framebuffer/fb_16bpp_plotters.c index 74944a9c3..975dd98cb 100644 --- a/framebuffer/fb_16bpp_plotters.c +++ b/framebuffer/fb_16bpp_plotters.c @@ -191,7 +191,28 @@ static bool fb_16bpp_fill(int x0, int y0, int x1, int y1, colour c) pvid32 = (uint32_t *)pvid16; while (height-- > 0) { - for (w = width; w > 0; w--) *pvid32++ = ent32; + w = width; + while (w >= 16) { + *pvid32++ = ent32; *pvid32++ = ent32; + *pvid32++ = ent32; *pvid32++ = ent32; + *pvid32++ = ent32; *pvid32++ = ent32; + *pvid32++ = ent32; *pvid32++ = ent32; + *pvid32++ = ent32; *pvid32++ = ent32; + *pvid32++ = ent32; *pvid32++ = ent32; + *pvid32++ = ent32; *pvid32++ = ent32; + *pvid32++ = ent32; *pvid32++ = ent32; + w-=16; + } + while (w >= 4) { + *pvid32++ = ent32; *pvid32++ = ent32; + *pvid32++ = ent32; *pvid32++ = ent32; + w-=4; + } + while (w > 0) { + *pvid32++ = ent32; + w--; + } + // for (w = width; w > 0; w--) *pvid32++ = ent32; pvid32 += llen; } diff --git a/framebuffer/fb_32bpp_plotters.c b/framebuffer/fb_32bpp_plotters.c index 8bc4979ff..dcaa6b82f 100644 --- a/framebuffer/fb_32bpp_plotters.c +++ b/framebuffer/fb_32bpp_plotters.c @@ -189,30 +189,27 @@ static bool fb_32bpp_fill(int x0, int y0, int x1, int y1, colour c) pvid = fb_32bpp_get_xy_loc(x0, y0); while (height-- > 0) { -#if 1 - for (w = width; w > 0; w--) *pvid++ = ent; -#else - uint32_t *evid = pvid + width; - while (pvid <= evid - 16) { - *pvid++ = ent; - *pvid++ = ent; - *pvid++ = ent; - *pvid++ = ent; - *pvid++ = ent; - *pvid++ = ent; - *pvid++ = ent; - *pvid++ = ent; - *pvid++ = ent; - *pvid++ = ent; - *pvid++ = ent; - *pvid++ = ent; - *pvid++ = ent; - *pvid++ = ent; - *pvid++ = ent; + w = width; + while (w >= 16) { + *pvid++ = ent; *pvid++ = ent; + *pvid++ = ent; *pvid++ = ent; + *pvid++ = ent; *pvid++ = ent; + *pvid++ = ent; *pvid++ = ent; + *pvid++ = ent; *pvid++ = ent; + *pvid++ = ent; *pvid++ = ent; + *pvid++ = ent; *pvid++ = ent; + *pvid++ = ent; *pvid++ = ent; + w-=16; + } + while (w >= 4) { + *pvid++ = ent; *pvid++ = ent; + *pvid++ = ent; *pvid++ = ent; + w-=4; + } + while (w > 0) { *pvid++ = ent; + w--; } - while (pvid < evid) *pvid++ = ent; -#endif pvid += llen; } diff --git a/framebuffer/fb_frontend_sdl.c b/framebuffer/fb_frontend_sdl.c index 4a9e26476..02d2e6af8 100644 --- a/framebuffer/fb_frontend_sdl.c +++ b/framebuffer/fb_frontend_sdl.c @@ -184,8 +184,8 @@ void fb_os_input(struct gui_window *g, bool active) case SDL_BUTTON_MIDDLE: default: - printf("Mouse button %d pressed at (%d,%d)\n", - event.button.button, event.button.x, event.button.y); + LOG(("Mouse button %d pressed at (%d,%d)\n", + event.button.button, event.button.x, event.button.y)); } break; @@ -206,8 +206,8 @@ void fb_os_input(struct gui_window *g, bool active) break; default: - printf("Mouse button %d pressed at (%d,%d)\n", - event.button.button, event.button.x, event.button.y); + LOG(("Mouse button %d pressed at (%d,%d)\n", + event.button.button, event.button.x, event.button.y)); } break; diff --git a/framebuffer/fb_plotters.h b/framebuffer/fb_plotters.h index 79bb6db6d..8e2d1fe3f 100644 --- a/framebuffer/fb_plotters.h +++ b/framebuffer/fb_plotters.h @@ -50,7 +50,7 @@ bool fb_plotters_bitmap_tile(int x, int y, /* alpha blend two pixels together */ static inline colour fb_plotters_ablend(colour pixel, colour scrpixel) { -#if 1 +#if 0 int opacity = (pixel >> 24) & 0xFF; int r,g,b; @@ -74,7 +74,7 @@ static inline colour fb_plotters_ablend(colour pixel, colour scrpixel) g = ((pixel & 0x00FF00) * opacity + (scrpixel & 0x00FF00) * transp) >> 8; - return (rb & 0xFF0FF) | (g & 0xFF00); + return (rb & 0xFF00FF) | (g & 0xFF00); #endif } -- cgit v1.2.3