graphics: fix nxstyle errors

Fix nxstyle errors to pass CI

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This commit is contained in:
Alin Jerpelea
2021-02-05 09:05:48 +01:00
committed by Alan Carvalho de Assis
parent 87596d74dd
commit f177951c39
55 changed files with 453 additions and 312 deletions
@@ -72,7 +72,10 @@
****************************************************************************/
void NXGL_FUNCNAME(nxglib_cursor_backup, NXGLIB_SUFFIX)
(FAR struct nxbe_state_s *be, FAR const struct nxgl_rect_s *bounds, int planeno)
(
FAR struct nxbe_state_s *be,
FAR const struct nxgl_rect_s *bounds,
int planeno)
{
struct nxgl_rect_s intersection;
struct nxgl_point_s origin;
@@ -94,7 +97,9 @@ void NXGL_FUNCNAME(nxglib_cursor_backup, NXGLIB_SUFFIX)
nxgl_rectintersect(&intersection, &be->cursor.bounds, &be->bkgd.bounds);
/* Check if there is anything in the modified region that we need to handle. */
/* Check if there is anything in the modified region that
* we need to handle.
*/
nxgl_rectintersect(&intersection, &intersection, bounds);
if (!nxgl_nullrect(&intersection))
@@ -146,7 +151,7 @@ void NXGL_FUNCNAME(nxglib_cursor_backup, NXGLIB_SUFFIX)
sline += sstride;
dline += dstride;
}
}
}
}
#endif /* CONFIG_NX_SWCURSOR */
+8 -3
View File
@@ -114,7 +114,10 @@ static NXGL_PIXEL_T nxbe_map_color(FAR struct nxbe_state_s *be, int plane,
****************************************************************************/
void NXGL_FUNCNAME(nxglib_cursor_draw, NXGLIB_SUFFIX)
(FAR struct nxbe_state_s *be, FAR const struct nxgl_rect_s *bounds, int planeno)
(
FAR struct nxbe_state_s *be,
FAR const struct nxgl_rect_s *bounds,
int planeno)
{
struct nxgl_rect_s intersection;
struct nxgl_point_s origin;
@@ -138,7 +141,9 @@ void NXGL_FUNCNAME(nxglib_cursor_draw, NXGLIB_SUFFIX)
nxgl_rectintersect(&intersection, &be->cursor.bounds, &be->bkgd.bounds);
/* Check if there is anything in the modified region that we need to handle. */
/* Check if there is anything in the modified region that we
* need to handle.
*/
nxgl_rectintersect(&intersection, &intersection, bounds);
if (!nxgl_nullrect(&intersection))
@@ -228,7 +233,7 @@ void NXGL_FUNCNAME(nxglib_cursor_draw, NXGLIB_SUFFIX)
sline += sstride;
dline += dstride;
}
}
}
}
+8 -3
View File
@@ -71,7 +71,10 @@
****************************************************************************/
void NXGL_FUNCNAME(nxglib_cursor_erase, NXGLIB_SUFFIX)
(FAR struct nxbe_state_s *be, FAR const struct nxgl_rect_s *bounds, int planeno)
(
FAR struct nxbe_state_s *be,
FAR const struct nxgl_rect_s *bounds,
int planeno)
{
struct nxgl_rect_s intersection;
struct nxgl_point_s origin;
@@ -93,7 +96,9 @@ void NXGL_FUNCNAME(nxglib_cursor_erase, NXGLIB_SUFFIX)
nxgl_rectintersect(&intersection, &be->cursor.bounds, &be->bkgd.bounds);
/* Check if there is anything in the modified region that we need to handle. */
/* Check if there is anything in the modified region that
* we need to handle.
*/
nxgl_rectintersect(&intersection, &intersection, bounds);
if (!nxgl_nullrect(&intersection))
@@ -145,7 +150,7 @@ void NXGL_FUNCNAME(nxglib_cursor_erase, NXGLIB_SUFFIX)
sline += sstride;
dline += dstride;
}
}
}
}
+16 -12
View File
@@ -60,9 +60,12 @@
****************************************************************************/
void NXGL_FUNCNAME(nxgl_copyrectangle, NXGLIB_SUFFIX)
(FAR struct fb_planeinfo_s *pinfo, FAR const struct nxgl_rect_s *dest,
FAR const void *src, FAR const struct nxgl_point_s *origin,
unsigned int srcstride)
(
FAR struct fb_planeinfo_s *pinfo,
FAR const struct nxgl_rect_s *dest,
FAR const void *src,
FAR const struct nxgl_point_s *origin,
unsigned int srcstride)
{
FAR const uint8_t *sline;
FAR uint8_t *dline;
@@ -99,14 +102,14 @@ void NXGL_FUNCNAME(nxgl_copyrectangle, NXGLIB_SUFFIX)
*/
leadmask = (uint8_t)(0xff >> (8 - NXGL_REMAINDERX(dest->pt1.x)));
tailmask = (uint8_t)(0xff << (8 - NXGL_REMAINDERX(dest->pt2.x-1)));
tailmask = (uint8_t)(0xff << (8 - NXGL_REMAINDERX(dest->pt2.x - 1)));
# else
/* Get the mask for pixels that are ordered so that they pack from the
* LS byte up.
*/
leadmask = (uint8_t)(0xff << (8 - NXGL_REMAINDERX(dest->pt1.x)));
tailmask = (uint8_t)(0xff >> (8 - NXGL_REMAINDERX(dest->pt1.x-1)));
tailmask = (uint8_t)(0xff >> (8 - NXGL_REMAINDERX(dest->pt1.x - 1)));
# endif
#endif
@@ -121,14 +124,14 @@ void NXGL_FUNCNAME(nxgl_copyrectangle, NXGLIB_SUFFIX)
while (rows--)
{
#if NXGLIB_BITSPERPIXEL < 8
/* Handle masking of the fractional initial byte */
/* Handle masking of the fractional initial byte */
mask = leadmask;
sptr = sline;
dptr = dline;
lnlen = width;
mask = leadmask;
sptr = sline;
dptr = dline;
lnlen = width;
if (lnlen > 1 && mask)
if (lnlen > 1 && mask)
{
dptr[0] = (dptr[0] & ~mask) | (sptr[0] & mask);
mask = 0xff;
@@ -142,7 +145,8 @@ void NXGL_FUNCNAME(nxgl_copyrectangle, NXGLIB_SUFFIX)
mask &= tailmask;
if (lnlen > 0 && mask)
{
dptr[lnlen-1] = (dptr[lnlen-1] & ~mask) | (sptr[lnlen-1] & mask);
dptr[lnlen - 1] = (dptr[lnlen - 1] & ~mask) |
(sptr[lnlen - 1] & mask);
lnlen--; /* REVISIT: Is this correct? */
}
+13 -12
View File
@@ -67,9 +67,10 @@
****************************************************************************/
void NXGL_FUNCNAME(nxgl_fillrectangle, NXGLIB_SUFFIX)
(FAR struct fb_planeinfo_s *pinfo,
FAR const struct nxgl_rect_s *rect,
NXGL_PIXEL_T color)
(
FAR struct fb_planeinfo_s *pinfo,
FAR const struct nxgl_rect_s *rect,
NXGL_PIXEL_T color)
{
FAR uint8_t *line;
unsigned int width;
@@ -106,14 +107,14 @@ void NXGL_FUNCNAME(nxgl_fillrectangle, NXGLIB_SUFFIX)
*/
leadmask = (uint8_t)(0xff >> (8 - NXGL_REMAINDERX(rect->pt1.x)));
tailmask = (uint8_t)(0xff << (8 - NXGL_REMAINDERX(rect->pt2.x-1)));
tailmask = (uint8_t)(0xff << (8 - NXGL_REMAINDERX(rect->pt2.x - 1)));
# else
/* Get the mask for pixels that are ordered so that they pack from the
* LS byte up.
*/
leadmask = (uint8_t)(0xff << (8 - NXGL_REMAINDERX(rect->pt1.x)));
tailmask = (uint8_t)(0xff >> (8 - NXGL_REMAINDERX(rect->pt1.x-1)));
tailmask = (uint8_t)(0xff >> (8 - NXGL_REMAINDERX(rect->pt1.x - 1)));
# endif
#endif
@@ -122,13 +123,13 @@ void NXGL_FUNCNAME(nxgl_fillrectangle, NXGLIB_SUFFIX)
while (rows-- > 0)
{
#if NXGLIB_BITSPERPIXEL < 8
/* Handle masking of the fractional initial byte */
/* Handle masking of the fractional initial byte */
mask = leadmask;
dest = line;
lnlen = width;
mask = leadmask;
dest = line;
lnlen = width;
if (lnlen > 1 && mask)
if (lnlen > 1 && mask)
{
dest[0] = (dest[0] & ~mask) | (mpixel & mask);
mask = 0xff;
@@ -141,8 +142,8 @@ void NXGL_FUNCNAME(nxgl_fillrectangle, NXGLIB_SUFFIX)
mask &= tailmask;
if (lnlen > 0 && mask)
{
dest[lnlen-1] = (dest[lnlen-1] & ~mask) | (mpixel & mask);
lnlen--;
dest[lnlen - 1] = (dest[lnlen - 1] & ~mask) | (mpixel & mask);
lnlen--;
}
/* Handle all of the unmasked bytes in-between */
+9 -7
View File
@@ -50,6 +50,7 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Make sure that this file is used in the proper context */
#ifndef NXGLIB_SUFFIX
@@ -70,7 +71,8 @@
*
****************************************************************************/
void NXGL_FUNCNAME(nxgl_filltrapezoid, NXGLIB_SUFFIX)(
void NXGL_FUNCNAME(nxgl_filltrapezoid, NXGLIB_SUFFIX)
(
FAR struct fb_planeinfo_s *pinfo,
FAR const struct nxgl_trapezoid_s *trap,
FAR const struct nxgl_rect_s *bounds,
@@ -202,9 +204,9 @@ void NXGL_FUNCNAME(nxgl_filltrapezoid, NXGLIB_SUFFIX)(
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
* fractional X position
/* Get a clipped copies of the starting and ending X positions.
* This clipped truncates "down" and gives the quantized pixel
* holding the fractional X position
*/
ix1 = ngl_clipl(ix1, bounds->pt1.x);
@@ -242,7 +244,7 @@ void NXGL_FUNCNAME(nxgl_filltrapezoid, NXGLIB_SUFFIX)(
#endif
if (lnlen > 0 && mask)
{
dest[lnlen-1] = (dest[lnlen-1] & ~mask) | (mpixel & mask);
dest[lnlen - 1] = (dest[lnlen - 1] & ~mask) | (mpixel & mask);
lnlen--;
}
@@ -274,12 +276,12 @@ void NXGL_FUNCNAME(nxgl_filltrapezoid, NXGLIB_SUFFIX)(
if (width > 1)
{
NXGL_MEMSET(dest, (NXGL_PIXEL_T)color, width-1);
NXGL_MEMSET(dest, (NXGL_PIXEL_T)color, width - 1);
}
/* And blend the final pixel */
dest += NXGL_SCALEX(width-1);
dest += NXGL_SCALEX(width - 1);
frac = b16frac(x2);
NXGL_BLEND(dest, (NXGL_PIXEL_T)color, frac);
}
+29 -25
View File
@@ -55,9 +55,11 @@
****************************************************************************/
#if NXGLIB_BITSPERPIXEL < 8
static inline void nxgl_lowresmemcpy(FAR uint8_t *dline, FAR const uint8_t *sline,
static inline void nxgl_lowresmemcpy(FAR uint8_t *dline,
FAR const uint8_t *sline,
unsigned int width,
uint8_t leadmask, uint8_t tailmask)
uint8_t leadmask,
uint8_t tailmask)
{
FAR const uint8_t *sptr;
FAR uint8_t *dptr;
@@ -72,29 +74,29 @@ static inline void nxgl_lowresmemcpy(FAR uint8_t *dline, FAR const uint8_t *slin
lnlen = width;
if (lnlen > 1 && mask)
{
dptr[0] = (dptr[0] & ~mask) | (sptr[0] & mask);
mask = 0xff;
dptr++;
sptr++;
lnlen--;
}
{
dptr[0] = (dptr[0] & ~mask) | (sptr[0] & mask);
mask = 0xff;
dptr++;
sptr++;
lnlen--;
}
/* Handle masking of the fractional final byte */
/* Handle masking of the fractional final byte */
mask &= tailmask;
if (lnlen > 0 && mask)
{
dptr[lnlen-1] = (dptr[lnlen-1] & ~mask) | (sptr[lnlen-1] & mask);
lnlen--;
}
mask &= tailmask;
if (lnlen > 0 && mask)
{
dptr[lnlen - 1] = (dptr[lnlen - 1] & ~mask) | (sptr[lnlen - 1] & mask);
lnlen--;
}
/* Handle all of the unmasked bytes in-between */
/* Handle all of the unmasked bytes in-between */
if (lnlen > 0)
{
NXGL_MEMCPY(dptr, sptr, lnlen);
}
if (lnlen > 0)
{
NXGL_MEMCPY(dptr, sptr, lnlen);
}
}
#endif
@@ -112,8 +114,10 @@ static inline void nxgl_lowresmemcpy(FAR uint8_t *dline, FAR const uint8_t *slin
****************************************************************************/
void NXGL_FUNCNAME(nxgl_getrectangle, NXGLIB_SUFFIX)
(FAR struct fb_planeinfo_s *pinfo, FAR const struct nxgl_rect_s *rect,
FAR void *dest, unsigned int deststride)
(
FAR struct fb_planeinfo_s *pinfo,
FAR const struct nxgl_rect_s *rect,
FAR void *dest, unsigned int deststride)
{
FAR const uint8_t *sline;
FAR uint8_t *dline;
@@ -145,14 +149,14 @@ void NXGL_FUNCNAME(nxgl_getrectangle, NXGLIB_SUFFIX)
*/
leadmask = (uint8_t)(0xff >> (8 - NXGL_REMAINDERX(rect->pt1.x)));
tailmask = (uint8_t)(0xff << (8 - NXGL_REMAINDERX(rect->pt2.x-1)));
tailmask = (uint8_t)(0xff << (8 - NXGL_REMAINDERX(rect->pt2.x - 1)));
# else
/* Get the mask for pixels that are ordered so that they pack from the
* LS byte up.
*/
leadmask = (uint8_t)(0xff << (8 - NXGL_REMAINDERX(rect->pt1.x)));
tailmask = (uint8_t)(0xff >> (8 - NXGL_REMAINDERX(rect->pt1.x-1)));
tailmask = (uint8_t)(0xff >> (8 - NXGL_REMAINDERX(rect->pt1.x - 1)));
# endif
#endif
+32 -27
View File
@@ -55,9 +55,11 @@
****************************************************************************/
#if NXGLIB_BITSPERPIXEL < 8
static inline void nxgl_lowresmemcpy(FAR uint8_t *dline, FAR const uint8_t *sline,
static inline void nxgl_lowresmemcpy(FAR uint8_t *dline,
FAR const uint8_t *sline,
unsigned int width,
uint8_t leadmask, uint8_t tailmask)
uint8_t leadmask,
uint8_t tailmask)
{
FAR const uint8_t *sptr;
FAR uint8_t *dptr;
@@ -72,29 +74,29 @@ static inline void nxgl_lowresmemcpy(FAR uint8_t *dline, FAR const uint8_t *slin
lnlen = width;
if (lnlen > 1 && mask)
{
dptr[0] = (dptr[0] & ~mask) | (sptr[0] & mask);
mask = 0xff;
dptr++;
sptr++;
lnlen--;
}
{
dptr[0] = (dptr[0] & ~mask) | (sptr[0] & mask);
mask = 0xff;
dptr++;
sptr++;
lnlen--;
}
/* Handle masking of the fractional final byte */
/* Handle masking of the fractional final byte */
mask &= tailmask;
if (lnlen > 0 && mask)
{
dptr[lnlen-1] = (dptr[lnlen-1] & ~mask) | (sptr[lnlen-1] & mask);
lnlen--;
}
mask &= tailmask;
if (lnlen > 0 && mask)
{
dptr[lnlen - 1] = (dptr[lnlen - 1] & ~mask) | (sptr[lnlen - 1] & mask);
lnlen--;
}
/* Handle all of the unmasked bytes in-between */
/* Handle all of the unmasked bytes in-between */
if (lnlen > 0)
{
NXGL_MEMCPY(dptr, sptr, lnlen);
}
if (lnlen > 0)
{
NXGL_MEMCPY(dptr, sptr, lnlen);
}
}
#endif
@@ -113,9 +115,11 @@ static inline void nxgl_lowresmemcpy(FAR uint8_t *dline, FAR const uint8_t *slin
*
****************************************************************************/
void NXGL_FUNCNAME(nxgl_moverectangle,NXGLIB_SUFFIX)
(FAR struct fb_planeinfo_s *pinfo, FAR const struct nxgl_rect_s *rect,
FAR struct nxgl_point_s *offset)
void NXGL_FUNCNAME(nxgl_moverectangle, NXGLIB_SUFFIX)
(
FAR struct fb_planeinfo_s *pinfo,
FAR const struct nxgl_rect_s *rect,
FAR struct nxgl_point_s *offset)
{
FAR const uint8_t *sline;
FAR uint8_t *dline;
@@ -147,14 +151,14 @@ void NXGL_FUNCNAME(nxgl_moverectangle,NXGLIB_SUFFIX)
*/
leadmask = (uint8_t)(0xff >> (8 - NXGL_REMAINDERX(rect->pt1.x)));
tailmask = (uint8_t)(0xff << (8 - NXGL_REMAINDERX(rect->pt2.x-1)));
tailmask = (uint8_t)(0xff << (8 - NXGL_REMAINDERX(rect->pt2.x - 1)));
# else
/* Get the mask for pixels that are ordered so that they pack from the
* LS byte up.
*/
leadmask = (uint8_t)(0xff << (8 - NXGL_REMAINDERX(rect->pt1.x)));
tailmask = (uint8_t)(0xff >> (8 - NXGL_REMAINDERX(rect->pt1.x-1)));
tailmask = (uint8_t)(0xff >> (8 - NXGL_REMAINDERX(rect->pt1.x - 1)));
# endif
#endif
@@ -181,7 +185,8 @@ void NXGL_FUNCNAME(nxgl_moverectangle,NXGLIB_SUFFIX)
(offset->y < rect->pt1.y && offset->x <= rect->pt1.x))
{
/* Yes.. Copy the rectangle from top down (i.e., adding the stride
* to move to the next, lower row) */
* to move to the next, lower row)
*/
while (rows--)
{
+5 -4
View File
@@ -69,9 +69,10 @@
****************************************************************************/
void NXGL_FUNCNAME(nxgl_setpixel, NXGLIB_SUFFIX)
(FAR struct fb_planeinfo_s *pinfo,
FAR const struct nxgl_point_s *pos,
NXGL_PIXEL_T color)
(
FAR struct fb_planeinfo_s *pinfo,
FAR const struct nxgl_point_s *pos,
NXGL_PIXEL_T color)
{
FAR uint8_t *dest;
@@ -134,7 +135,7 @@ void NXGL_FUNCNAME(nxgl_setpixel, NXGLIB_SUFFIX)
/* Write the pixel (proper alignment assumed) */
pixel = (FAR NXGL_PIXEL_T *)dest;
pixel = (FAR NXGL_PIXEL_T *)dest;
*pixel = color;
#endif
}
+18 -11
View File
@@ -62,9 +62,12 @@
****************************************************************************/
void NXGL_FUNCNAME(nxgl_copyrectangle, NXGLIB_SUFFIX)
(FAR struct lcd_planeinfo_s *pinfo, FAR const struct nxgl_rect_s *dest,
FAR const void *src, FAR const struct nxgl_point_s *origin,
unsigned int srcstride)
(
FAR struct lcd_planeinfo_s *pinfo,
FAR const struct nxgl_rect_s *dest,
FAR const void *src,
FAR const struct nxgl_point_s *origin,
unsigned int srcstride)
{
FAR const uint8_t *sline;
unsigned int ncols;
@@ -83,7 +86,8 @@ void NXGL_FUNCNAME(nxgl_copyrectangle, NXGLIB_SUFFIX)
/* Set up to copy the image */
xoffset = dest->pt1.x - origin->x;
sline = (FAR const uint8_t *)src + NXGL_SCALEX(xoffset) + (dest->pt1.y - origin->y) * srcstride;
sline = (FAR const uint8_t *)src + NXGL_SCALEX(xoffset) +
(dest->pt1.y - origin->y) * srcstride;
#if NXGLIB_BITSPERPIXEL < 8
remainder = NXGL_REMAINDERX(xoffset);
#endif
@@ -93,27 +97,30 @@ void NXGL_FUNCNAME(nxgl_copyrectangle, NXGLIB_SUFFIX)
for (row = dest->pt1.y; row <= dest->pt2.y; row++)
{
#if NXGLIB_BITSPERPIXEL < 8
/* if the source pixel is not aligned with a byte boundary, then we will
* need to copy the image data to the run buffer first.
/* if the source pixel is not aligned with a byte boundary, then we
* will need to copy the image data to the run buffer first.
*/
if (remainder != 0)
{
NXGL_FUNCNAME(nxgl_copyrun, NXGLIB_SUFFIX)(sline, pinfo->buffer, remainder, ncols);
NXGL_FUNCNAME(nxgl_copyrun, NXGLIB_SUFFIX)(sline,
pinfo->buffer,
remainder,
ncols);
pinfo->putrun(row, dest->pt1.x, pinfo->buffer, ncols);
}
else
#endif
{
/* The pixel data is byte aligned. Copy the image data directly from
* the image memory.
/* The pixel data is byte aligned.
* Copy the image data directly from the image memory.
*/
pinfo->putrun(row, dest->pt1.x, sline, ncols);
}
/* Then adjust the source pointer to refer to the next line in the source
* image.
/* Then adjust the source pointer to refer to the next line in
* the source image.
*/
sline += srcstride;
+7 -4
View File
@@ -69,9 +69,10 @@
****************************************************************************/
void NXGL_FUNCNAME(nxgl_fillrectangle, NXGLIB_SUFFIX)
(FAR struct lcd_planeinfo_s *pinfo,
FAR const struct nxgl_rect_s *rect,
NXGL_PIXEL_T color)
(
FAR struct lcd_planeinfo_s *pinfo,
FAR const struct nxgl_rect_s *rect,
NXGL_PIXEL_T color)
{
unsigned int ncols;
unsigned int row;
@@ -82,7 +83,9 @@ void NXGL_FUNCNAME(nxgl_fillrectangle, NXGLIB_SUFFIX)
/* Fill the run buffer with the selected color */
NXGL_FUNCNAME(nxgl_fillrun, NXGLIB_SUFFIX)((NXGLIB_RUNTYPE *)pinfo->buffer, color, ncols);
NXGL_FUNCNAME(nxgl_fillrun, NXGLIB_SUFFIX)((NXGLIB_RUNTYPE *)pinfo->buffer,
color,
ncols);
/* Then fill the rectangle line-by-line */
+8 -5
View File
@@ -71,10 +71,11 @@
****************************************************************************/
void NXGL_FUNCNAME(nxgl_filltrapezoid, NXGLIB_SUFFIX)
(FAR struct lcd_planeinfo_s *pinfo,
FAR const struct nxgl_trapezoid_s *trap,
FAR const struct nxgl_rect_s *bounds,
NXGL_PIXEL_T color)
(
FAR struct lcd_planeinfo_s *pinfo,
FAR const struct nxgl_trapezoid_s *trap,
FAR const struct nxgl_rect_s *bounds,
NXGL_PIXEL_T color)
{
unsigned int ncols;
unsigned int topy;
@@ -199,7 +200,9 @@ void NXGL_FUNCNAME(nxgl_filltrapezoid, NXGLIB_SUFFIX)
ncols = botw;
}
NXGL_FUNCNAME(nxgl_fillrun, NXGLIB_SUFFIX)((NXGLIB_RUNTYPE *)pinfo->buffer, color, ncols);
NXGL_FUNCNAME(nxgl_fillrun, NXGLIB_SUFFIX)((NXGLIB_RUNTYPE *)pinfo->buffer,
color,
ncols);
/* Then fill the trapezoid row-by-row */
+4 -2
View File
@@ -60,8 +60,10 @@
****************************************************************************/
void NXGL_FUNCNAME(nxgl_getrectangle, NXGLIB_SUFFIX)
(FAR struct lcd_planeinfo_s *pinfo, FAR const struct nxgl_rect_s *rect,
FAR void *dest, unsigned int deststride)
(
FAR struct lcd_planeinfo_s *pinfo,
FAR const struct nxgl_rect_s *rect,
FAR void *dest, unsigned int deststride)
{
FAR uint8_t *dline;
unsigned int ncols;
+4 -2
View File
@@ -62,8 +62,10 @@
****************************************************************************/
void NXGL_FUNCNAME(nxgl_moverectangle, NXGLIB_SUFFIX)
(FAR struct lcd_planeinfo_s *pinfo, FAR const struct nxgl_rect_s *rect,
FAR struct nxgl_point_s *offset)
(
FAR struct lcd_planeinfo_s *pinfo,
FAR const struct nxgl_rect_s *rect,
FAR struct nxgl_point_s *offset)
{
unsigned int ncols;
unsigned int srcrow;
+9 -5
View File
@@ -70,9 +70,10 @@
****************************************************************************/
void NXGL_FUNCNAME(nxgl_setpixel, NXGLIB_SUFFIX)
(FAR struct lcd_planeinfo_s *pinfo,
FAR const struct nxgl_point_s *pos,
NXGL_PIXEL_T color)
(
FAR struct lcd_planeinfo_s *pinfo,
FAR const struct nxgl_point_s *pos,
NXGL_PIXEL_T color)
{
#if NXGLIB_BITSPERPIXEL < 8
uint8_t shift;
@@ -124,11 +125,14 @@ void NXGL_FUNCNAME(nxgl_setpixel, NXGLIB_SUFFIX)
/* Handle masking of the fractional byte */
pixel = (pixel & ~mask) | (color & mask);
pixel = (pixel & ~mask) | (color & mask);
/* Write the modified byte back to graphics memory */
pinfo->putrun(pos->y, pos->x, (FAR uint8_t *)&pixel, 8 / NXGLIB_BITSPERPIXEL);
pinfo->putrun(pos->y,
pos->x,
(FAR uint8_t *)&pixel,
8 / NXGLIB_BITSPERPIXEL);
#else
/* Draw a single pixel at this position raster line at this row */
+3 -3
View File
@@ -457,7 +457,7 @@ void pwfb_copyrectangle_32bpp(FAR struct nxbe_window_s *bwnd,
* Name: nxgl_cursor_draw_*bpp
*
* Description:
* Draw the cursor image into the specified position in the graphics memory.
* Draw the cursor image into the specified position in the graphics memory.
*
****************************************************************************/
@@ -506,8 +506,8 @@ void nxglib_cursor_erase_32bpp(FAR struct nxbe_state_s *be,
* Name: nxgl_cursor_backup_*bpp
*
* Description:
* Save the background image for subsequent use to erase the cursor from the
* device graphics memory.
* Save the background image for subsequent use to erase the cursor from the
* device graphics memory.
*
****************************************************************************/
+1 -2
View File
@@ -64,7 +64,6 @@
# undef CONFIG_NX_ANTIALIASING
#endif
/* Set up bit blit macros for this BPP */
#if NXGLIB_BITSPERPIXEL == 1
@@ -239,7 +238,7 @@ extern "C"
#endif
/****************************************************************************
* Public Functions
* Public Functions Definitions
****************************************************************************/
#undef EXTERN
+4 -4
View File
@@ -45,7 +45,7 @@
#include <string.h>
/****************************************************************************
* Public Functions
* Public Functions Definitions
****************************************************************************/
/****************************************************************************
@@ -215,9 +215,9 @@ nxgl_copyrun_2bpp(FAR const uint8_t *src, FAR uint8_t *dest,
outdata |= (indata >> (8 - shift));
nextdata = (indata << shift);
#else
/* If CONFIG_NX_PACKEDMSFIRST is NOT defined, then bits 0-(2*remainder-1)
* are carried over from that last pass through the loop. For example
* if remainder == 1:
/* If CONFIG_NX_PACKEDMSFIRST is NOT defined, then bits
* 0-(2*remainder-1) are carried over from that last pass through the
* loop. For example if remainder == 1:
*
* nextdata = xxAA AAAA - dest = BBAA AAAA
* src = CCCC CCBB - nextdata = xxCC CCCC
+23 -10
View File
@@ -57,11 +57,11 @@
#endif
/****************************************************************************
* Private Types
* Public Types
****************************************************************************/
/****************************************************************************
* Private Data
* Public Data
****************************************************************************/
#if NXGLIB_BITSPERPIXEL == 2
@@ -72,7 +72,7 @@ static uint8_t g_wide_2bpp[4] =
#endif
/****************************************************************************
* Public Functions
* Public Functions Definitions
****************************************************************************/
/****************************************************************************
@@ -145,16 +145,21 @@ static inline void nxgl_fillrun_4bpp(FAR uint8_t *run, nxgl_mxpixel_t color,
static inline void nxgl_fillrun_8bpp(FAR uint8_t *run, nxgl_mxpixel_t color,
size_t npixels)
{
/* Fill the run with the color (it is okay to run a fractional byte overy the end */
/* Fill the run with the color (it is okay to run a fractional byte overy
* the end
*/
memset(run, color, npixels);
}
#elif NXGLIB_BITSPERPIXEL == 16
static inline void nxgl_fillrun_16bpp(FAR uint16_t *run, nxgl_mxpixel_t color,
static inline void nxgl_fillrun_16bpp(FAR uint16_t *run,
nxgl_mxpixel_t color,
size_t npixels)
{
/* Fill the run with the color (it is okay to run a fractional byte overy the end */
/* Fill the run with the color (it is okay to run a fractional byte overy
* the end
*/
while (npixels-- > 0)
{
@@ -163,9 +168,13 @@ static inline void nxgl_fillrun_16bpp(FAR uint16_t *run, nxgl_mxpixel_t color,
}
#elif NXGLIB_BITSPERPIXEL == 24
static inline void nxgl_fillrun_24bpp(FAR uint32_t *run, nxgl_mxpixel_t color, size_t npixels)
static inline void nxgl_fillrun_24bpp(FAR uint32_t *run,
nxgl_mxpixel_t color,
size_t npixels)
{
/* Fill the run with the color (it is okay to run a fractional byte overy the end */
/* Fill the run with the color (it is okay to run a fractional byte overy
* the end
*/
while (npixels-- > 0)
{
@@ -174,9 +183,13 @@ static inline void nxgl_fillrun_24bpp(FAR uint32_t *run, nxgl_mxpixel_t color, s
}
#elif NXGLIB_BITSPERPIXEL == 32
static inline void nxgl_fillrun_32bpp(FAR uint32_t *run, nxgl_mxpixel_t color, size_t npixels)
static inline void nxgl_fillrun_32bpp(FAR uint32_t *run,
nxgl_mxpixel_t color,
size_t npixels)
{
/* Fill the run with the color (it is okay to run a fractional byte overy the end */
/* Fill the run with the color (it is okay to run a fractional byte overy
* the end
*/
while (npixels-- > 0)
{
+16 -12
View File
@@ -60,9 +60,12 @@
****************************************************************************/
void NXGL_FUNCNAME(pwfb_copyrectangle, NXGLIB_SUFFIX)
(FAR struct nxbe_window_s *bwnd, FAR const struct nxgl_rect_s *dest,
FAR const void *src, FAR const struct nxgl_point_s *origin,
unsigned int srcstride)
(
FAR struct nxbe_window_s *bwnd,
FAR const struct nxgl_rect_s *dest,
FAR const void *src,
FAR const struct nxgl_point_s *origin,
unsigned int srcstride)
{
FAR const uint8_t *sline;
FAR uint8_t *dline;
@@ -99,14 +102,14 @@ void NXGL_FUNCNAME(pwfb_copyrectangle, NXGLIB_SUFFIX)
*/
leadmask = (uint8_t)(0xff >> (8 - NXGL_REMAINDERX(dest->pt1.x)));
tailmask = (uint8_t)(0xff << (8 - NXGL_REMAINDERX(dest->pt2.x-1)));
tailmask = (uint8_t)(0xff << (8 - NXGL_REMAINDERX(dest->pt2.x - 1)));
# else
/* Get the mask for pixels that are ordered so that they pack from the
* LS byte up.
*/
leadmask = (uint8_t)(0xff << (8 - NXGL_REMAINDERX(dest->pt1.x)));
tailmask = (uint8_t)(0xff >> (8 - NXGL_REMAINDERX(dest->pt1.x-1)));
tailmask = (uint8_t)(0xff >> (8 - NXGL_REMAINDERX(dest->pt1.x - 1)));
# endif
#endif
@@ -121,14 +124,14 @@ void NXGL_FUNCNAME(pwfb_copyrectangle, NXGLIB_SUFFIX)
while (rows--)
{
#if NXGLIB_BITSPERPIXEL < 8
/* Handle masking of the fractional initial byte */
/* Handle masking of the fractional initial byte */
mask = leadmask;
sptr = sline;
dptr = dline;
lnlen = width;
mask = leadmask;
sptr = sline;
dptr = dline;
lnlen = width;
if (lnlen > 1 && mask)
if (lnlen > 1 && mask)
{
dptr[0] = (dptr[0] & ~mask) | (sptr[0] & mask);
mask = 0xff;
@@ -142,7 +145,8 @@ void NXGL_FUNCNAME(pwfb_copyrectangle, NXGLIB_SUFFIX)
mask &= tailmask;
if (lnlen > 0 && mask)
{
dptr[lnlen-1] = (dptr[lnlen-1] & ~mask) | (sptr[lnlen-1] & mask);
dptr[lnlen - 1] = (dptr[lnlen - 1] & ~mask) |
(sptr[lnlen - 1] & mask);
lnlen--; /* REVISIT: Is this correct? */
}
+12 -11
View File
@@ -67,9 +67,10 @@
****************************************************************************/
void NXGL_FUNCNAME(pwfb_fillrectangle, NXGLIB_SUFFIX)
(FAR struct nxbe_window_s *bwnd,
FAR const struct nxgl_rect_s *rect,
NXGL_PIXEL_T color)
(
FAR struct nxbe_window_s *bwnd,
FAR const struct nxgl_rect_s *rect,
NXGL_PIXEL_T color)
{
FAR uint8_t *line;
unsigned int width;
@@ -107,14 +108,14 @@ void NXGL_FUNCNAME(pwfb_fillrectangle, NXGLIB_SUFFIX)
*/
leadmask = (uint8_t)(0xff >> (8 - NXGL_REMAINDERX(rect->pt1.x)));
tailmask = (uint8_t)(0xff << (8 - NXGL_REMAINDERX(rect->pt2.x-1)));
tailmask = (uint8_t)(0xff << (8 - NXGL_REMAINDERX(rect->pt2.x - 1)));
# else
/* Get the mask for pixels that are ordered so that they pack from the
* LS byte up.
*/
leadmask = (uint8_t)(0xff << (8 - NXGL_REMAINDERX(rect->pt1.x)));
tailmask = (uint8_t)(0xff >> (8 - NXGL_REMAINDERX(rect->pt1.x-1)));
tailmask = (uint8_t)(0xff >> (8 - NXGL_REMAINDERX(rect->pt1.x - 1)));
# endif
#endif
@@ -123,13 +124,13 @@ void NXGL_FUNCNAME(pwfb_fillrectangle, NXGLIB_SUFFIX)
while (rows-- > 0)
{
#if NXGLIB_BITSPERPIXEL < 8
/* Handle masking of the fractional initial byte */
/* Handle masking of the fractional initial byte */
mask = leadmask;
dest = line;
lnlen = width;
mask = leadmask;
dest = line;
lnlen = width;
if (lnlen > 1 && mask)
if (lnlen > 1 && mask)
{
dest[0] = (dest[0] & ~mask) | (mpixel & mask);
mask = 0xff;
@@ -142,7 +143,7 @@ void NXGL_FUNCNAME(pwfb_fillrectangle, NXGLIB_SUFFIX)
mask &= tailmask;
if (lnlen > 0 && mask)
{
dest[lnlen-1] = (dest[lnlen-1] & ~mask) | (mpixel & mask);
dest[lnlen - 1] = (dest[lnlen - 1] & ~mask) | (mpixel & mask);
lnlen--;
}
+8 -7
View File
@@ -71,7 +71,8 @@
*
****************************************************************************/
void NXGL_FUNCNAME(pwfb_filltrapezoid, NXGLIB_SUFFIX)(
void NXGL_FUNCNAME(pwfb_filltrapezoid, NXGLIB_SUFFIX)
(
FAR struct nxbe_window_s *bwnd,
FAR const struct nxgl_trapezoid_s *trap,
FAR const struct nxgl_rect_s *bounds,
@@ -203,9 +204,9 @@ void NXGL_FUNCNAME(pwfb_filltrapezoid, NXGLIB_SUFFIX)(
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
* fractional X position
/* Get a clipped copies of the starting and ending X positions.
* This clipped truncates "down" and gives the quantized pixel
* holding the fractional X position
*/
ix1 = ngl_clipl(ix1, bounds->pt1.x);
@@ -243,7 +244,7 @@ void NXGL_FUNCNAME(pwfb_filltrapezoid, NXGLIB_SUFFIX)(
#endif
if (lnlen > 0 && mask)
{
dest[lnlen-1] = (dest[lnlen-1] & ~mask) | (mpixel & mask);
dest[lnlen - 1] = (dest[lnlen - 1] & ~mask) | (mpixel & mask);
lnlen--;
}
@@ -275,12 +276,12 @@ void NXGL_FUNCNAME(pwfb_filltrapezoid, NXGLIB_SUFFIX)(
if (width > 1)
{
NXGL_MEMSET(dest, (NXGL_PIXEL_T)color, width-1);
NXGL_MEMSET(dest, (NXGL_PIXEL_T)color, width - 1);
}
/* And blend the final pixel */
dest += NXGL_SCALEX(width-1);
dest += NXGL_SCALEX(width - 1);
frac = b16frac(x2);
NXGL_BLEND(dest, (NXGL_PIXEL_T)color, frac);
}
+27 -23
View File
@@ -73,29 +73,30 @@ static inline void pwfb_lowresmemcpy(FAR uint8_t *dline,
lnlen = width;
if (lnlen > 1 && mask)
{
dptr[0] = (dptr[0] & ~mask) | (sptr[0] & mask);
mask = 0xff;
dptr++;
sptr++;
lnlen--;
}
{
dptr[0] = (dptr[0] & ~mask) | (sptr[0] & mask);
mask = 0xff;
dptr++;
sptr++;
lnlen--;
}
/* Handle masking of the fractional final byte */
/* Handle masking of the fractional final byte */
mask &= tailmask;
if (lnlen > 0 && mask)
{
dptr[lnlen-1] = (dptr[lnlen-1] & ~mask) | (sptr[lnlen-1] & mask);
lnlen--;
}
mask &= tailmask;
if (lnlen > 0 && mask)
{
dptr[lnlen - 1] = (dptr[lnlen - 1] & ~mask) |
(sptr[lnlen - 1] & mask);
lnlen--;
}
/* Handle all of the unmasked bytes in-between */
/* Handle all of the unmasked bytes in-between */
if (lnlen > 0)
{
NXGL_MEMCPY(dptr, sptr, lnlen);
}
if (lnlen > 0)
{
NXGL_MEMCPY(dptr, sptr, lnlen);
}
}
#endif
@@ -113,8 +114,11 @@ static inline void pwfb_lowresmemcpy(FAR uint8_t *dline,
****************************************************************************/
void NXGL_FUNCNAME(pwfb_getrectangle, NXGLIB_SUFFIX)
(FAR struct nxbe_window_s *bwnd, FAR const struct nxgl_rect_s *rect,
FAR void *dest, unsigned int deststride)
(
FAR struct nxbe_window_s *bwnd,
FAR const struct nxgl_rect_s *rect,
FAR void *dest,
unsigned int deststride)
{
FAR const uint8_t *sline;
FAR uint8_t *dline;
@@ -146,14 +150,14 @@ void NXGL_FUNCNAME(pwfb_getrectangle, NXGLIB_SUFFIX)
*/
leadmask = (uint8_t)(0xff >> (8 - NXGL_REMAINDERX(rect->pt1.x)));
tailmask = (uint8_t)(0xff << (8 - NXGL_REMAINDERX(rect->pt2.x-1)));
tailmask = (uint8_t)(0xff << (8 - NXGL_REMAINDERX(rect->pt2.x - 1)));
# else
/* Get the mask for pixels that are ordered so that they pack from the
* LS byte up.
*/
leadmask = (uint8_t)(0xff << (8 - NXGL_REMAINDERX(rect->pt1.x)));
tailmask = (uint8_t)(0xff >> (8 - NXGL_REMAINDERX(rect->pt1.x-1)));
tailmask = (uint8_t)(0xff >> (8 - NXGL_REMAINDERX(rect->pt1.x - 1)));
# endif
#endif
+29 -25
View File
@@ -73,29 +73,30 @@ static inline void pwfb_lowresmemcpy(FAR uint8_t *dline,
lnlen = width;
if (lnlen > 1 && mask)
{
dptr[0] = (dptr[0] & ~mask) | (sptr[0] & mask);
mask = 0xff;
dptr++;
sptr++;
lnlen--;
}
{
dptr[0] = (dptr[0] & ~mask) | (sptr[0] & mask);
mask = 0xff;
dptr++;
sptr++;
lnlen--;
}
/* Handle masking of the fractional final byte */
/* Handle masking of the fractional final byte */
mask &= tailmask;
if (lnlen > 0 && mask)
{
dptr[lnlen-1] = (dptr[lnlen-1] & ~mask) | (sptr[lnlen-1] & mask);
lnlen--;
}
mask &= tailmask;
if (lnlen > 0 && mask)
{
dptr[lnlen - 1] = (dptr[lnlen - 1] & ~mask) |
(sptr[lnlen - 1] & mask);
lnlen--;
}
/* Handle all of the unmasked bytes in-between */
/* Handle all of the unmasked bytes in-between */
if (lnlen > 0)
{
NXGL_MEMCPY(dptr, sptr, lnlen);
}
if (lnlen > 0)
{
NXGL_MEMCPY(dptr, sptr, lnlen);
}
}
#endif
@@ -114,9 +115,11 @@ static inline void pwfb_lowresmemcpy(FAR uint8_t *dline,
*
****************************************************************************/
void NXGL_FUNCNAME(pwfb_moverectangle,NXGLIB_SUFFIX)
(FAR struct nxbe_window_s *bwnd, FAR const struct nxgl_rect_s *rect,
FAR struct nxgl_point_s *offset)
void NXGL_FUNCNAME(pwfb_moverectangle, NXGLIB_SUFFIX)
(
FAR struct nxbe_window_s *bwnd,
FAR const struct nxgl_rect_s *rect,
FAR struct nxgl_point_s *offset)
{
FAR const uint8_t *sline;
FAR uint8_t *dline;
@@ -148,14 +151,14 @@ void NXGL_FUNCNAME(pwfb_moverectangle,NXGLIB_SUFFIX)
*/
leadmask = (uint8_t)(0xff >> (8 - NXGL_REMAINDERX(rect->pt1.x)));
tailmask = (uint8_t)(0xff << (8 - NXGL_REMAINDERX(rect->pt2.x-1)));
tailmask = (uint8_t)(0xff << (8 - NXGL_REMAINDERX(rect->pt2.x - 1)));
# else
/* Get the mask for pixels that are ordered so that they pack from the
* LS byte up.
*/
leadmask = (uint8_t)(0xff << (8 - NXGL_REMAINDERX(rect->pt1.x)));
tailmask = (uint8_t)(0xff >> (8 - NXGL_REMAINDERX(rect->pt1.x-1)));
tailmask = (uint8_t)(0xff >> (8 - NXGL_REMAINDERX(rect->pt1.x - 1)));
# endif
#endif
@@ -184,7 +187,8 @@ void NXGL_FUNCNAME(pwfb_moverectangle,NXGLIB_SUFFIX)
(offset->y < rect->pt1.y && offset->x <= rect->pt1.x))
{
/* Yes.. Copy the rectangle from top down (i.e., adding the stride
* to move to the next, lower row) */
* to move to the next, lower row)
*/
while (rows--)
{
+5 -4
View File
@@ -69,9 +69,10 @@
****************************************************************************/
void NXGL_FUNCNAME(pwfb_setpixel, NXGLIB_SUFFIX)
(FAR struct nxbe_window_s *bwnd,
FAR const struct nxgl_point_s *pos,
NXGL_PIXEL_T color)
(
FAR struct nxbe_window_s *bwnd,
FAR const struct nxgl_point_s *pos,
NXGL_PIXEL_T color)
{
FAR uint8_t *dest;
@@ -135,7 +136,7 @@ void NXGL_FUNCNAME(pwfb_setpixel, NXGLIB_SUFFIX)
/* Write the pixel (proper alignment assumed) */
pixel = (FAR NXGL_PIXEL_T *)dest;
pixel = (FAR NXGL_PIXEL_T *)dest;
*pixel = color;
#endif
}