This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, generate has been updated via 6d5f5d2abd2ff4494d7c38418e4bdf686acb3f89 (commit) from 7d194009dcecc9c2d668bdd6f7add3cbf8bdd680 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/6d5f5d2abd2ff4494d7c38418e4bdf686acb3...
commit 6d5f5d2abd2ff4494d7c38418e4bdf686acb3f89 Author: Cyril Hrubis metan@ucw.cz Date: Thu Aug 18 23:08:11 2011 +0200
Remove the unconsistent check for zero size.
The zero size check in XYW, XYH and XYWH primitives makes them unconsistent with the rest of the code.
Eg.
GP_HLine(c, x, y, x, p) draws one pixel. GP_HLineXYW(c, x, y, 0, p) wasn't drawing anything.
diff --git a/libs/gfx/GP_HLine.c b/libs/gfx/GP_HLine.c index 9154b45..b19a146 100644 --- a/libs/gfx/GP_HLine.c +++ b/libs/gfx/GP_HLine.c @@ -34,8 +34,8 @@ DEF_HLINE_BU_FN(GP_HLine_Raw_1BPP_LE, GP_Context*, GP_Pixel, GP_PIXEL_ADDR, GP_W DEF_HLINE_BU_FN(GP_HLine_Raw_1BPP_BE, GP_Context*, GP_Pixel, GP_PIXEL_ADDR, GP_WritePixels1bpp) DEF_HLINE_BU_FN(GP_HLine_Raw_2BPP_LE, GP_Context*, GP_Pixel, GP_PIXEL_ADDR, GP_WritePixels2bpp) DEF_HLINE_BU_FN(GP_HLine_Raw_2BPP_BE, GP_Context*, GP_Pixel, GP_PIXEL_ADDR, GP_WritePixels2bpp) -DEF_HLINE_BU_FN(GP_HLine_Raw_4BPP_LE, GP_Context*, GP_Pixel, GP_PIXEL_ADDR, GP_WritePixels2bpp) -DEF_HLINE_BU_FN(GP_HLine_Raw_4BPP_BE, GP_Context*, GP_Pixel, GP_PIXEL_ADDR, GP_WritePixels2bpp) +DEF_HLINE_BU_FN(GP_HLine_Raw_4BPP_LE, GP_Context*, GP_Pixel, GP_PIXEL_ADDR, GP_WritePixels4bpp) +DEF_HLINE_BU_FN(GP_HLine_Raw_4BPP_BE, GP_Context*, GP_Pixel, GP_PIXEL_ADDR, GP_WritePixels4bpp)
DEF_HLINE_FN(GP_HLine_Raw_8BPP, GP_Context *, GP_Pixel, GP_PIXEL_ADDR, GP_WritePixels8bpp) DEF_HLINE_FN(GP_HLine_Raw_16BPP, GP_Context *, GP_Pixel, GP_PIXEL_ADDR, GP_WritePixels16bpp) @@ -54,11 +54,7 @@ void GP_HLineXXY_Raw(GP_Context *context, GP_Coord x0, GP_Coord x1, void GP_HLineXYW_Raw(GP_Context *context, GP_Coord x, GP_Coord y, GP_Size w, GP_Pixel pixel) { - /* zero width: do not draw anything */ - if (w == 0) - return; - - GP_HLineXXY_Raw(context, x, x + w - 1, y, pixel); + GP_HLineXXY_Raw(context, x, x + w, y, pixel); }
void GP_HLineXXY(GP_Context *context, GP_Coord x0, GP_Coord x1, GP_Coord y, @@ -82,9 +78,5 @@ void GP_HLineXXY(GP_Context *context, GP_Coord x0, GP_Coord x1, GP_Coord y, void GP_HLineXYW(GP_Context *context, GP_Coord x, GP_Coord y, GP_Size w, GP_Pixel pixel) { - /* zero width: do not draw anything */ - if (w == 0) - return; - - GP_HLineXXY(context, x, x + w - 1, y, pixel); + GP_HLineXXY(context, x, x + w, y, pixel); } diff --git a/libs/gfx/GP_Rect.c b/libs/gfx/GP_Rect.c index eee96f5..f6a303e 100644 --- a/libs/gfx/GP_Rect.c +++ b/libs/gfx/GP_Rect.c @@ -76,11 +76,7 @@ void GP_FillRectXYXY_Raw(GP_Context *context, GP_Coord x0, GP_Coord y0, void GP_FillRectXYWH_Raw(GP_Context *context, GP_Coord x, GP_Coord y, GP_Size w, GP_Size h, GP_Pixel pixel) { - /* zero width/height: draw nothing */ - if (w == 0 || h == 0) - return; - - GP_FillRectXYXY_Raw(context, x, y, x + w - 1, y + h - 1, pixel); + GP_FillRectXYXY_Raw(context, x, y, x + w, y + h, pixel); }
void GP_FillRectXYXY(GP_Context *context, GP_Coord x0, GP_Coord y0, @@ -97,9 +93,5 @@ void GP_FillRectXYXY(GP_Context *context, GP_Coord x0, GP_Coord y0, void GP_FillRectXYWH(GP_Context *context, GP_Coord x, GP_Coord y, GP_Size w, GP_Size h, GP_Pixel pixel) { - /* zero width/height: draw nothing */ - if (w == 0 || h == 0) - return; - - GP_FillRectXYXY(context, x, y, x + w - 1, y + h - 1, pixel); + GP_FillRectXYXY(context, x, y, x + w, y + h, pixel); } diff --git a/libs/gfx/GP_VLine.c b/libs/gfx/GP_VLine.c index e6d7f01..2af65f7 100644 --- a/libs/gfx/GP_VLine.c +++ b/libs/gfx/GP_VLine.c @@ -43,11 +43,7 @@ void GP_VLineXYY_Raw(GP_Context *context, GP_Coord x, GP_Coord y0, void GP_VLineXYH_Raw(GP_Context *context, GP_Coord x, GP_Coord y, GP_Size h, GP_Pixel pixel) { - /* zero height: do not draw anything */ - if (h == 0) - return; - - GP_VLineXYY(context, x, y, y + h - 1, pixel); + GP_VLineXYY(context, x, y, y + h, pixel); }
void GP_VLineXYY(GP_Context *context, GP_Coord x, GP_Coord y0, @@ -71,9 +67,5 @@ void GP_VLineXYY(GP_Context *context, GP_Coord x, GP_Coord y0, void GP_VLineXYH(GP_Context *context, GP_Coord x, GP_Coord y, GP_Size h, GP_Pixel pixel) { - /* zero height: do not draw anything */ - if (h == 0) - return; - - GP_VLineXYY(context, x, y, y + h - 1, pixel); + GP_VLineXYY(context, x, y, y + h, pixel); }
-----------------------------------------------------------------------
Summary of changes: libs/gfx/GP_HLine.c | 16 ++++------------ libs/gfx/GP_Rect.c | 12 ++---------- libs/gfx/GP_VLine.c | 12 ++---------- 3 files changed, 8 insertions(+), 32 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.