graphics: fix nxstyle errors
Fix nxstyle errors to pass CI Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This commit is contained in:
parent
87596d74dd
commit
f177951c39
@ -75,7 +75,7 @@ struct nxbe_clipstack_s
|
||||
{
|
||||
uint16_t npushed; /* Number of deferred rectangles in stack */
|
||||
uint16_t mxrects; /* The capacity of the stack */
|
||||
struct nxbe_cliprect_s *stack; /* The stack of deferred rectangles */
|
||||
struct nxbe_cliprect_s *stack; /* The stack of deferred rectangles */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
@ -87,7 +87,7 @@ static const uint8_t g_nxcliporder[4][4] =
|
||||
{ NX_TOP_NDX, NX_LEFT_NDX, NX_RIGHT_NDX, NX_BOTTOM_NDX }, /* index = NX_CLIPORDER_TLRB */
|
||||
{ NX_TOP_NDX, NX_RIGHT_NDX, NX_LEFT_NDX, NX_BOTTOM_NDX }, /* NX_CLIPORDER_TRLB */
|
||||
{ NX_BOTTOM_NDX, NX_LEFT_NDX, NX_RIGHT_NDX, NX_TOP_NDX }, /* NX_CLIPORDER_BLRT */
|
||||
{ NX_BOTTOM_NDX, NX_RIGHT_NDX, NX_LEFT_NDX, NX_TOP_NDX } /* NX_CLIPORDER_BRLT */
|
||||
{ NX_BOTTOM_NDX, NX_RIGHT_NDX, NX_LEFT_NDX, NX_TOP_NDX }, /* NX_CLIPORDER_BRLT */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
@ -108,7 +108,8 @@ static inline void nxbe_pushrectangle(FAR struct nxbe_clipstack_s *stack,
|
||||
{
|
||||
/* No then we will need to reallocate the stack to hold more */
|
||||
|
||||
int mxrects = stack->mxrects ? 2 * stack->mxrects : NX_INITIAL_STACKSIZE;
|
||||
int mxrects = stack->mxrects ? 2 *
|
||||
stack->mxrects : NX_INITIAL_STACKSIZE;
|
||||
struct nxbe_cliprect_s *newstack;
|
||||
|
||||
newstack = kmm_realloc(stack->stack,
|
||||
@ -163,8 +164,8 @@ static inline bool nxbe_poprectangle(struct nxbe_clipstack_s *stack,
|
||||
* Input Parameters:
|
||||
* wnd - The window to be clipped.
|
||||
* rect - The region of concern within the window
|
||||
* order - Specifies the order to process the parts of the non-intersecting
|
||||
* sub-rectangles.
|
||||
* order - Specifies the order to process the parts of the
|
||||
* non-intersecting sub-rectangles.
|
||||
* cops - The callbacks to handle obscured and visible parts of the
|
||||
* sub-rectangles.
|
||||
* plane - The raster operations to be used by the callback functions.
|
||||
@ -199,8 +200,8 @@ void nxbe_clipper(FAR struct nxbe_window_s *wnd,
|
||||
nxgl_rectcopy(&rect, dest); /* Start with the whole dest rectangle */
|
||||
do
|
||||
{
|
||||
/* Loop for every window from the current window and above. Only windows
|
||||
* above the current window can obscure the current window
|
||||
/* Loop for every window from the current window and above.
|
||||
* Only windows above the current window can obscure the current window
|
||||
*/
|
||||
|
||||
for (currw = wnd; currw; currw = currw->above)
|
||||
@ -211,9 +212,9 @@ void nxbe_clipper(FAR struct nxbe_window_s *wnd,
|
||||
if (nxgl_rectoverlap(&rect, &currbounds))
|
||||
{
|
||||
/* Yes.. then it obscures all or part of the dest rectangle.
|
||||
* Divide the potentially visible, non-overlapping regions into 4
|
||||
* smaller rectangles and push them onto the stack for processing
|
||||
* on the next time through the outer loop.
|
||||
* Divide the potentially visible, non-overlapping regions into
|
||||
* 4 smaller rectangles and push them onto the stack for
|
||||
* processing on the next time through the outer loop.
|
||||
*/
|
||||
|
||||
nxgl_nonintersecting(nonoverlapped, &rect, &currbounds);
|
||||
@ -223,7 +224,8 @@ void nxbe_clipper(FAR struct nxbe_window_s *wnd,
|
||||
* argument of that name.
|
||||
*/
|
||||
|
||||
struct nxgl_rect_s *candidate = &nonoverlapped[g_nxcliporder[order][i]];
|
||||
struct nxgl_rect_s *candidate =
|
||||
&nonoverlapped[g_nxcliporder[order][i]];
|
||||
if (!nxgl_nullrect(candidate))
|
||||
{
|
||||
nxbe_pushrectangle(&stack, currw->above, candidate);
|
||||
|
@ -105,15 +105,15 @@ int nxbe_colormap(FAR NX_DRIVERTYPE *dev)
|
||||
ndx = 0;
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
rval = (i * (CONFIG_NX_NCOLORS-1) / 5) << 8;
|
||||
rval = (i * (CONFIG_NX_NCOLORS - 1) / 5) << 8;
|
||||
for (j = 0; j < 6; j++)
|
||||
{
|
||||
gval = (j * (CONFIG_NX_NCOLORS-1) / 5) << 8;
|
||||
gval = (j * (CONFIG_NX_NCOLORS - 1) / 5) << 8;
|
||||
for (k = 0; k < 6; k++)
|
||||
{
|
||||
red[ndx] = rval;
|
||||
green[ndx] = gval;
|
||||
blue[ndx] = k * (CONFIG_NX_NCOLORS-1) / 5;
|
||||
blue[ndx] = k * (CONFIG_NX_NCOLORS - 1) / 5;
|
||||
ndx++;
|
||||
}
|
||||
}
|
||||
|
@ -134,7 +134,9 @@ void nxbe_cursor_enable(FAR struct nxbe_state_s *be, bool enable)
|
||||
#ifdef CONFIG_NX_SWCURSOR
|
||||
DEBUGASSERT(be->cursor.bkgd != NULL);
|
||||
|
||||
/* Handle the case where some or all of the cursor is off the display. */
|
||||
/* Handle the case where some or all of the cursor is
|
||||
* off the display.
|
||||
*/
|
||||
|
||||
nxgl_rectintersect(&bounds, &be->cursor.bounds, &be->bkgd.bounds);
|
||||
if (!nxgl_nullrect(&bounds))
|
||||
@ -196,7 +198,9 @@ void nxbe_cursor_setimage(FAR struct nxbe_state_s *be,
|
||||
|
||||
if (be->cursor.visible)
|
||||
{
|
||||
/* Handle the case where some or all of the cursor is off the display. */
|
||||
/* Handle the case where some or all of the cursor is
|
||||
* off the display.
|
||||
*/
|
||||
|
||||
nxgl_rectintersect(&bounds, &be->cursor.bounds, &be->bkgd.bounds);
|
||||
if (!nxgl_nullrect(&bounds))
|
||||
@ -344,7 +348,9 @@ void nxbe_cursor_setposition(FAR struct nxbe_state_s *be,
|
||||
{
|
||||
struct nxgl_rect_s bounds;
|
||||
|
||||
/* Handle the case where some or all of the cursor is off the display. */
|
||||
/* Handle the case where some or all of the cursor is
|
||||
* off the display.
|
||||
*/
|
||||
|
||||
nxgl_rectintersect(&bounds, &be->cursor.bounds, &be->bkgd.bounds);
|
||||
if (!nxgl_nullrect(&bounds))
|
||||
|
@ -67,9 +67,10 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void _nxbe_cursor_backupdraw_dev(FAR struct nxbe_state_s *be,
|
||||
FAR const struct nxgl_rect_s *rect,
|
||||
int plane)
|
||||
static inline void _nxbe_cursor_backupdraw_dev(
|
||||
FAR struct nxbe_state_s *be,
|
||||
FAR const struct nxgl_rect_s *rect,
|
||||
int plane)
|
||||
{
|
||||
/* Save the modified cursor background region. */
|
||||
|
||||
|
@ -164,8 +164,10 @@ static inline void nxbe_getrectangle_pwfb(FAR struct nxbe_window_s *wnd,
|
||||
****************************************************************************/
|
||||
|
||||
void nxbe_getrectangle(FAR struct nxbe_window_s *wnd,
|
||||
FAR const struct nxgl_rect_s *rect, unsigned int plane,
|
||||
FAR uint8_t *dest, unsigned int deststride)
|
||||
FAR const struct nxgl_rect_s *rect,
|
||||
unsigned int plane,
|
||||
FAR uint8_t *dest,
|
||||
unsigned int deststride)
|
||||
{
|
||||
struct nxgl_rect_s remaining;
|
||||
|
||||
@ -217,6 +219,7 @@ void nxbe_getrectangle(FAR struct nxbe_window_s *wnd,
|
||||
|
||||
wnd->be->plane[0].cursor.erase(wnd->be, &remaining, 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Get the rectangle from the graphics device memory.
|
||||
* NOTE: Since raw graphic memory is returned, the returned memory
|
||||
|
@ -70,7 +70,8 @@ static void nxbe_clipvisible(FAR struct nxbe_clipops_s *cops,
|
||||
FAR struct nxbe_plane_s *plane,
|
||||
FAR const struct nxgl_rect_s *rect)
|
||||
{
|
||||
FAR struct nxbe_setvisibility_s *info = (FAR struct nxbe_setvisibility_s *)cops;
|
||||
FAR struct nxbe_setvisibility_s *info =
|
||||
(FAR struct nxbe_setvisibility_s *)cops;
|
||||
info->visible = true;
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,8 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void nxbe_redrawbelow(FAR struct nxbe_state_s *be, FAR struct nxbe_window_s *wnd,
|
||||
void nxbe_redrawbelow(FAR struct nxbe_state_s *be,
|
||||
FAR struct nxbe_window_s *wnd,
|
||||
FAR const struct nxgl_rect_s *rect)
|
||||
{
|
||||
FAR struct nxbe_window_s *currwnd;
|
||||
|
@ -69,7 +69,10 @@ void nxbe_setposition(FAR struct nxbe_window_s *wnd,
|
||||
|
||||
/* Back out the old window origin position from the bounding box */
|
||||
|
||||
nxgl_rectoffset(&rect, &wnd->bounds, -wnd->bounds.pt1.x, -wnd->bounds.pt1.y);
|
||||
nxgl_rectoffset(&rect,
|
||||
&wnd->bounds,
|
||||
-wnd->bounds.pt1.x,
|
||||
-wnd->bounds.pt1.y);
|
||||
|
||||
/* Add the new window origin into the bounding box */
|
||||
|
||||
|
@ -232,8 +232,8 @@ static void nxbe_realloc(FAR struct nxbe_window_s *wnd,
|
||||
nxmu_redrawreq(wnd, &bounds);
|
||||
}
|
||||
|
||||
/* If the window became taller, then send a message requesting an update
|
||||
* of the new territory at the bottom.
|
||||
/* If the window became taller, then send a message requesting an
|
||||
* update of the new territory at the bottom.
|
||||
*/
|
||||
|
||||
if (oldheight < newheight)
|
||||
|
@ -87,7 +87,7 @@ void nxbe_show_window(FAR struct nxbe_window_s *wnd)
|
||||
|
||||
be->topwnd->below = wnd;
|
||||
|
||||
/* Redraw this window and the other that are below us */
|
||||
/* Redraw this window and the other that are below us */
|
||||
|
||||
nxbe_redrawbelow(be, wnd, &wnd->bounds);
|
||||
}
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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? */
|
||||
}
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
@ -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--)
|
||||
{
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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? */
|
||||
}
|
||||
|
||||
|
@ -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--;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
@ -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--)
|
||||
{
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ extern "C"
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
* Public Functions Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
@ -177,8 +177,8 @@ void nxmu_requestbkgd(FAR struct nxmu_conn_s *conn,
|
||||
* Name: nxmu_releasebkgd
|
||||
*
|
||||
* Description:
|
||||
* Release the background window previously acquired using nxmu_openbgwindow
|
||||
* and return control of the background to NX.
|
||||
* Release the background window previously acquired using
|
||||
* nxmu_openbgwindow and return control of the background to NX.
|
||||
*
|
||||
* Input Parameters:
|
||||
* nxmu - The NXMU state structure
|
||||
|
@ -229,7 +229,10 @@ int nxmu_mousein(FAR struct nxmu_state_s *nxmu,
|
||||
outmsg.buttons = g_mbutton;
|
||||
nxgl_vectsubtract(&outmsg.pos, &g_mpos, &g_mwnd->bounds.pt1);
|
||||
|
||||
return nxmu_sendclientwindow(g_mwnd, &outmsg, sizeof(struct nxclimsg_mousein_s));
|
||||
return nxmu_sendclientwindow(
|
||||
g_mwnd,
|
||||
&outmsg,
|
||||
sizeof(struct nxclimsg_mousein_s));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -246,8 +249,9 @@ int nxmu_mousein(FAR struct nxmu_state_s *nxmu,
|
||||
|
||||
for (wnd = nxmu->be.topwnd; wnd; wnd = wnd->below)
|
||||
{
|
||||
/* The background window normally has no callback structure (unless
|
||||
* a client has taken control of the background via nx_requestbkgd()).
|
||||
/* The background window normally has no callback structure
|
||||
* (unlessa client has taken control of the background via
|
||||
* nx_requestbkgd()).
|
||||
*/
|
||||
|
||||
if (wnd->cb)
|
||||
|
@ -71,7 +71,8 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void nxmu_openwindow(FAR struct nxbe_state_s *be, FAR struct nxbe_window_s *wnd)
|
||||
void nxmu_openwindow(FAR struct nxbe_state_s *be,
|
||||
FAR struct nxbe_window_s *wnd)
|
||||
{
|
||||
#ifdef CONFIG_NX_RAMBACKED
|
||||
nxgl_coord_t width;
|
||||
|
@ -54,8 +54,8 @@
|
||||
* Name: nxmu_releasebkgd
|
||||
*
|
||||
* Description:
|
||||
* Release the background window previously acquired using nxmu_openbgwindow
|
||||
* and return control of the background to NX.
|
||||
* Release the background window previously acquired using
|
||||
* nxmu_openbgwindow and return control of the background to NX.
|
||||
*
|
||||
* Input Parameters:
|
||||
* nxmu - The NXMU state structure
|
||||
|
@ -80,7 +80,9 @@ void nxmu_reportposition(FAR struct nxbe_window_s *wnd)
|
||||
|
||||
/* And provide this to the client */
|
||||
|
||||
ret = nxmu_sendclientwindow(wnd, &outmsg, sizeof(struct nxclimsg_newposition_s));
|
||||
ret = nxmu_sendclientwindow(wnd,
|
||||
&outmsg,
|
||||
sizeof(struct nxclimsg_newposition_s));
|
||||
if (ret < 0)
|
||||
{
|
||||
gerr("ERROR: nxmu_sendclient failed: %d\n", errno);
|
||||
|
@ -182,7 +182,9 @@ static int nxterm_bitmap(FAR struct nxterm_state_s *priv,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
NXTERM nx_register(NXWINDOW hwnd, FAR struct nxterm_window_s *wndo, int minor)
|
||||
NXTERM nx_register(NXWINDOW hwnd,
|
||||
FAR struct nxterm_window_s *wndo,
|
||||
int minor)
|
||||
{
|
||||
return nxterm_register((NXTERM)hwnd, wndo, &g_nxops, minor);
|
||||
}
|
||||
|
@ -288,7 +288,7 @@ static ssize_t nxterm_write(FAR struct file *filep, FAR const char *buffer,
|
||||
|
||||
for (i = 1; i < priv->nseq; i++)
|
||||
{
|
||||
priv->seq[i-1] = priv->seq[i];
|
||||
priv->seq[i - 1] = priv->seq[i];
|
||||
}
|
||||
|
||||
priv->nseq--;
|
||||
@ -439,7 +439,8 @@ int nxterm_ioctl_tap(int cmd, uintptr_t arg)
|
||||
/* CMD: NXTERMIOC_NXTERM_RESIZE
|
||||
* DESCRIPTION: Inform NxTerm keyboard the the size of the window has
|
||||
* changed
|
||||
* ARG: A reference readable instance of struct nxtermioc_resize_s
|
||||
* ARG: A reference readable instance of struct
|
||||
* nxtermioc_resize_s
|
||||
* CONFIGURATION: CONFIG_NXTERM
|
||||
*/
|
||||
|
||||
|
@ -171,7 +171,9 @@ FAR const struct nxterm_bitmap_s *
|
||||
glyph = nxf_cache_getglyph(priv->fcache, ch);
|
||||
if (!glyph)
|
||||
{
|
||||
/* No, there is no font for this code. Just mark this as a space. */
|
||||
/* No, there is no font for this code.
|
||||
* Just mark this as a space.
|
||||
*/
|
||||
|
||||
bm->flags |= BMFLAGS_NOGLYPH;
|
||||
|
||||
|
@ -73,7 +73,9 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void nxterm_redraw(NXTERM handle, FAR const struct nxgl_rect_s *rect, bool more)
|
||||
void nxterm_redraw(NXTERM handle,
|
||||
FAR const struct nxgl_rect_s *rect,
|
||||
bool more)
|
||||
{
|
||||
FAR struct nxterm_state_s *priv;
|
||||
int ret;
|
||||
|
@ -77,10 +77,10 @@ static inline void nxterm_movedisplay(FAR struct nxterm_state_s *priv,
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
/* Move each row, one at a time. They could all be moved at once (by calling
|
||||
* nxterm_redraw), but the since the region is cleared, then re-written, the
|
||||
* effect would not be good. Below the region is also cleared and re-written,
|
||||
* however, in much smaller chunks.
|
||||
/* Move each row, one at a time. They could all be moved at once (by
|
||||
* calling nxterm_redraw), but the since the region is cleared, then
|
||||
* re-written, the effect would not be good. Below the region is also
|
||||
* cleared and re-written, however, in much smaller chunks.
|
||||
*/
|
||||
|
||||
rect.pt1.x = 0;
|
||||
@ -204,8 +204,9 @@ void nxterm_scroll(FAR struct nxterm_state_s *priv, int scrollheight)
|
||||
sizeof(struct nxterm_bitmap_s));
|
||||
}
|
||||
|
||||
/* Decrement the number of cached characters ('i' is not incremented
|
||||
* in this case because it already points to the next character)
|
||||
/* Decrement the number of cached characters ('i' is not
|
||||
* incremented in this case because it already points to the next
|
||||
* character)
|
||||
*/
|
||||
|
||||
priv->nchars--;
|
||||
|
@ -77,7 +77,9 @@ int nxterm_semwait(FAR struct nxterm_state_s *priv)
|
||||
me = getpid();
|
||||
if (priv->holder != me)
|
||||
{
|
||||
/* No.. then wait until the thread that does hold it is finished with it */
|
||||
/* No..
|
||||
* then wait until the thread that does hold it is finished with it
|
||||
*/
|
||||
|
||||
ret = nxsem_wait(&priv->exclsem);
|
||||
if (ret == OK)
|
||||
|
@ -151,6 +151,7 @@ nxterm_vt100part(FAR struct nxterm_state_s *priv, int seqsize)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -170,8 +171,9 @@ nxterm_vt100part(FAR struct nxterm_state_s *priv, int seqsize)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static enum nxterm_vt100state_e nxterm_vt100seq(FAR struct nxterm_state_s *priv,
|
||||
int seqsize)
|
||||
static enum nxterm_vt100state_e nxterm_vt100seq(
|
||||
FAR struct nxterm_state_s *priv,
|
||||
int seqsize)
|
||||
{
|
||||
FAR const struct vt100_sequence_s *seq;
|
||||
enum nxterm_vt100state_e ret;
|
||||
@ -233,7 +235,8 @@ static enum nxterm_vt100state_e nxterm_vt100seq(FAR struct nxterm_state_s *priv,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
enum nxterm_vt100state_e nxterm_vt100(FAR struct nxterm_state_s *priv, char ch)
|
||||
enum nxterm_vt100state_e nxterm_vt100(FAR struct nxterm_state_s *priv,
|
||||
char ch)
|
||||
{
|
||||
enum nxterm_vt100state_e ret;
|
||||
int seqsize;
|
||||
@ -281,5 +284,6 @@ enum nxterm_vt100state_e nxterm_vt100(FAR struct nxterm_state_s *priv, char ch)
|
||||
|
||||
priv->nseq = seqsize;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -157,7 +157,8 @@ static int nxtkcon_bitmap(FAR struct nxterm_state_s *priv,
|
||||
FAR const struct nxgl_point_s *origin,
|
||||
unsigned int stride)
|
||||
{
|
||||
return nxtk_bitmapwindow((NXTKWINDOW)priv->handle, dest, src, origin, stride);
|
||||
return nxtk_bitmapwindow((NXTKWINDOW)priv->handle,
|
||||
dest, src, origin, stride);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -172,8 +173,9 @@ static int nxtkcon_bitmap(FAR struct nxterm_state_s *priv,
|
||||
* registered at /dev/nxtkN where N is the provided minor number.
|
||||
*
|
||||
* Input Parameters:
|
||||
* hfwnd - A handle that will be used to access the window. The window must
|
||||
* persist and this handle must be valid for the life of the NX console.
|
||||
* hfwnd - A handle that will be used to access the window.
|
||||
* The window must persist and this handle must be valid for the
|
||||
* life of the NX console.
|
||||
* wndo - Describes the window and font to be used
|
||||
* minor - The device minor number
|
||||
*
|
||||
|
@ -157,7 +157,8 @@ static int nxtool_bitmap(FAR struct nxterm_state_s *priv,
|
||||
FAR const struct nxgl_point_s *origin,
|
||||
unsigned int stride)
|
||||
{
|
||||
return nxtk_bitmaptoolbar((NXTKWINDOW)priv->handle, dest, src, origin, stride);
|
||||
return nxtk_bitmaptoolbar((NXTKWINDOW)priv->handle,
|
||||
dest, src, origin, stride);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -184,7 +185,9 @@ static int nxtool_bitmap(FAR struct nxterm_state_s *priv,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
NXTERM nxtool_register(NXTKWINDOW hfwnd, FAR struct nxterm_window_s *wndo, int minor)
|
||||
NXTERM nxtool_register(NXTKWINDOW hfwnd,
|
||||
FAR struct nxterm_window_s *wndo,
|
||||
int minor)
|
||||
{
|
||||
return nxterm_register((NXTERM)hfwnd, wndo, &g_nxtoolops, minor);
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ uint8_t vnc_convert_rgb8_222(lfb_color_t rgb)
|
||||
|
||||
return (uint8_t)(((rgb >> 2) & 0x30) |
|
||||
((rgb >> 1) & 0x0c) |
|
||||
( rgb & 0x03));
|
||||
(rgb & 0x03));
|
||||
}
|
||||
|
||||
uint8_t vnc_convert_rgb8_332(lfb_color_t rgb)
|
||||
@ -206,7 +206,7 @@ uint8_t vnc_convert_rgb8_222(lfb_color_t rgb)
|
||||
|
||||
return (uint8_t)(((rgb >> 18) & 0x00000030) |
|
||||
((rgb >> 12) & 0x0000000c) |
|
||||
(rgb >> 6) & 0x00000003));
|
||||
((rgb >> 6) & 0x00000003));
|
||||
}
|
||||
|
||||
uint8_t vnc_convert_rgb8_332(lfb_color_t rgb)
|
||||
@ -220,7 +220,7 @@ uint8_t vnc_convert_rgb8_332(lfb_color_t rgb)
|
||||
|
||||
return (uint8_t)(((rgb >> 16) & 0x00000070) |
|
||||
((rgb >> 11) & 0x0000001c) |
|
||||
(rgb >> 6) & 0x00000003));
|
||||
((rgb >> 6) & 0x00000003));
|
||||
}
|
||||
|
||||
uint16_t vnc_convert_rgb16_555(lfb_color_t rgb)
|
||||
@ -289,26 +289,33 @@ uint32_t vnc_convert_rgb32_888(lfb_color_t rgb)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int vnc_colors(FAR struct vnc_session_s *session, FAR struct nxgl_rect_s *rect,
|
||||
unsigned int maxcolors, FAR lfb_color_t *colors)
|
||||
int vnc_colors(FAR struct vnc_session_s *session,
|
||||
FAR struct nxgl_rect_s *rect,
|
||||
unsigned int maxcolors,
|
||||
FAR lfb_color_t *colors)
|
||||
{
|
||||
FAR const lfb_color_t *rowstart;
|
||||
FAR const lfb_color_t *pixptr;
|
||||
lfb_color_t pixel;
|
||||
unsigned int counts[8] = {0, 0, 0, 0, 0, 0, 0, 0};
|
||||
nxgl_coord_t x;
|
||||
nxgl_coord_t y;
|
||||
int ncolors = 0;
|
||||
int pixndx;
|
||||
int maxndx;
|
||||
int cmpndx;
|
||||
unsigned int counts[8] =
|
||||
{
|
||||
0, 0, 0, 0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
DEBUGASSERT(session != NULL && rect != NULL && maxcolors <= 8 && colors != NULL);
|
||||
DEBUGASSERT(session != NULL && rect != NULL &&
|
||||
maxcolors <= 8 && colors != NULL);
|
||||
|
||||
/* Pointer to the first pixel in the first row in the local framebuffer */
|
||||
|
||||
rowstart = (FAR lfb_color_t *)
|
||||
(session->fb + RFB_STRIDE * rect->pt1.y + RFB_BYTESPERPIXEL * rect->pt1.x);
|
||||
(session->fb + RFB_STRIDE * rect->pt1.y +
|
||||
RFB_BYTESPERPIXEL * rect->pt1.x);
|
||||
|
||||
/* Loop for each row in the rectangle */
|
||||
|
||||
@ -341,7 +348,7 @@ int vnc_colors(FAR struct vnc_session_s *session, FAR struct nxgl_rect_s *rect,
|
||||
counts[pixndx]++;
|
||||
}
|
||||
|
||||
/* Do we have space for another color? */
|
||||
/* Do we have space for another color? */
|
||||
|
||||
else if (ncolors >= maxcolors)
|
||||
{
|
||||
@ -395,6 +402,7 @@ int vnc_colors(FAR struct vnc_session_s *session, FAR struct nxgl_rect_s *rect,
|
||||
if (maxndx != pixndx)
|
||||
{
|
||||
/* Otherwise swap color N and color M */
|
||||
|
||||
/* Remember color N */
|
||||
|
||||
lfb_color_t tmpcolor = colors[pixndx];
|
||||
|
@ -154,19 +154,17 @@ static const struct vnc_keymap_s g_asciimap[] =
|
||||
{ASCII_7, XK_KP_7},
|
||||
{ASCII_8, XK_KP_8},
|
||||
{ASCII_9, XK_KP_9},
|
||||
|
||||
{ASCII_ASTERISK, XK_KP_Multiply},
|
||||
{ASCII_PLUS, XK_KP_Add},
|
||||
{ASCII_COMMA, XK_KP_Separator},
|
||||
{ASCII_HYPHEN, XK_KP_Subtract},
|
||||
{ASCII_PERIOD, XK_KP_Decimal},
|
||||
{ASCII_DIVIDE, XK_KP_Divide},
|
||||
|
||||
{ASCII_SPACE, XK_KP_Space},
|
||||
{ASCII_TAB, XK_KP_Tab},
|
||||
{ASCII_CR, XK_KP_Enter}
|
||||
{ASCII_CR, XK_KP_Enter},
|
||||
#ifdef CONFIG_VNCSERVER_KBDENCODE
|
||||
, {ASCII_DEL, XK_KP_Delete}
|
||||
{ASCII_DEL, XK_KP_Delete},
|
||||
#endif
|
||||
};
|
||||
|
||||
@ -198,7 +196,6 @@ static const struct vnc_keymap_s g_cursor[] =
|
||||
{KEYCODE_PAGEDOWN, XK_KP_Page_Down},
|
||||
{KEYCODE_INSERT, XK_Insert},
|
||||
{KEYCODE_INSERT, XK_KP_Insert},
|
||||
|
||||
{KEYCODE_SELECT, XK_Select},
|
||||
{KEYCODE_EXECUTE, XK_Execute},
|
||||
{KEYCODE_HELP, XK_Help},
|
||||
@ -209,7 +206,6 @@ static const struct vnc_keymap_s g_cursor[] =
|
||||
{KEYCODE_CLEAR, XK_Clear},
|
||||
{MOD_SCROLLLOCK, XK_Scroll_Lock},
|
||||
{MOD_NUMLOCK, XK_Num_Lock},
|
||||
|
||||
{KEYCODE_F1, XK_KP_F1},
|
||||
{KEYCODE_F1, XK_F1},
|
||||
{KEYCODE_F2, XK_KP_F2},
|
||||
@ -508,7 +504,8 @@ void vnc_key_map(FAR struct vnc_session_s *session, uint16_t keysym,
|
||||
}
|
||||
#endif
|
||||
|
||||
/* If no external keyboard input handler has been provided, then we have to drop the keyboard input.
|
||||
/* If no external keyboard input handler has been provided,
|
||||
* then we have to drop the keyboard input.
|
||||
*/
|
||||
|
||||
if (session->kbdout == NULL)
|
||||
@ -633,7 +630,10 @@ void vnc_key_map(FAR struct vnc_session_s *session, uint16_t keysym,
|
||||
* Name: vnc_kbdout
|
||||
*
|
||||
* Description:
|
||||
* This is the default keyboard callout function. This is simply wrappers around nx_kdbout(), respectively. When configured using vnc_fbinitialize(), the 'arg' must be the correct NXHANDLE value.
|
||||
* This is the default keyboard callout function.
|
||||
* This is simply wrappers around nx_kdbout(), respectively.
|
||||
* When configured using vnc_fbinitialize(), the 'arg' must be the correct
|
||||
* NXHANDLE value.
|
||||
*
|
||||
* Input Parameters:
|
||||
* arg - The NXHANDLE from the NX graphics subsystem
|
||||
|
@ -323,10 +323,12 @@ int vnc_negotiate(FAR struct vnc_session_s *session)
|
||||
*
|
||||
* "After receiving the ClientInit message, the server sends a ServerInit
|
||||
* message. This tells the client the width and height of the server’s
|
||||
* framebuffer, its pixel format and the name associated with the desktop:"
|
||||
* framebuffer, its pixel format and the name associated with the
|
||||
* desktop:"
|
||||
*
|
||||
* RealVNC client supports this resolutions:
|
||||
* Full (all available colors) - Max resolution of the platform (TrueColor)
|
||||
* Full (all available colors) - Max resolution of the platform
|
||||
* (TrueColor)
|
||||
* Medium (256 colors) - 256 colors (Paletted)
|
||||
* Low (64 colors) - RGB8 2:2:2 (default, TrueColor)
|
||||
* Very Low (8 colors) - RGB3 1:1:1 (TrueColor)
|
||||
|
@ -102,7 +102,7 @@ static size_t vnc_copy8(FAR struct vnc_session_s *session,
|
||||
update = (FAR struct rfb_framebufferupdate_s *)session->outbuf;
|
||||
dest = (FAR uint8_t *)update->rect[0].data;
|
||||
|
||||
/* Source rectangle start address (left/top)*/
|
||||
/* Source rectangle start address (left/top) */
|
||||
|
||||
srcleft = (FAR lfb_color_t *)
|
||||
(session->fb + RFB_STRIDE * row + RFB_BYTESPERPIXEL * col);
|
||||
@ -162,7 +162,7 @@ static size_t vnc_copy16(FAR struct vnc_session_s *session,
|
||||
update = (FAR struct rfb_framebufferupdate_s *)session->outbuf;
|
||||
dest = (FAR uint8_t *)update->rect[0].data;
|
||||
|
||||
/* Source rectangle start address (left/top)*/
|
||||
/* Source rectangle start address (left/top) */
|
||||
|
||||
srcleft = (FAR lfb_color_t *)
|
||||
(session->fb + RFB_STRIDE * row + RFB_BYTESPERPIXEL * col);
|
||||
@ -234,7 +234,7 @@ static size_t vnc_copy32(FAR struct vnc_session_s *session,
|
||||
update = (FAR struct rfb_framebufferupdate_s *)session->outbuf;
|
||||
dest = (FAR uint8_t *)update->rect[0].data;
|
||||
|
||||
/* Source rectangle start address (left/top)*/
|
||||
/* Source rectangle start address (left/top) */
|
||||
|
||||
srcleft = (FAR lfb_color_t *)
|
||||
(session->fb + RFB_STRIDE * row + RFB_BYTESPERPIXEL * col);
|
||||
@ -454,7 +454,8 @@ int vnc_raw(FAR struct vnc_session_s *session, FAR struct nxgl_rect_s *rect)
|
||||
|
||||
/* Format the FramebufferUpdate message */
|
||||
|
||||
update = (FAR struct rfb_framebufferupdate_s *)session->outbuf;
|
||||
update = (FAR struct rfb_framebufferupdate_s *)session->outbuf;
|
||||
|
||||
update->msgtype = RFB_FBUPDATE_MSG;
|
||||
update->padding = 0;
|
||||
rfb_putbe16(update->nrect, 1);
|
||||
|
@ -201,8 +201,8 @@ int vnc_receiver(FAR struct vnc_session_s *session)
|
||||
/* Read the rest of the SetPixelFormat message */
|
||||
|
||||
ret = vnc_read_remainder(session,
|
||||
sizeof(struct rfb_setpixelformat_s) - 1,
|
||||
1);
|
||||
sizeof(struct rfb_setpixelformat_s) - 1,
|
||||
1);
|
||||
if (ret < 0)
|
||||
{
|
||||
gerr("ERROR: Failed to read SetPixelFormat message: %d\n",
|
||||
@ -217,7 +217,10 @@ int vnc_receiver(FAR struct vnc_session_s *session)
|
||||
if (ret < 0)
|
||||
{
|
||||
/* We do not support this pixel format */
|
||||
/* REVISIT: We are going to be putting garbage on the RFB */
|
||||
|
||||
/* REVISIT:
|
||||
* We are going to be putting garbage on the RFB
|
||||
*/
|
||||
|
||||
gerr("ERROR: PixelFormat not supported\n");
|
||||
}
|
||||
@ -248,7 +251,9 @@ int vnc_receiver(FAR struct vnc_session_s *session)
|
||||
{
|
||||
/* Read the following encodings */
|
||||
|
||||
encodings = (FAR struct rfb_setencodings_s *)session->inbuf;
|
||||
encodings = (FAR struct rfb_setencodings_s *)
|
||||
session->inbuf;
|
||||
|
||||
nencodings = rfb_getbe16(encodings->nencodings);
|
||||
|
||||
ret = vnc_read_remainder(session,
|
||||
@ -356,6 +361,7 @@ int vnc_receiver(FAR struct vnc_session_s *session)
|
||||
ret);
|
||||
}
|
||||
#ifdef CONFIG_NX_XYINPUT
|
||||
|
||||
/* REVISIT: How will be get the NX handle? */
|
||||
|
||||
else if (session->mouseout != NULL)
|
||||
|
@ -231,7 +231,8 @@ int vnc_rre(FAR struct vnc_session_s *session, FAR struct nxgl_rect_s *rect)
|
||||
* rectangle.
|
||||
*/
|
||||
|
||||
rre = (FAR struct rfb_framebufferupdate_s *)session->outbuf;
|
||||
rre = (FAR struct rfb_framebufferupdate_s *)session->outbuf;
|
||||
|
||||
rre->msgtype = RFB_FBUPDATE_MSG;
|
||||
rre->padding = 0;
|
||||
rfb_putbe16(rre->nrect, 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user