forked from nuttx/nuttx-update
Squashed commit of the following:
graphics/nxbe/nxbe_bitmap.c: Fix another coordinate system problem. graphics/: Review use of device coordinate system with window frambebuffer and make fixes accordingly. graphics/nxbe/nxbe_fill.c: Fix a coordinate system bug. Was trying to update the window fraembuffer using the device coordinate system. Need to use the relative coordinate system. graphics/: Use DEBUGASSERT instead of return an error since the is no user to handle the errors within the NX server. Use CONFIG_DEBUG_GRAPHICS instead of CONFIG_DEBUG_FEATURES in most cases. graphics/: Nothing under graphics/ should set the errno.
This commit is contained in:
parent
18d52ecee2
commit
92554257b9
48 changed files with 240 additions and 603 deletions
|
@ -119,9 +119,7 @@ static inline void nxbe_bitmap_pwfb(FAR struct nxbe_window_s *wnd,
|
|||
FAR const struct nxgl_point_s *origin,
|
||||
unsigned int stride)
|
||||
{
|
||||
struct nxgl_rect_s bounds;
|
||||
struct nxgl_point_s offset;
|
||||
struct nxgl_rect_s remaining;
|
||||
struct nxgl_rect_s destrect;
|
||||
unsigned int deststride;
|
||||
|
||||
DEBUGASSERT(wnd != NULL && dest != NULL && src != NULL && origin != NULL);
|
||||
|
@ -149,25 +147,33 @@ static inline void nxbe_bitmap_pwfb(FAR struct nxbe_window_s *wnd,
|
|||
return;
|
||||
}
|
||||
|
||||
/* Offset the rectangle and image origin by the window origin */
|
||||
/* Offset the rectangle and image origin by the window origin. This
|
||||
* converts the rectangle in the device absolute coordinates.
|
||||
*/
|
||||
|
||||
nxgl_rectoffset(&bounds, dest, wnd->bounds.pt1.x, wnd->bounds.pt1.y);
|
||||
nxgl_vectoradd(&offset, origin, &wnd->bounds.pt1);
|
||||
nxgl_rectoffset(&destrect, dest, wnd->bounds.pt1.x, wnd->bounds.pt1.y);
|
||||
|
||||
/* Clip to the limits of the window and of the background screen */
|
||||
/* Clip to the limits of the window and of the background screen (in
|
||||
* device coordinates.
|
||||
*/
|
||||
|
||||
nxgl_rectintersect(&remaining, &bounds, &wnd->bounds);
|
||||
nxgl_rectintersect(&remaining, &remaining, &wnd->be->bkgd.bounds);
|
||||
nxgl_rectintersect(&destrect, &destrect, &wnd->bounds);
|
||||
nxgl_rectintersect(&destrect, &destrect, &wnd->be->bkgd.bounds);
|
||||
|
||||
if (!nxgl_nullrect(&remaining))
|
||||
if (!nxgl_nullrect(&destrect))
|
||||
{
|
||||
/* Restore the destination rectangle to relative window coordinates. */
|
||||
|
||||
nxgl_rectoffset(&destrect, &destrect,
|
||||
-wnd->bounds.pt1.x, -wnd->bounds.pt1.y);
|
||||
|
||||
/* Copy the rectangular region to the framebuffer (no clipping).
|
||||
* REVISIT: Assumes a single color plane.
|
||||
*/
|
||||
|
||||
DEBUGASSERT(wnd->be->plane[0].pwfb.copyrectangle != NULL);
|
||||
wnd->be->plane[0].pwfb.copyrectangle(wnd, &remaining, src[0],
|
||||
&offset, stride);
|
||||
wnd->be->plane[0].pwfb.copyrectangle(wnd, &destrect, src[0],
|
||||
origin, stride);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -74,13 +74,7 @@ void nxbe_closewindow(FAR struct nxbe_window_s *wnd)
|
|||
{
|
||||
FAR struct nxbe_state_s *be;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (wnd == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
DEBUGASSERT(wnd != NULL);
|
||||
be = wnd->be;
|
||||
|
||||
/* The background window should never be closed */
|
||||
|
|
|
@ -99,7 +99,7 @@ int nxbe_configure(FAR NX_DRIVERTYPE *dev, FAR struct nxbe_state_s *be)
|
|||
|
||||
/* Check the number of color planes */
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_GRAPHICS
|
||||
if (be->vinfo.nplanes > CONFIG_NX_NPLANES)
|
||||
{
|
||||
gerr("ERROR: NX configured for only %d planes, controller wants %d\n",
|
||||
|
|
|
@ -150,12 +150,21 @@ static inline void nxbe_fill_pwfb(FAR struct nxbe_window_s *wnd,
|
|||
FAR const struct nxgl_rect_s *rect,
|
||||
nxgl_mxpixel_t color[CONFIG_NX_NPLANES])
|
||||
{
|
||||
struct nxgl_rect_s relrect;
|
||||
|
||||
DEBUGASSERT(wnd->be->plane[0].pwfb.fillrectangle != NULL);
|
||||
|
||||
/* The rectangle that we receive here is in abolute device coordinates. We
|
||||
* need to restore this to windows relative coordinates.
|
||||
*/
|
||||
|
||||
nxgl_rectoffset(&relrect, rect, -wnd->bounds.pt1.x, -wnd->bounds.pt1.y);
|
||||
|
||||
/* Copy the rectangular region to the framebuffer (no clipping).
|
||||
* REVISIT: Assumes a single color plane.
|
||||
*/
|
||||
|
||||
DEBUGASSERT(wnd->be->plane[0].pwfb.fillrectangle != NULL);
|
||||
wnd->be->plane[0].pwfb.fillrectangle(wnd, rect, color[0]);
|
||||
wnd->be->plane[0].pwfb.fillrectangle(wnd, &relrect, color[0]);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -179,7 +179,8 @@ static inline void nxbe_filltrapezoid_pwfb(FAR struct nxbe_window_s *wnd,
|
|||
FAR const struct nxgl_trapezoid_s *trap,
|
||||
nxgl_mxpixel_t color[CONFIG_NX_NPLANES])
|
||||
{
|
||||
struct nxgl_rect_s newbounds;
|
||||
struct nxgl_trapezoid_s reltrap;
|
||||
struct nxgl_rect_s relbounds;
|
||||
FAR const void *src[CONFIG_NX_NPLANES] =
|
||||
{
|
||||
(FAR const void *)wnd->fbmem
|
||||
|
@ -189,27 +190,28 @@ static inline void nxbe_filltrapezoid_pwfb(FAR struct nxbe_window_s *wnd,
|
|||
0, 0
|
||||
};
|
||||
|
||||
/* Both the rectangle that we receive here are in abolute device
|
||||
* coordinates. We need to restore both to windows relative coordinates.
|
||||
*/
|
||||
|
||||
nxgl_trapoffset(&reltrap, trap,
|
||||
-wnd->bounds.pt1.x, -wnd->bounds.pt1.y);
|
||||
nxgl_rectoffset(&relbounds, bounds,
|
||||
-wnd->bounds.pt1.x, -wnd->bounds.pt1.y);
|
||||
|
||||
/* Copy the trapezoidal region to the framebuffer (no clipping).
|
||||
* REVISIT: Assumes a single color plane.
|
||||
*/
|
||||
|
||||
DEBUGASSERT(wnd->be->plane[0].pwfb.filltrapezoid != NULL);
|
||||
wnd->be->plane[0].pwfb.filltrapezoid(wnd, trap, bounds, color[0]);
|
||||
wnd->be->plane[0].pwfb.filltrapezoid(wnd, &reltrap, &relbounds,
|
||||
color[0]);
|
||||
|
||||
/* Copy the porition of the per-window framebuffer to the device graphics
|
||||
* memory.
|
||||
/* Copy the portion of the per-window framebuffer in the bounding box
|
||||
* to the device graphics memory.
|
||||
*/
|
||||
|
||||
/* Restore the rectangle origin to (0,0) as required by nxbe_bitmap_dev().
|
||||
* nxbe_bitmap_dev() will offset the bounds yet again.
|
||||
*/
|
||||
|
||||
nxgl_rectoffset(&newbounds, bounds,
|
||||
-wnd->bounds.pt1.x, -wnd->bounds.pt1.y);
|
||||
|
||||
/* Then perform the bitmap copy from the pre-window framebuffer */
|
||||
|
||||
nxbe_bitmap_dev(wnd, &newbounds, src, &origin, wnd->stride);
|
||||
nxbe_bitmap_dev(wnd, &relbounds, src, &origin, wnd->stride);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -240,22 +242,22 @@ void nxbe_filltrapezoid(FAR struct nxbe_window_s *wnd,
|
|||
nxgl_mxpixel_t color[CONFIG_NX_NPLANES])
|
||||
{
|
||||
struct nxgl_rect_s remaining;
|
||||
struct nxgl_trapezoid_s offset_trap;
|
||||
struct nxgl_trapezoid_s devtrap;
|
||||
|
||||
DEBUGASSERT(wnd != NULL && trap != NULL);
|
||||
|
||||
/* Offset the trapezoid by the window origin to position it within
|
||||
* the framebuffer region
|
||||
* the device graphics coordinate system.
|
||||
*/
|
||||
|
||||
nxgl_trapoffset(&offset_trap, trap, wnd->bounds.pt1.x, wnd->bounds.pt1.y);
|
||||
nxgl_trapoffset(&devtrap, trap, wnd->bounds.pt1.x, wnd->bounds.pt1.y);
|
||||
|
||||
/* Create a bounding box that contains the trapezoid */
|
||||
|
||||
remaining.pt1.x = b16toi(ngl_min(offset_trap.top.x1, offset_trap.bot.x1));
|
||||
remaining.pt1.y = offset_trap.top.y;
|
||||
remaining.pt2.x = b16toi(ngl_max(offset_trap.top.x2, offset_trap.bot.x2));
|
||||
remaining.pt2.y = offset_trap.bot.y;
|
||||
remaining.pt1.x = b16toi(ngl_min(devtrap.top.x1, devtrap.bot.x1));
|
||||
remaining.pt1.y = devtrap.top.y;
|
||||
remaining.pt2.x = b16toi(ngl_max(devtrap.top.x2, devtrap.bot.x2));
|
||||
remaining.pt2.y = devtrap.bot.y;
|
||||
|
||||
/* Clip to any user specified clipping window */
|
||||
|
||||
|
@ -278,14 +280,14 @@ void nxbe_filltrapezoid(FAR struct nxbe_window_s *wnd,
|
|||
|
||||
if (NXBE_ISRAMBACKED(wnd))
|
||||
{
|
||||
nxbe_filltrapezoid_pwfb(wnd, &remaining, &offset_trap, color);
|
||||
nxbe_filltrapezoid_pwfb(wnd, &remaining, &devtrap, color);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/* Update only the graphics device memory. */
|
||||
|
||||
nxbe_filltrapezoid_dev(wnd, &remaining, &offset_trap, color);
|
||||
nxbe_filltrapezoid_dev(wnd, &remaining, &devtrap, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -122,10 +122,19 @@ static inline void nxbe_getrectangle_pwfb(FAR struct nxbe_window_s *wnd,
|
|||
unsigned int deststride)
|
||||
{
|
||||
FAR struct nxbe_plane_s *pplane = &wnd->be->plane[plane];
|
||||
struct nxgl_rect_s relrect;
|
||||
|
||||
DEBUGASSERT(pplane != NULL && pplane->pwfb.getrectangle != NULL);
|
||||
|
||||
pplane->pwfb.getrectangle(wnd, rect, dest, deststride);
|
||||
/* The rectangle that we receive here is in abolute device coordinates. We
|
||||
* need to restore this to windows relative coordinates.
|
||||
*/
|
||||
|
||||
nxgl_rectoffset(&relrect, rect, -wnd->bounds.pt1.x, -wnd->bounds.pt1.y);
|
||||
|
||||
/* Then get the rectangle from the framebuffer */
|
||||
|
||||
pplane->pwfb.getrectangle(wnd, &relrect, dest, deststride);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -295,20 +295,25 @@ static inline void nxbe_move_pwfb(FAR struct nxbe_window_s *wnd,
|
|||
FAR const struct nxgl_point_s *offset)
|
||||
{
|
||||
struct nxgl_point_s destpos;
|
||||
struct nxgl_rect_s bounds;
|
||||
FAR const void *src[CONFIG_NX_NPLANES] =
|
||||
{
|
||||
(FAR const void *)wnd->fbmem
|
||||
};
|
||||
struct nxgl_rect_s srcrect;
|
||||
struct nxgl_rect_s destrect;
|
||||
FAR const void *src[CONFIG_NX_NPLANES];
|
||||
FAR const struct nxgl_point_s origin =
|
||||
{
|
||||
0, 0
|
||||
};
|
||||
unsigned int bpp;
|
||||
|
||||
/* The rectangle that we receive here is in abolute device coordinates. We
|
||||
* need to restore this to windows relative coordinates.
|
||||
*/
|
||||
|
||||
nxgl_rectoffset(&srcrect, rect, -wnd->bounds.pt1.x, -wnd->bounds.pt1.y);
|
||||
|
||||
/* Offset is the destination position of the moved rectangle */
|
||||
|
||||
destpos.x = rect->pt1.x + offset->x;
|
||||
destpos.y = rect->pt1.y + offset->y;
|
||||
destpos.x = srcrect.pt1.x + offset->x;
|
||||
destpos.y = srcrect.pt1.y + offset->y;
|
||||
|
||||
/* Move the source rectangle to the destination position in the
|
||||
* frambebuffer.
|
||||
|
@ -316,22 +321,35 @@ static inline void nxbe_move_pwfb(FAR struct nxbe_window_s *wnd,
|
|||
*/
|
||||
|
||||
DEBUGASSERT(wnd->be->plane[0].pwfb.moverectangle != NULL);
|
||||
wnd->be->plane[0].pwfb.moverectangle(wnd, rect, &destpos);
|
||||
wnd->be->plane[0].pwfb.moverectangle(wnd, &srcrect, &destpos);
|
||||
|
||||
/* Construct the destination bounding box in relative window
|
||||
* coordinates. This derives from the source bounding box with
|
||||
* an offset distination and an offset to restore the relative
|
||||
* window position.
|
||||
* an offset distination.
|
||||
*/
|
||||
|
||||
nxgl_rectoffset(&bounds, rect, offset->x - wnd->bounds.pt1.x,
|
||||
offset->y - wnd->bounds.pt1.y);
|
||||
nxgl_rectoffset(&destrect, &srcrect, offset->x, offset->y);
|
||||
|
||||
/* Update the physical device by just copying the destination rectangle
|
||||
* to the device graphics memory.
|
||||
/* Update the physical device by just copying the rectangle from the
|
||||
* framebuffer to the device graphics memory.
|
||||
*
|
||||
* Get the source of address of the moved rectangle in the framebuffer.
|
||||
* REVISIT: For resolutions less than 8-bits, the starting pixel will
|
||||
* be contained in the byte pointed to by src[0]but may not be properly
|
||||
* aligned for the transfer.
|
||||
*/
|
||||
|
||||
nxbe_bitmap_dev(wnd, &bounds, src, &origin, wnd->stride);
|
||||
bpp = wnd->be->plane[0].pinfo.bpp;
|
||||
src[0] = (FAR void *)
|
||||
((FAR uint8_t *)wnd->fbmem +
|
||||
destrect.pt1.y * wnd->stride +
|
||||
((bpp * destrect.pt1.x) >> 3));
|
||||
|
||||
/* Then transfer the rectangle to the destination rectangle in the
|
||||
* device memory.
|
||||
*/
|
||||
|
||||
nxbe_bitmap_dev(wnd, &destrect, src, &origin, wnd->stride);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -39,6 +39,8 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <nuttx/nx/nxglib.h>
|
||||
#include <nuttx/nx/nx.h>
|
||||
|
||||
|
@ -112,12 +114,7 @@ void nxbe_setpixel(FAR struct nxbe_window_s *wnd,
|
|||
struct nxgl_rect_s rect;
|
||||
int i;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!wnd || !pos)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
DEBUGASSERT(wnd != NULL && pos != NULL);
|
||||
|
||||
/* Offset the position by the window origin */
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* graphics/nxbe/nxbe_setposition.c
|
||||
*
|
||||
* Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2008-2009, 2011, 2019 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -39,6 +39,8 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <nuttx/nx/nxglib.h>
|
||||
|
||||
#include "nxbe.h"
|
||||
|
@ -63,12 +65,7 @@ void nxbe_setposition(FAR struct nxbe_window_s *wnd,
|
|||
struct nxgl_rect_s before;
|
||||
struct nxgl_rect_s rect;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!wnd)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
DEBUGASSERT(wnd != NULL && pos != NULL);
|
||||
|
||||
/* Back out the old window origin position from the bounding box */
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ static void nxbe_realloc(FAR struct nxbe_window_s *wnd,
|
|||
FAR uint8_t *src;
|
||||
FAR uint8_t *dest;
|
||||
nxgl_coord_t minheight;
|
||||
nxgl_coord_t newidth;
|
||||
nxgl_coord_t newwidth;
|
||||
nxgl_coord_t newheight;
|
||||
nxgl_coord_t oldheight;
|
||||
nxgl_coord_t row;
|
||||
|
@ -114,10 +114,10 @@ static void nxbe_realloc(FAR struct nxbe_window_s *wnd,
|
|||
{
|
||||
oldheight = oldbounds->pt2.y - oldbounds->pt1.y + 1;
|
||||
|
||||
newidth = wnd->bounds.pt2.x - wnd->bounds.pt1.x + 1;
|
||||
newwidth = wnd->bounds.pt2.x - wnd->bounds.pt1.x + 1;
|
||||
newheight = wnd->bounds.pt2.y - wnd->bounds.pt1.y + 1;
|
||||
bpp = wnd->be->plane[0].pinfo.bpp;
|
||||
newstride = (bpp * newidth + 7) >> 3;
|
||||
newstride = (bpp * newwidth + 7) >> 3;
|
||||
newfbsize = newstride * newheight;
|
||||
|
||||
#ifdef CONFIG_BUILD_KERNEL
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* graphics/nxmu/nxmu_releasebkgd.c
|
||||
*
|
||||
* Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2008-2009, 2011, 2019 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -39,6 +39,7 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
@ -66,19 +67,13 @@
|
|||
|
||||
void nxmu_releasebkgd(FAR struct nxmu_state_s *fe)
|
||||
{
|
||||
FAR struct nxbe_state_s *be = &fe->be;
|
||||
FAR struct nxbe_state_s *be;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!fe)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
DEBUGASSERT(fe != NULL);
|
||||
|
||||
/* Destroy the client window callbacks* and restore the server
|
||||
* connection.
|
||||
*/
|
||||
/* Destroy the client window callbacks and restore the server connection. */
|
||||
|
||||
be = &fe->be;
|
||||
be->bkgd.cb = NULL;
|
||||
be->bkgd.arg = NULL;
|
||||
be->bkgd.conn = &fe->conn;
|
||||
|
@ -87,4 +82,3 @@ void nxmu_releasebkgd(FAR struct nxmu_state_s *fe)
|
|||
|
||||
nxmu_redrawreq(&be->bkgd, &be->bkgd.bounds);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* graphics/nxmu/nxmu_sendclient.c
|
||||
*
|
||||
* Copyright (C) 2012, 2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012, 2017, 2019 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -40,6 +40,7 @@
|
|||
#include <nuttx/config.h>
|
||||
|
||||
#include <mqueue.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
@ -72,15 +73,7 @@ int nxmu_sendclient(FAR struct nxmu_conn_s *conn, FAR const void *msg,
|
|||
{
|
||||
int ret;
|
||||
|
||||
/* Sanity checking */
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!conn || !conn->swrmq)
|
||||
{
|
||||
set_errno(EINVAL);
|
||||
return ERROR;
|
||||
}
|
||||
#endif
|
||||
DEBUGASSERT(conn != NULL && conn->swrmq != NULL && msg != NULL);
|
||||
|
||||
/* Send the message to the client */
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* graphics/nxmu/nxmu_sendclientwindow.c
|
||||
*
|
||||
* Copyright (C) 2012-2013 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012-2013, 2019 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -40,6 +40,7 @@
|
|||
#include <nuttx/config.h>
|
||||
|
||||
#include <mqueue.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
@ -66,19 +67,11 @@
|
|||
****************************************************************************/
|
||||
|
||||
int nxmu_sendclientwindow(FAR struct nxbe_window_s *wnd, FAR const void *msg,
|
||||
size_t msglen)
|
||||
size_t msglen)
|
||||
{
|
||||
int ret = OK;
|
||||
int ret = OK;
|
||||
|
||||
/* Sanity checking */
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!wnd || !wnd->conn)
|
||||
{
|
||||
set_errno(EINVAL);
|
||||
return ERROR;
|
||||
}
|
||||
#endif
|
||||
DEBUGASSERT(wnd != NULL && wnd->conn != NULL && msg != NULL);
|
||||
|
||||
/* Ignore messages destined to a blocked window (no errors reported) */
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* graphics/nxmu/nxmu_server.c
|
||||
*
|
||||
* Copyright (C) 2008-2012, 2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2008-2012, 2017, 2019 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -74,7 +74,7 @@ static inline void nxmu_disconnect(FAR struct nxmu_conn_s *conn)
|
|||
ret = nxmu_sendclient(conn, &outmsg, sizeof(struct nxclimsg_disconnected_s));
|
||||
if (ret < 0)
|
||||
{
|
||||
gerr("ERROR: nxmu_sendclient failed: %d\n", errno);
|
||||
gerr("ERROR: nxmu_sendclient failed: %d\n", ret);
|
||||
}
|
||||
|
||||
/* Close the outgoing client message queue */
|
||||
|
@ -111,7 +111,7 @@ static inline void nxmu_connect(FAR struct nxmu_conn_s *conn)
|
|||
ret = nxmu_sendclient(conn, &outmsg, sizeof(struct nxclimsg_connected_s));
|
||||
if (ret < 0)
|
||||
{
|
||||
gerr("ERROR: nxmu_sendclient failed: %d\n", errno);
|
||||
gerr("ERROR: nxmu_sendclient failed: %d\n", ret);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -150,10 +150,11 @@ static inline void nxmu_blocked(FAR struct nxbe_window_s *wnd, FAR void *arg)
|
|||
outmsg.wnd = wnd;
|
||||
outmsg.arg = arg;
|
||||
|
||||
ret = nxmu_sendclient(wnd->conn, &outmsg, sizeof(struct nxclimsg_blocked_s));
|
||||
ret = nxmu_sendclient(wnd->conn, &outmsg,
|
||||
sizeof(struct nxclimsg_blocked_s));
|
||||
if (ret < 0)
|
||||
{
|
||||
gerr("ERROR: nxmu_sendclient failed: %d\n", errno);
|
||||
gerr("ERROR: nxmu_sendclient failed: %d\n", ret);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -174,18 +175,16 @@ static inline int nxmu_setup(FAR const char *mqname, FAR NX_DRIVERTYPE *dev,
|
|||
ret = nxbe_configure(dev, &fe->be);
|
||||
if (ret < 0)
|
||||
{
|
||||
gerr("ERROR: nxbe_configure failed: %d\n", -ret);
|
||||
set_errno(-ret);
|
||||
return ERROR;
|
||||
gerr("ERROR: nxbe_configure failed: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
ret = nxbe_colormap(dev);
|
||||
if (ret < 0)
|
||||
{
|
||||
gerr("ERROR: nxbe_colormap failed: %d\n", -ret);
|
||||
set_errno(-ret);
|
||||
return ERROR;
|
||||
gerr("ERROR: nxbe_colormap failed: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_FB_CMAP */
|
||||
|
||||
|
@ -204,8 +203,9 @@ static inline int nxmu_setup(FAR const char *mqname, FAR NX_DRIVERTYPE *dev,
|
|||
fe->conn.crdmq = mq_open(mqname, O_RDONLY | O_CREAT, 0666, &attr);
|
||||
if (fe->conn.crdmq == (mqd_t)-1)
|
||||
{
|
||||
gerr("ERROR: mq_open(%s) failed: %d\n", mqname, errno);
|
||||
return ERROR; /* mq_open sets errno */
|
||||
int errcode = get_errno();
|
||||
gerr("ERROR: mq_open(%s) failed: %d\n", mqname, errcode);
|
||||
return -errcode;
|
||||
}
|
||||
|
||||
/* NOTE that the outgoing client MQ (cwrmq) is not initialized. The
|
||||
|
@ -220,9 +220,10 @@ static inline int nxmu_setup(FAR const char *mqname, FAR NX_DRIVERTYPE *dev,
|
|||
fe->conn.swrmq = mq_open(mqname, O_WRONLY);
|
||||
if (fe->conn.swrmq == (mqd_t)-1)
|
||||
{
|
||||
gerr("ERROR: mq_open(%s) failed: %d\n", mqname, errno);
|
||||
int errcode = get_errno();
|
||||
gerr("ERROR: mq_open(%s) failed: %d\n", mqname, errcode);
|
||||
mq_close(fe->conn.crdmq);
|
||||
return ERROR; /* mq_open sets errno */
|
||||
return -errcode;
|
||||
}
|
||||
|
||||
/* The server is now "connected" to itself via the background window */
|
||||
|
@ -272,7 +273,7 @@ static inline int nxmu_setup(FAR const char *mqname, FAR NX_DRIVERTYPE *dev,
|
|||
*
|
||||
* Returned Value:
|
||||
* This function usually does not return. If it does return, it will
|
||||
* return ERROR and errno will be set appropriately.
|
||||
* return a negated errno value indicating the cause of the failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
@ -293,7 +294,7 @@ int nx_runinstance(FAR const char *mqname, FAR NX_DRIVERTYPE *dev)
|
|||
ret = nxmu_setup(mqname, dev, &fe);
|
||||
if (ret < 0)
|
||||
{
|
||||
return ret; /* nxmu_setup sets errno */
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Produce the initial, background display */
|
||||
|
@ -536,6 +537,5 @@ int nx_runinstance(FAR const char *mqname, FAR NX_DRIVERTYPE *dev)
|
|||
|
||||
errout:
|
||||
nxmu_shutdown(&fe);
|
||||
set_errno(-ret);
|
||||
return ERROR;
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ ifeq ($(CONFIG_NXTERM_NXKBDIN),y)
|
|||
CSRCS += nxterm_kbdin.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_FEATURES),y)
|
||||
ifeq ($(CONFIG_DEBUG_GRAPHICS),y)
|
||||
CSRCS += nxterm_sem.c
|
||||
endif
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@ struct nxterm_state_s
|
|||
FAR void *handle; /* The window handle */
|
||||
FAR struct nxterm_window_s wndo; /* Describes the window and font */
|
||||
sem_t exclsem; /* Forces mutually exclusive access */
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_GRAPHICS
|
||||
pid_t holder; /* Deadlock avoidance */
|
||||
#endif
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
|
@ -193,7 +193,7 @@ extern const struct file_operations g_nxterm_drvrops;
|
|||
|
||||
/* Semaphore helpers */
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_GRAPHICS
|
||||
int nxterm_semwait(FAR struct nxterm_state_s *priv);
|
||||
int nxterm_sempost(FAR struct nxterm_state_s *priv);
|
||||
#else
|
||||
|
|
|
@ -335,7 +335,7 @@ int nxterm_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup)
|
|||
|
||||
struct pollfd **slot = (struct pollfd **)fds->priv;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_GRAPHICS
|
||||
if (!slot)
|
||||
{
|
||||
gerr("ERROR: No slot\n");
|
||||
|
|
|
@ -90,7 +90,7 @@ FAR struct nxterm_state_s *
|
|||
memcpy(&priv->wndo, wndo, sizeof(struct nxterm_window_s));
|
||||
|
||||
nxsem_init(&priv->exclsem, 0, 1);
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_GRAPHICS
|
||||
priv->holder = NO_HOLDER;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
#include "nxterm.h"
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
#ifdef CONFIG_DEBUG_GRAPHICS
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
|
@ -110,4 +110,4 @@ int nxterm_sempost(FAR struct nxterm_state_s *priv)
|
|||
return nxsem_post(&priv->exclsem);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_DEBUG_FEATURES */
|
||||
#endif /* CONFIG_DEBUG_GRAPHICS */
|
||||
|
|
|
@ -45,15 +45,19 @@
|
|||
#include <errno.h>
|
||||
|
||||
#if defined(CONFIG_VNCSERVER_DEBUG) && !defined(CONFIG_DEBUG_GRAPHICS)
|
||||
# undef CONFIG_DEBUG_FEATURES
|
||||
# undef CONFIG_DEBUG_ERROR
|
||||
# undef CONFIG_DEBUG_WARN
|
||||
# undef CONFIG_DEBUG_INFO
|
||||
# define CONFIG_DEBUG_FEATURES 1
|
||||
# define CONFIG_DEBUG_ERROR 1
|
||||
# define CONFIG_DEBUG_WARN 1
|
||||
# define CONFIG_DEBUG_INFO 1
|
||||
# define CONFIG_DEBUG_GRAPHICS 1
|
||||
# undef CONFIG_DEBUG_GRAPHICS_ERROR
|
||||
# undef CONFIG_DEBUG_GRAPHICS_WARN
|
||||
# undef CONFIG_DEBUG_GRAPHICS_INFO
|
||||
# define CONFIG_DEBUG_ERROR 1
|
||||
# define CONFIG_DEBUG_WARN 1
|
||||
# define CONFIG_DEBUG_INFO 1
|
||||
# define CONFIG_DEBUG_GRAPHICS 1
|
||||
# define CONFIG_DEBUG_GRAPHICS_ERROR 1
|
||||
# define CONFIG_DEBUG_GRAPHICS_WARN 1
|
||||
# define CONFIG_DEBUG_GRAPHICS_INFO 1
|
||||
#endif
|
||||
#include <debug.h>
|
||||
|
||||
|
|
|
@ -45,15 +45,19 @@
|
|||
#include <assert.h>
|
||||
|
||||
#if defined(CONFIG_VNCSERVER_DEBUG) && !defined(CONFIG_DEBUG_GRAPHICS)
|
||||
# undef CONFIG_DEBUG_FEATURES
|
||||
# undef CONFIG_DEBUG_ERROR
|
||||
# undef CONFIG_DEBUG_WARN
|
||||
# undef CONFIG_DEBUG_INFO
|
||||
# define CONFIG_DEBUG_FEATURES 1
|
||||
# define CONFIG_DEBUG_ERROR 1
|
||||
# define CONFIG_DEBUG_WARN 1
|
||||
# define CONFIG_DEBUG_INFO 1
|
||||
# define CONFIG_DEBUG_GRAPHICS 1
|
||||
# undef CONFIG_DEBUG_GRAPHICS_ERROR
|
||||
# undef CONFIG_DEBUG_GRAPHICS_WARN
|
||||
# undef CONFIG_DEBUG_GRAPHICS_INFO
|
||||
# define CONFIG_DEBUG_ERROR 1
|
||||
# define CONFIG_DEBUG_WARN 1
|
||||
# define CONFIG_DEBUG_INFO 1
|
||||
# define CONFIG_DEBUG_GRAPHICS 1
|
||||
# define CONFIG_DEBUG_GRAPHICS_ERROR 1
|
||||
# define CONFIG_DEBUG_GRAPHICS_WARN 1
|
||||
# define CONFIG_DEBUG_GRAPHICS_INFO 1
|
||||
#endif
|
||||
#include <debug.h>
|
||||
|
||||
|
|
|
@ -44,15 +44,19 @@
|
|||
#include <errno.h>
|
||||
|
||||
#if defined(CONFIG_VNCSERVER_DEBUG) && !defined(CONFIG_DEBUG_GRAPHICS)
|
||||
# undef CONFIG_DEBUG_FEATURES
|
||||
# undef CONFIG_DEBUG_ERROR
|
||||
# undef CONFIG_DEBUG_WARN
|
||||
# undef CONFIG_DEBUG_INFO
|
||||
# define CONFIG_DEBUG_FEATURES 1
|
||||
# define CONFIG_DEBUG_ERROR 1
|
||||
# define CONFIG_DEBUG_WARN 1
|
||||
# define CONFIG_DEBUG_INFO 1
|
||||
# define CONFIG_DEBUG_GRAPHICS 1
|
||||
# undef CONFIG_DEBUG_GRAPHICS_ERROR
|
||||
# undef CONFIG_DEBUG_GRAPHICS_WARN
|
||||
# undef CONFIG_DEBUG_GRAPHICS_INFO
|
||||
# define CONFIG_DEBUG_ERROR 1
|
||||
# define CONFIG_DEBUG_WARN 1
|
||||
# define CONFIG_DEBUG_INFO 1
|
||||
# define CONFIG_DEBUG_GRAPHICS 1
|
||||
# define CONFIG_DEBUG_GRAPHICS_ERROR 1
|
||||
# define CONFIG_DEBUG_GRAPHICS_WARN 1
|
||||
# define CONFIG_DEBUG_GRAPHICS_INFO 1
|
||||
#endif
|
||||
#include <debug.h>
|
||||
|
||||
|
|
|
@ -43,15 +43,19 @@
|
|||
#include <errno.h>
|
||||
|
||||
#if defined(CONFIG_VNCSERVER_DEBUG) && !defined(CONFIG_DEBUG_GRAPHICS)
|
||||
# undef CONFIG_DEBUG_FEATURES
|
||||
# undef CONFIG_DEBUG_ERROR
|
||||
# undef CONFIG_DEBUG_WARN
|
||||
# undef CONFIG_DEBUG_INFO
|
||||
# define CONFIG_DEBUG_FEATURES 1
|
||||
# define CONFIG_DEBUG_ERROR 1
|
||||
# define CONFIG_DEBUG_WARN 1
|
||||
# define CONFIG_DEBUG_INFO 1
|
||||
# define CONFIG_DEBUG_GRAPHICS 1
|
||||
# undef CONFIG_DEBUG_GRAPHICS_ERROR
|
||||
# undef CONFIG_DEBUG_GRAPHICS_WARN
|
||||
# undef CONFIG_DEBUG_GRAPHICS_INFO
|
||||
# define CONFIG_DEBUG_ERROR 1
|
||||
# define CONFIG_DEBUG_WARN 1
|
||||
# define CONFIG_DEBUG_INFO 1
|
||||
# define CONFIG_DEBUG_GRAPHICS 1
|
||||
# define CONFIG_DEBUG_GRAPHICS_ERROR 1
|
||||
# define CONFIG_DEBUG_GRAPHICS_WARN 1
|
||||
# define CONFIG_DEBUG_GRAPHICS_INFO 1
|
||||
#endif
|
||||
#include <debug.h>
|
||||
|
||||
|
|
|
@ -44,15 +44,19 @@
|
|||
#include <errno.h>
|
||||
|
||||
#if defined(CONFIG_VNCSERVER_DEBUG) && !defined(CONFIG_DEBUG_GRAPHICS)
|
||||
# undef CONFIG_DEBUG_FEATURES
|
||||
# undef CONFIG_DEBUG_ERROR
|
||||
# undef CONFIG_DEBUG_WARN
|
||||
# undef CONFIG_DEBUG_INFO
|
||||
# define CONFIG_DEBUG_FEATURES 1
|
||||
# define CONFIG_DEBUG_ERROR 1
|
||||
# define CONFIG_DEBUG_WARN 1
|
||||
# define CONFIG_DEBUG_INFO 1
|
||||
# define CONFIG_DEBUG_GRAPHICS 1
|
||||
# undef CONFIG_DEBUG_GRAPHICS_ERROR
|
||||
# undef CONFIG_DEBUG_GRAPHICS_WARN
|
||||
# undef CONFIG_DEBUG_GRAPHICS_INFO
|
||||
# define CONFIG_DEBUG_ERROR 1
|
||||
# define CONFIG_DEBUG_WARN 1
|
||||
# define CONFIG_DEBUG_INFO 1
|
||||
# define CONFIG_DEBUG_GRAPHICS 1
|
||||
# define CONFIG_DEBUG_GRAPHICS_ERROR 1
|
||||
# define CONFIG_DEBUG_GRAPHICS_WARN 1
|
||||
# define CONFIG_DEBUG_GRAPHICS_INFO 1
|
||||
#endif
|
||||
#include <debug.h>
|
||||
|
||||
|
|
|
@ -48,15 +48,19 @@
|
|||
#include <errno.h>
|
||||
|
||||
#if defined(CONFIG_VNCSERVER_DEBUG) && !defined(CONFIG_DEBUG_GRAPHICS)
|
||||
# undef CONFIG_DEBUG_FEATURES
|
||||
# undef CONFIG_DEBUG_ERROR
|
||||
# undef CONFIG_DEBUG_WARN
|
||||
# undef CONFIG_DEBUG_INFO
|
||||
# define CONFIG_DEBUG_FEATURES 1
|
||||
# define CONFIG_DEBUG_ERROR 1
|
||||
# define CONFIG_DEBUG_WARN 1
|
||||
# define CONFIG_DEBUG_INFO 1
|
||||
# define CONFIG_DEBUG_GRAPHICS 1
|
||||
# undef CONFIG_DEBUG_GRAPHICS_ERROR
|
||||
# undef CONFIG_DEBUG_GRAPHICS_WARN
|
||||
# undef CONFIG_DEBUG_GRAPHICS_INFO
|
||||
# define CONFIG_DEBUG_ERROR 1
|
||||
# define CONFIG_DEBUG_WARN 1
|
||||
# define CONFIG_DEBUG_INFO 1
|
||||
# define CONFIG_DEBUG_GRAPHICS 1
|
||||
# define CONFIG_DEBUG_GRAPHICS_ERROR 1
|
||||
# define CONFIG_DEBUG_GRAPHICS_WARN 1
|
||||
# define CONFIG_DEBUG_GRAPHICS_INFO 1
|
||||
#endif
|
||||
#include <debug.h>
|
||||
|
||||
|
|
|
@ -48,15 +48,19 @@
|
|||
#include <errno.h>
|
||||
|
||||
#if defined(CONFIG_VNCSERVER_DEBUG) && !defined(CONFIG_DEBUG_GRAPHICS)
|
||||
# undef CONFIG_DEBUG_FEATURES
|
||||
# undef CONFIG_DEBUG_ERROR
|
||||
# undef CONFIG_DEBUG_WARN
|
||||
# undef CONFIG_DEBUG_INFO
|
||||
# define CONFIG_DEBUG_FEATURES 1
|
||||
# define CONFIG_DEBUG_ERROR 1
|
||||
# define CONFIG_DEBUG_WARN 1
|
||||
# define CONFIG_DEBUG_INFO 1
|
||||
# define CONFIG_DEBUG_GRAPHICS 1
|
||||
# undef CONFIG_DEBUG_GRAPHICS_ERROR
|
||||
# undef CONFIG_DEBUG_GRAPHICS_WARN
|
||||
# undef CONFIG_DEBUG_GRAPHICS_INFO
|
||||
# define CONFIG_DEBUG_ERROR 1
|
||||
# define CONFIG_DEBUG_WARN 1
|
||||
# define CONFIG_DEBUG_INFO 1
|
||||
# define CONFIG_DEBUG_GRAPHICS 1
|
||||
# define CONFIG_DEBUG_GRAPHICS_ERROR 1
|
||||
# define CONFIG_DEBUG_GRAPHICS_WARN 1
|
||||
# define CONFIG_DEBUG_GRAPHICS_INFO 1
|
||||
#endif
|
||||
#include <debug.h>
|
||||
|
||||
|
|
|
@ -41,26 +41,6 @@
|
|||
|
||||
#include <nuttx/nx/nxglib.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -90,3 +70,4 @@ bool nxgl_colorcmp(const nxgl_mxpixel_t color1[CONFIG_NX_NPLANES],
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,26 +41,6 @@
|
|||
|
||||
#include <nuttx/nx/nxglib.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -85,3 +65,4 @@ void nxgl_colorcopy(nxgl_mxpixel_t dest[CONFIG_NX_NPLANES],
|
|||
dest[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -43,26 +43,6 @@
|
|||
|
||||
#include <nuttx/nx/nxglib.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -81,3 +61,4 @@ bool nxgl_intersecting(FAR const struct nxgl_rect_s *rect1,
|
|||
return ((rect1->pt2.x > rect2->pt1.x) && (rect1->pt2.y > rect2->pt1.y) &&
|
||||
(rect1->pt1.x < rect2->pt2.x) && (rect1->pt1.y < rect2->pt1.y));
|
||||
}
|
||||
|
||||
|
|
|
@ -41,26 +41,6 @@
|
|||
|
||||
#include <nuttx/nx/nxglib.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -147,3 +127,4 @@ void nxgl_nonintersecting(FAR struct nxgl_rect_s result[4],
|
|||
result[NX_RIGHT_NDX].pt2.x = rect1->pt2.x;
|
||||
result[NX_RIGHT_NDX].pt2.y = intersection.pt2.y;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,26 +43,6 @@
|
|||
|
||||
#include <nuttx/nx/nxglib.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -79,3 +59,4 @@ bool nxgl_nullrect(FAR const struct nxgl_rect_s *rect)
|
|||
{
|
||||
return (rect->pt1.x > rect->pt2.x || rect->pt1.y > rect->pt2.y);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,26 +41,6 @@
|
|||
|
||||
#include <nuttx/nx/nxglib.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -82,3 +62,4 @@ void nxgl_rectadd(FAR struct nxgl_rect_s *dest,
|
|||
dest->pt2.x = ngl_max(src1->pt2.x, src2->pt2.x);
|
||||
dest->pt2.y = ngl_max(src1->pt2.y, src2->pt2.y);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,26 +41,6 @@
|
|||
|
||||
#include <nuttx/nx/nxglib.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -82,3 +62,4 @@ void nxgl_rectcopy(FAR struct nxgl_rect_s *dest,
|
|||
dest->pt2.x = src->pt2.x;
|
||||
dest->pt2.y = src->pt2.y;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,26 +43,6 @@
|
|||
|
||||
#include <nuttx/nx/nxglib.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -81,3 +61,4 @@ bool nxgl_rectinside(FAR const struct nxgl_rect_s *rect,
|
|||
return (pt->x >= rect->pt1.x && pt->x <= rect->pt2.x &&
|
||||
pt->y >= rect->pt1.y && pt->y <= rect->pt2.y);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,26 +41,6 @@
|
|||
|
||||
#include <nuttx/nx/nxglib.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -82,3 +62,4 @@ void nxgl_rectintersect(FAR struct nxgl_rect_s *dest,
|
|||
dest->pt2.x = ngl_min(src1->pt2.x, src2->pt2.x);
|
||||
dest->pt2.y = ngl_min(src1->pt2.y, src2->pt2.y);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,26 +41,6 @@
|
|||
|
||||
#include <nuttx/nx/nxglib.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -82,3 +62,4 @@ void nxgl_rectoffset(FAR struct nxgl_rect_s *dest,
|
|||
dest->pt2.x = src->pt2.x + dx;
|
||||
dest->pt2.y = src->pt2.y + dy;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,26 +43,6 @@
|
|||
|
||||
#include <nuttx/nx/nxglib.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -87,3 +67,4 @@ bool nxgl_rectoverlap(FAR struct nxgl_rect_s *rect1,
|
|||
(rect1->pt1.y <= rect2->pt2.y) && /* false: rect1 is wholly below rect2 */
|
||||
(rect2->pt1.y <= rect1->pt2.y); /* false: rect2 is wholly below rect1 */
|
||||
}
|
||||
|
||||
|
|
|
@ -41,26 +41,6 @@
|
|||
|
||||
#include <nuttx/nx/nxglib.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -79,3 +59,4 @@ void nxgl_rectsize(FAR struct nxgl_size_s *size,
|
|||
size->w = rect->pt2.x - rect->pt1.x + 1;
|
||||
size->h = rect->pt2.y - rect->pt1.y + 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,26 +41,6 @@
|
|||
|
||||
#include <nuttx/nx/nxglib.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -83,3 +63,4 @@ void nxgl_rectunion(FAR struct nxgl_rect_s *dest,
|
|||
dest->pt2.x = ngl_max(src1->pt2.x, src2->pt2.x);
|
||||
dest->pt2.y = ngl_max(src1->pt2.y, src2->pt2.y);
|
||||
}
|
||||
|
||||
|
|
|
@ -59,22 +59,6 @@
|
|||
#define b16_P5870 0x00009646 /* 0.5870 */
|
||||
#define b16_128P0 0x00800000 /* 128.0 */
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -101,3 +85,4 @@ void nxgl_rgb2yuv(uint8_t r, uint8_t g, uint8_t b,
|
|||
*u = (uint8_t)b16toi(b16_128P0 - b16muli(b16_P1687, r) - b16muli(b16_P3313, g) + b16muli(b16_P5000, b));
|
||||
*v = (uint8_t)b16toi(b16_128P0 + b16muli(b16_P5000, r) - b16muli(b16_P4187, g) - b16muli(b16_P0813, b));
|
||||
}
|
||||
|
||||
|
|
|
@ -41,26 +41,6 @@
|
|||
|
||||
#include <nuttx/nx/nxglib.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -80,3 +60,4 @@ void nxgl_runcopy(FAR struct nxgl_run_s *dest, FAR const struct nxgl_run_s *src)
|
|||
dest->x2 = src->x2;
|
||||
dest->y = src->y;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,26 +42,6 @@
|
|||
#include <fixedmath.h>
|
||||
#include <nuttx/nx/nxglib.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -83,3 +63,4 @@ void nxgl_runoffset(FAR struct nxgl_run_s *dest,
|
|||
dest->x2 = src->x2 + b16dx;
|
||||
dest->y = src->y + dy;
|
||||
}
|
||||
|
||||
|
|
|
@ -46,10 +46,6 @@
|
|||
|
||||
#include <nuttx/nx/nxglib.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
@ -60,14 +56,6 @@ struct b16point_s
|
|||
b16_t y;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
|
|
@ -41,26 +41,6 @@
|
|||
|
||||
#include <nuttx/nx/nxglib.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -80,3 +60,4 @@ void nxgl_trapcopy(FAR struct nxgl_trapezoid_s *dest,
|
|||
nxgl_runcopy(&dest->top, &src->top);
|
||||
nxgl_runcopy(&dest->bot, &src->bot);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,26 +41,6 @@
|
|||
|
||||
#include <nuttx/nx/nxglib.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -80,3 +60,4 @@ void nxgl_trapoffset(FAR struct nxgl_trapezoid_s *dest,
|
|||
nxgl_runoffset(&dest->top, &src->top, dx, dy);
|
||||
nxgl_runoffset(&dest->bot, &src->bot, dx, dy);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,26 +41,6 @@
|
|||
|
||||
#include <nuttx/nx/nxglib.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -80,3 +60,4 @@ void nxgl_vectoradd(FAR struct nxgl_point_s *dest,
|
|||
dest->x = v1->x + v2->x;
|
||||
dest->y = v1->y + v2->y;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,26 +41,6 @@
|
|||
|
||||
#include <nuttx/nx/nxglib.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -80,3 +60,4 @@ void nxgl_vectsubtract(FAR struct nxgl_point_s *dest,
|
|||
dest->x = v1->x - v2->x;
|
||||
dest->y = v1->y - v2->y;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,22 +55,6 @@
|
|||
#define b16_1P772 0x0001c5a2 /* 1.722003 */
|
||||
#define b16_128P0 0x00800000 /* 128.000000 */
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -100,3 +84,4 @@ void nxgl_yuv2rgb(uint8_t y, uint8_t u, uint8_t v,
|
|||
*g = (uint8_t)b16toi(itob16(y) - b16muli(b16_P3441, um128) - b16muli(b16_P7141, vm128));
|
||||
*b = (uint8_t)b16toi(itob16(y) + b16muli(b16_1P772, um128));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue