From 5f31754bbdf7820a98cbe6bf598b9fcc7df1cf96 Mon Sep 17 00:00:00 2001 From: martii Date: Fri, 9 Aug 2013 15:38:00 +0200 Subject: [PATCH] driver/fbaccel/spark: don't use blitter for drawing simple lines --- src/driver/fbaccel.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/driver/fbaccel.cpp b/src/driver/fbaccel.cpp index bcdffc3db..3af862bb8 100644 --- a/src/driver/fbaccel.cpp +++ b/src/driver/fbaccel.cpp @@ -380,6 +380,26 @@ void CFbAccel::paintRect(const int x, const int y, const int dx, const int dy, c if (dx <= 0 || dy <= 0) return; + // The STM blitter introduces considerable overhead probably not worth for single lines. --martii + if (dx == 1) { + waitForIdle(); + fb_pixel_t *fbs = fb->getFrameBufferPointer() + (DEFAULT_XRES * y) + x; + fb_pixel_t *fbe = fbs + DEFAULT_XRES * dy; + while (fbs < fbe) { + *fbs = col; + fbs += DEFAULT_XRES; + } + return; + } + if (dy == 1) { + waitForIdle(); + fb_pixel_t *fbs = fb->getFrameBufferPointer() + (DEFAULT_XRES * y) + x; + fb_pixel_t *fbe = fbs + dx; + while (fbs < fbe) + *fbs++ = col; + return; + } + /* function has const parameters, so copy them here... */ int width = dx; int height = dy;