From c0a1e42dceb2a58069e755b7c246eefbe569e685 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 24 May 2013 06:35:42 +0200 Subject: [PATCH] CFrameBuffer::paintBoxRel: Skip paint the line, if the calculated width < 0 - When width < 0 GXA overwrites undefined image regions - Skip paint the line, if the calculated width = 0 (unnecessarily) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/00dd399ff90a21ba009f6d92b9f1a2e5acf2e508 Author: Michael Liebmann Date: 2013-05-24 (Fri, 24 May 2013) Origin message was: ------------------ * CFrameBuffer::paintBoxRel: Skip paint the line, if the calculated width < 0 - When width < 0 GXA overwrites undefined image regions - Skip paint the line, if the calculated width = 0 (unnecessarily) ------------------ This commit was generated by Migit --- src/driver/framebuffer.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index e7a8299e6..2e52808d1 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -675,7 +675,7 @@ void CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, const int return; if (dx == 0 || dy == 0) { - printf("paintBoxRel: radius %d, start x %d y %d end x %d y %d\n", radius, x, y, x+dx, y+dy); + printf("[%s - %d]: radius %d, start x %d y %d end x %d y %d\n", __FUNCTION__, __LINE__, radius, x, y, x+dx, y+dy); return; } @@ -721,8 +721,15 @@ void CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, const int #endif } - if (dx-ofr-ofl == 0) - printf("paintBoxRel: radius %d, start x %d y %d end x %d y %d\n", radius, x, y, dx-ofr-ofl, y+line); + if (dx-ofr-ofl < 1) { + if (dx-ofr-ofl == 0) + printf("[%s - %d]: radius %d, start x %d y %d end x %d y %d\n", __FUNCTION__, __LINE__, radius, x, y, x+dx-ofr-ofl, y+line); + else + printf("[%s - %04d]: Calculated width: %d\n (radius %d, dx %d, offsetLeft %d, offsetRight %d).\n Width can not be less than 0, abort.\n", + __FUNCTION__, __LINE__, dx-ofr-ofl, radius, dx, ofl, ofr); + line++; + continue; + } #ifdef USE_NEVIS_GXA _write_gxa(gxa_base, GXA_BLT_CONTROL_REG, 0); _write_gxa(gxa_base, cmd, GXA_POINT(x + ofl, y + line)); /* destination x/y */