Completes test of line/trapezoid drawing routines

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3842 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2011-08-04 01:25:58 +00:00
parent dc3c6ea49f
commit 703befb4a2
7 changed files with 470 additions and 25 deletions
+1 -1
View File
@@ -201,7 +201,7 @@ void NXGL_FUNCNAME(nxgl_filltrapezoid,NXGLIB_SUFFIX)(
* always draw at least one pixel.
*/
if (x1 > x2 || ix2 < bounds->pt1.x || ix1 > bounds->pt2.x)
if (x1 <= x2 && ix2 >= bounds->pt1.x && ix1 <= bounds->pt2.x)
{
/* Get a clipped copies of the starting and ending X positions. This
* clipped truncates "down" and gives the quantized pixel holding the
+1 -8
View File
@@ -93,7 +93,6 @@ void NXGL_FUNCNAME(nxgl_filltrapezoid,NXGLIB_SUFFIX)
NXGL_PIXEL_T color)
{
unsigned int ncols;
unsigned int dy;
unsigned int topy;
unsigned int boty;
unsigned int row;
@@ -104,6 +103,7 @@ void NXGL_FUNCNAME(nxgl_filltrapezoid,NXGLIB_SUFFIX)
b16_t botx2;
b16_t dx1dy;
b16_t dx2dy;
int dy;
int ix1;
int ix2;
@@ -174,13 +174,6 @@ void NXGL_FUNCNAME(nxgl_filltrapezoid,NXGLIB_SUFFIX)
boty = bounds->pt2.y;
}
/* Break out now if it was completely clipped */
if (topy > boty)
{
return;
}
/* Handle the special case where the sides cross (as in an hourglass) */
if (botx1 > botx2)