forked from nuttx/nuttx-update
graphics/nxbe and nxmu: This bring the software cursor to code complete. Still untested. Some flicker is expected. It has not been determined if that level of flicker is acceptable or not.
This commit is contained in:
parent
4aadcc8c28
commit
cbb09c55ec
14 changed files with 225 additions and 121 deletions
|
@ -155,9 +155,15 @@ struct nxbe_pwfb_vtable_s
|
|||
|
||||
struct nxbe_cursorops_s
|
||||
{
|
||||
CODE void (*draw)(FAR struct nxbe_state_s *be, int planeno);
|
||||
CODE void (*erase)(FAR struct nxbe_state_s *be, int planeno);
|
||||
CODE void (*backup)(FAR struct nxbe_state_s *be, int planeno);
|
||||
CODE void (*draw)(FAR struct nxbe_state_s *be,
|
||||
FAR const struct nxgl_rect_s *bounds,
|
||||
int planeno);
|
||||
CODE void (*erase)(FAR struct nxbe_state_s *be,
|
||||
FAR const struct nxgl_rect_s *bounds,
|
||||
int planeno);
|
||||
CODE void (*backup)(FAR struct nxbe_state_s *be,
|
||||
FAR const struct nxgl_rect_s *bounds,
|
||||
int planeno);
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -610,33 +616,6 @@ void nxbe_bitmap(FAR struct nxbe_window_s *wnd,
|
|||
FAR const struct nxgl_point_s *origin,
|
||||
unsigned int stride);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: nxbe_sprite_refresh
|
||||
*
|
||||
* Description:
|
||||
* Prior to calling nxbe_bitmap_dev(), update any "sprites" tht need to
|
||||
* be overlaid on the per-window frambuffer. This could include such
|
||||
* things as OSD functionality, a software cursor, selection boxes, etc.
|
||||
*
|
||||
* Input Parameters (same as for nxbe_bitmap_dev):
|
||||
* wnd - The window that will receive the bitmap image
|
||||
* dest - Describes the rectangular region on the display that was
|
||||
* modified (in device coordinates)
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NX_RAMBACKED
|
||||
#if 0 /* There are none yet */
|
||||
void nxbe_sprite_refresh(FAR struct nxbe_window_s *wnd,
|
||||
FAR const struct nxgl_rect_s *dest);
|
||||
#else
|
||||
# define nxbe_sprite_refresh(wnd, dest)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: nxbe_flush
|
||||
*
|
||||
|
@ -645,14 +624,13 @@ void nxbe_sprite_refresh(FAR struct nxbe_window_s *wnd,
|
|||
* be written to device graphics memory. That function is managed by this
|
||||
* simple function. It does the following:
|
||||
*
|
||||
* 1) It calls nxbe_sprite_refresh() to update any "sprite" graphics on top
|
||||
* of the RAM framebuffer. This could include such things as OSD
|
||||
* functionality, a software cursor, selection boxes, etc.
|
||||
* 2) Then it calls nxbe_bitmap_dev() to copy the modified per-window
|
||||
* frambuffer into device memory.
|
||||
*
|
||||
* This the "sprite" image is always on top of the device display, this
|
||||
* supports flicker-free software sprites.
|
||||
* 1) It calls nxbe_bitmap_dev() to copy the modified per-window
|
||||
* framebuffer into device graphics memory.
|
||||
* 2) If CONFIG_NX_SWCURSOR is enabled, it calls the cursor "draw"
|
||||
* renderer to update re-draw the currsor image if any portion of
|
||||
* graphics display update overwrote the cursor. Since these
|
||||
* operations are performed back-to-back, any resulting flicker
|
||||
* should be minimized.
|
||||
*
|
||||
* Input Parameters (same as for nxbe_bitmap_dev):
|
||||
* wnd - The window that will receive the bitmap image
|
||||
|
|
|
@ -321,14 +321,24 @@ void nxbe_bitmap(FAR struct nxbe_window_s *wnd,
|
|||
/* Update the per-window framebuffer */
|
||||
|
||||
nxbe_bitmap_pwfb(wnd, dest, src, origin, stride);
|
||||
|
||||
/* Overlay any update any sprites on the per-window frambuffer */
|
||||
|
||||
nxbe_sprite_refresh(wnd, dest);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Rend the bitmap directly to the graphics device in any case */
|
||||
|
||||
nxbe_bitmap_dev(wnd, dest, src, origin, stride);
|
||||
|
||||
#ifdef CONFIG_NX_SWCURSOR
|
||||
/* Save the modified cursor background region
|
||||
* REVISIT: Only a single color plane is supported
|
||||
*/
|
||||
|
||||
wnd->be->plane[0].cursor.backup(wnd->be, dest, 0);
|
||||
|
||||
/* Restore the software cursor if any part of the cursor was
|
||||
* overwritten by the bitmap copy.
|
||||
*/
|
||||
|
||||
wnd->be->plane[0].cursor.draw(wnd->be, dest, 0);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -78,8 +78,13 @@ void nxbe_cursor_enable(FAR struct nxbe_state_s *be, bool enable)
|
|||
be->cursor.visible = true;
|
||||
|
||||
#ifdef CONFIG_NX_SWCURSOR
|
||||
be->plane[0].cursor.backup(be, 0); /* Save the cursor background image */
|
||||
be->plane[0].cursor.draw(be, 0); /* Write the new cursor */
|
||||
/* Save the cursor background image */
|
||||
|
||||
be->plane[0].cursor.backup(be, &be->cursor.bounds, 0);
|
||||
|
||||
/* Write the new cursor image to device memory */
|
||||
|
||||
be->plane[0].cursor.draw(be, &be->cursor.bounds, 0);
|
||||
#else
|
||||
/* For a hardware cursor, this would require some interaction with the
|
||||
* grahics device.
|
||||
|
@ -100,7 +105,7 @@ void nxbe_cursor_enable(FAR struct nxbe_state_s *be, bool enable)
|
|||
#ifdef CONFIG_NX_SWCURSOR
|
||||
/* Erase the old cursor image by writing the saved background image. */
|
||||
|
||||
be->plane[0].cursor.erase(be, 0); /* Erase the old cursor */
|
||||
be->plane[0].cursor.erase(be, &be->cursor.bounds, 0);
|
||||
#else
|
||||
/* For a hardware cursor, this would require some interaction with the
|
||||
* grahics device.
|
||||
|
@ -151,7 +156,7 @@ void nxbe_cursor_setimage(FAR struct nxbe_state_s *be,
|
|||
{
|
||||
/* Erase the old cursor image by writing the saved background image. */
|
||||
|
||||
be->plane[0].cursor.erase(be, 0); /* Erase the old cursor */
|
||||
be->plane[0].cursor.erase(be, &be->cursor.bounds, 0);
|
||||
}
|
||||
|
||||
/* Has the cursor changed size? */
|
||||
|
@ -191,7 +196,7 @@ void nxbe_cursor_setimage(FAR struct nxbe_state_s *be,
|
|||
|
||||
/* Read in the new background image */
|
||||
|
||||
be->plane[0].cursor.backup(be, 0);
|
||||
be->plane[0].cursor.backup(be, &be->cursor.bounds, 0);
|
||||
}
|
||||
|
||||
/* Save the new colors */
|
||||
|
@ -223,7 +228,7 @@ errout_with_erase:
|
|||
{
|
||||
/* Write the new cursor image to the device graphics memory. */
|
||||
|
||||
be->plane[0].cursor.draw(be, 0); /* Erase the old cursor */
|
||||
be->plane[0].cursor.draw(be, &be->cursor.bounds, 0);
|
||||
}
|
||||
|
||||
#else
|
||||
|
@ -266,7 +271,7 @@ void nxbe_cursor_setposition(FAR struct nxbe_state_s *be,
|
|||
{
|
||||
/* Erase the old cursor image by writing the saved background image. */
|
||||
|
||||
be->plane[0].cursor.erase(be, 0); /* Erase the old cursor */
|
||||
be->plane[0].cursor.erase(be, &be->cursor.bounds, 0);
|
||||
}
|
||||
|
||||
/* Calculate the cursor movement */
|
||||
|
@ -280,7 +285,7 @@ void nxbe_cursor_setposition(FAR struct nxbe_state_s *be,
|
|||
|
||||
/* Read in the new background image at this offset */
|
||||
|
||||
be->plane[0].cursor.backup(be, 0);
|
||||
be->plane[0].cursor.backup(be, &be->cursor.bounds, 0);
|
||||
|
||||
/* If the cursor is visible, then put write the new cursor image into
|
||||
* device graphics memory now.
|
||||
|
@ -290,7 +295,7 @@ void nxbe_cursor_setposition(FAR struct nxbe_state_s *be,
|
|||
{
|
||||
/* Write the new cursor image to the device graphics memory. */
|
||||
|
||||
be->plane[0].cursor.draw(be, 0); /* Erase the old cursor */
|
||||
be->plane[0].cursor.draw(be, &be->cursor.bounds, 0);
|
||||
}
|
||||
|
||||
#else
|
||||
|
|
|
@ -71,8 +71,8 @@ struct nxbe_fill_s
|
|||
****************************************************************************/
|
||||
|
||||
static void nxbe_clipfill(FAR struct nxbe_clipops_s *cops,
|
||||
FAR struct nxbe_plane_s *plane,
|
||||
FAR const struct nxgl_rect_s *rect)
|
||||
FAR struct nxbe_plane_s *plane,
|
||||
FAR const struct nxgl_rect_s *rect)
|
||||
{
|
||||
struct nxbe_fill_s *fillinfo = (struct nxbe_fill_s *)cops;
|
||||
|
||||
|
@ -119,12 +119,32 @@ static inline void nxbe_fill_dev(FAR struct nxbe_window_s *wnd,
|
|||
{
|
||||
DEBUGASSERT(wnd->be->plane[i].dev.fillrectangle != NULL);
|
||||
|
||||
/* Fill the visible part of the rectangle */
|
||||
|
||||
info.cops.visible = nxbe_clipfill;
|
||||
info.cops.obscured = nxbe_clipnull;
|
||||
info.color = color[i];
|
||||
|
||||
nxbe_clipper(wnd->above, rect, NX_CLIPORDER_DEFAULT,
|
||||
&info.cops, &wnd->be->plane[i]);
|
||||
|
||||
#ifdef CONFIG_NX_SWCURSOR
|
||||
/* Save the modified cursor background region.
|
||||
*
|
||||
* REVISIT: This and the following logic belongs in the function
|
||||
* nxbe_clipfill(). It is here only because the struct nxbe_state_s
|
||||
* (wnd->be) is not available at that point. This may result in an
|
||||
* excessive number of cursor updates.
|
||||
*/
|
||||
|
||||
wnd->be->plane[i].cursor.backup(wnd->be, rect, i);
|
||||
|
||||
/* Restore the software cursor if any part of the cursor was
|
||||
* overwritten by the fill.
|
||||
*/
|
||||
|
||||
wnd->be->plane[i].cursor.draw(wnd->be, rect, i);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -150,9 +150,31 @@ static inline void nxbe_filltrapezoid_dev(FAR struct nxbe_window_s *wnd,
|
|||
i = 0;
|
||||
#endif
|
||||
{
|
||||
/* Rend any part of the trapezoid that is not occluded by a window
|
||||
* higher in the hiearchy.
|
||||
*/
|
||||
|
||||
info.color = color[i];
|
||||
nxbe_clipper(wnd->above, bounds, NX_CLIPORDER_DEFAULT,
|
||||
&info.cops, &wnd->be->plane[i]);
|
||||
|
||||
#ifdef CONFIG_NX_SWCURSOR
|
||||
/* Save the modified cursor background region.
|
||||
*
|
||||
* REVISIT: This and the following logic belongs in the function
|
||||
* nxbe_clipfilltrapezoid(). It is here only because the struct
|
||||
* nxbe_state_s (wnd->be) is not available at that point. This
|
||||
* result in an excessive number of cursor updates.
|
||||
*/
|
||||
|
||||
wnd->be->plane[i].cursor.backup(wnd->be, bounds, i);
|
||||
|
||||
/* Restore the software cursor if any part of the cursor was
|
||||
* overwritten by the fill.
|
||||
*/
|
||||
|
||||
wnd->be->plane[i].cursor.draw(wnd->be, bounds, i);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -53,32 +53,6 @@
|
|||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: nxbe_sprite_refresh
|
||||
*
|
||||
* Description:
|
||||
* Prior to calling nxbe_bitmap_dev(), update any "sprites" tht need to
|
||||
* be overlaid on the per-window frambuffer. This could include such
|
||||
* things as OSD functionality, a software cursor, selection boxes, etc.
|
||||
*
|
||||
* Input Parameters (same as for nxbe_flush):
|
||||
* wnd - The window that will receive the bitmap image
|
||||
* dest - Describes the rectangular region on the display that was
|
||||
* modified (in device coordinates)
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if 0 /* There are none yet */
|
||||
void nxbe_sprite_refresh(FAR struct nxbe_window_s *wnd,
|
||||
FAR const struct nxgl_rect_s *dest)
|
||||
{
|
||||
/* Sprite support has not yet been implemented */
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: nxbe_flush
|
||||
*
|
||||
|
@ -87,14 +61,13 @@ void nxbe_sprite_refresh(FAR struct nxbe_window_s *wnd,
|
|||
* be written to device graphics memory. That function is managed by this
|
||||
* simple function. It does the following:
|
||||
*
|
||||
* 1) It calls nxbe_sprite_refresh() to update any "sprite" graphics on top
|
||||
* of the RAM framebuffer. This could include such things as OSD
|
||||
* functionality, a software cursor, selection boxes, etc.
|
||||
* 2) Then it calls nxbe_bitmap_dev() to copy the modified per-window
|
||||
* frambuffer into device memory.
|
||||
*
|
||||
* This the "sprite" image is always on top of the device display, this
|
||||
* supports flicker-free software sprites.
|
||||
* 1) It calls nxbe_bitmap_dev() to copy the modified per-window
|
||||
* framebuffer into device graphics memory.
|
||||
* 2) If CONFIG_NX_SWCURSOR is enabled, it calls the cursor "draw"
|
||||
* renderer to update re-draw the currsor image if any portion of
|
||||
* graphics display update overwrote the cursor. Since these
|
||||
* operations are performed back-to-back, any resulting flicker
|
||||
* should be minimized.
|
||||
*
|
||||
* Input Parameters (same as for nxbe_flush):
|
||||
* wnd - The window that will receive the bitmap image
|
||||
|
@ -117,18 +90,17 @@ void nxbe_flush(FAR struct nxbe_window_s *wnd,
|
|||
FAR const struct nxgl_point_s *origin,
|
||||
unsigned int stride)
|
||||
{
|
||||
/* Update any "sprite" graphics on top of the display. These may have been
|
||||
* damaged by the preceding framebuffer update.
|
||||
*/
|
||||
|
||||
nxbe_sprite_refresh(wnd, dest);
|
||||
|
||||
/* Copy the modified per-window frambuffer into device memory. Since the
|
||||
* "sprite" graphics were refreshed after the update, then should be no
|
||||
* flicker as you see with a direct update of the device graphics memory.
|
||||
*/
|
||||
/* Copy the modified per-window frambuffer into device memory. */
|
||||
|
||||
nxbe_bitmap_dev(wnd, dest, src, origin, stride);
|
||||
|
||||
#ifdef CONFIG_NX_SWCURSOR
|
||||
/* Restore the software cursor if any part of the cursor was overwritten
|
||||
* by the above copy.
|
||||
*/
|
||||
|
||||
wnd->be->plane[0].cursor.draw(wnd->be, dest, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* CONFIG_NX_RAMBACKED */
|
||||
|
|
|
@ -180,6 +180,8 @@ static void nxbe_clipmovedest(FAR struct nxbe_clipops_s *cops,
|
|||
{
|
||||
struct nxbe_move_s srcinfo;
|
||||
|
||||
/* Move the visible part of window */
|
||||
|
||||
srcinfo.cops.visible = nxbe_clipmovesrc;
|
||||
srcinfo.cops.obscured = nxbe_clipmoveobscured;
|
||||
srcinfo.offset = offset;
|
||||
|
@ -211,6 +213,9 @@ static inline void nxbe_move_dev(FAR struct nxbe_window_s *wnd,
|
|||
FAR const struct nxgl_point_s *offset)
|
||||
{
|
||||
struct nxbe_move_s info;
|
||||
#ifdef CONFIG_NX_SWCURSOR
|
||||
struct nxgl_rect_s dest;
|
||||
#endif
|
||||
int i;
|
||||
|
||||
info.cops.visible = nxbe_clipmovedest;
|
||||
|
@ -260,6 +265,12 @@ static inline void nxbe_move_dev(FAR struct nxbe_window_s *wnd,
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NX_SWCURSOR
|
||||
/* Apply the offsets to the source window to get the destination window */
|
||||
|
||||
nxgl_rectoffset(&dest, rect, offset->x, offset->y);
|
||||
#endif
|
||||
|
||||
/* Then perform the move */
|
||||
|
||||
#if CONFIG_NX_NPLANES > 1
|
||||
|
@ -268,8 +279,35 @@ static inline void nxbe_move_dev(FAR struct nxbe_window_s *wnd,
|
|||
i = 0;
|
||||
#endif
|
||||
{
|
||||
#ifdef CONFIG_NX_SWCURSOR
|
||||
/* Remove the cursor from the source region */
|
||||
|
||||
wnd->be->plane[i].cursor.erase(wnd->be, rect, i);
|
||||
#endif
|
||||
|
||||
nxbe_clipper(wnd->above, &info.srcrect, info.order,
|
||||
&info.cops, &wnd->be->plane[i]);
|
||||
|
||||
|
||||
#ifdef CONFIG_NX_SWCURSOR
|
||||
/* Save the modified cursor background region at the destination
|
||||
* region. This would be necessary only for small moves that stay
|
||||
* within the cursor region.
|
||||
*
|
||||
* REVISIT: This and the following logic belongs in the function
|
||||
* nxbe_clipmovedest(). It is here only because the struct
|
||||
* nxbe_state_s (wnd->be) is not available at that point. This
|
||||
* result in an excessive number of cursor updates.
|
||||
*/
|
||||
|
||||
wnd->be->plane[i].cursor.backup(wnd->be, &dest, i);
|
||||
|
||||
/* Restore the software cursor if any part of the cursor was
|
||||
* overwritten by the fill.
|
||||
*/
|
||||
|
||||
wnd->be->plane[i].cursor.draw(wnd->be, &dest, i);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -147,7 +147,26 @@ void nxbe_setpixel(FAR struct nxbe_window_s *wnd,
|
|||
info.cops.obscured = nxbe_clipnull;
|
||||
info.color = color[i];
|
||||
|
||||
/* Draw the point (if it is visible) */
|
||||
|
||||
nxbe_clipper(wnd->above, &rect, NX_CLIPORDER_DEFAULT,
|
||||
&info.cops, &wnd->be->plane[i]);
|
||||
|
||||
#ifdef CONFIG_NX_SWCURSOR
|
||||
/* Save the modified cursor pixe at the point.
|
||||
*
|
||||
* REVISIT: This and the following logic belongs in the function
|
||||
* nxbe_clipfill(). It is here only because the struct nxbe_state_s
|
||||
* (wnd->be) is not available at that point.
|
||||
*/
|
||||
|
||||
wnd->be->plane[i].cursor.backup(wnd->be, &rect, i);
|
||||
|
||||
/* Restore the software cursor if if that point is a visible cursor
|
||||
* bit that was overwritten by the above operation.
|
||||
*/
|
||||
|
||||
wnd->be->plane[i].cursor.draw(wnd->be, &rect, i);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,6 +63,7 @@
|
|||
*
|
||||
* Input Parameters:
|
||||
* be - The back-end state structure instance
|
||||
* bounds - The region of the display that has been modified.
|
||||
* planeno - The color plane being drawn
|
||||
*
|
||||
* Returned Value:
|
||||
|
@ -71,16 +72,16 @@
|
|||
****************************************************************************/
|
||||
|
||||
void NXGL_FUNCNAME(nxglib_cursor_backup, NXGLIB_SUFFIX)
|
||||
(FAR struct nxbe_state_s *be, 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;
|
||||
FAR struct nxbe_plane_s *plane;
|
||||
FAR uint8_t *fbmem;
|
||||
FAR uint8_t *sline;
|
||||
FAR const uint8_t *sline;
|
||||
FAR uint8_t *dline;
|
||||
FAR NXGL_PIXEL_T *src;
|
||||
FAR NXGL_PIXEL_T *dest;
|
||||
FAR const FAR NXGL_PIXEL_T *src;
|
||||
FAR FAR NXGL_PIXEL_T *dest;
|
||||
nxgl_coord_t width;
|
||||
nxgl_coord_t height;
|
||||
nxgl_coord_t sstride;
|
||||
|
@ -91,6 +92,10 @@ void NXGL_FUNCNAME(nxglib_cursor_backup, NXGLIB_SUFFIX)
|
|||
/* Handle the case some or all of the backup image is off of the display. */
|
||||
|
||||
nxgl_rectintersect(&intersection, &be->cursor.bounds, &be->bkgd.bounds);
|
||||
|
||||
/* Check if there is anything in the modified region that we need to handle. */
|
||||
|
||||
nxgl_rectintersect(&intersection, &intersection, bounds);
|
||||
if (!nxgl_nullrect(&intersection))
|
||||
{
|
||||
/* Get the width and the height of the images in pixels/rows */
|
||||
|
|
|
@ -108,6 +108,7 @@ static NXGL_PIXEL_T nxbe_map_color(FAR struct nxbe_state_s *be, int plane,
|
|||
*
|
||||
* Input Parameters:
|
||||
* be - The back-end state structure instance
|
||||
* bounds - The region of the display that has been modified.
|
||||
* planeno - The color plane being drawn
|
||||
*
|
||||
* Returned Value:
|
||||
|
@ -116,14 +117,14 @@ 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, 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;
|
||||
FAR struct nxbe_plane_s *plane;
|
||||
FAR uint8_t *fbmem;
|
||||
FAR uint8_t *src;
|
||||
FAR uint8_t *sline;
|
||||
FAR const uint8_t *src;
|
||||
FAR const uint8_t *sline;
|
||||
FAR uint8_t *dline;
|
||||
FAR NXGL_PIXEL_T *dest;
|
||||
nxgl_coord_t width;
|
||||
|
@ -138,6 +139,10 @@ void NXGL_FUNCNAME(nxglib_cursor_draw, NXGLIB_SUFFIX)
|
|||
/* Handle the case some or all of the cursor image is off of the display. */
|
||||
|
||||
nxgl_rectintersect(&intersection, &be->cursor.bounds, &be->bkgd.bounds);
|
||||
|
||||
/* Check if there is anything in the modified region that we need to handle. */
|
||||
|
||||
nxgl_rectintersect(&intersection, &intersection, bounds);
|
||||
if (!nxgl_nullrect(&intersection))
|
||||
{
|
||||
/* Get the width and the height of the images in pixels/rows */
|
||||
|
|
|
@ -62,6 +62,7 @@
|
|||
*
|
||||
* Input Parameters:
|
||||
* be - The back-end state structure instance
|
||||
* bounds - The region of the display that has been modified.
|
||||
* planeno - The color plane being drawn
|
||||
*
|
||||
* Returned Value:
|
||||
|
@ -70,15 +71,15 @@
|
|||
****************************************************************************/
|
||||
|
||||
void NXGL_FUNCNAME(nxglib_cursor_erase, NXGLIB_SUFFIX)
|
||||
(FAR struct nxbe_state_s *be, 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;
|
||||
FAR struct nxbe_plane_s *plane;
|
||||
FAR uint8_t *fbmem;
|
||||
FAR uint8_t *sline;
|
||||
FAR const uint8_t *sline;
|
||||
FAR uint8_t *dline;
|
||||
FAR NXGL_PIXEL_T *src;
|
||||
FAR const NXGL_PIXEL_T *src;
|
||||
FAR NXGL_PIXEL_T *dest;
|
||||
nxgl_coord_t width;
|
||||
nxgl_coord_t height;
|
||||
|
@ -90,6 +91,10 @@ void NXGL_FUNCNAME(nxglib_cursor_erase, NXGLIB_SUFFIX)
|
|||
/* Handle the case some or all of the cursor image is off of the display. */
|
||||
|
||||
nxgl_rectintersect(&intersection, &be->cursor.bounds, &be->bkgd.bounds);
|
||||
|
||||
/* Check if there is anything in the modified region that we need to handle. */
|
||||
|
||||
nxgl_rectintersect(&intersection, &intersection, bounds);
|
||||
if (!nxgl_nullrect(&intersection))
|
||||
{
|
||||
/* Get the width and the height of the images in pixels/rows */
|
||||
|
|
|
@ -464,10 +464,18 @@ void pwfb_copyrectangle_32bpp(FAR struct nxbe_window_s *bwnd,
|
|||
struct nxbe_state_s; /* Forward reference */
|
||||
|
||||
#ifdef CONFIG_NX_SWCURSOR
|
||||
void nxglib_cursor_draw_8bpp(FAR struct nxbe_state_s *be, int planeno);
|
||||
void nxglib_cursor_draw_16bpp(FAR struct nxbe_state_s *be, int planeno);
|
||||
void nxglib_cursor_draw_24bpp(FAR struct nxbe_state_s *be, int planeno);
|
||||
void nxglib_cursor_draw_32bpp(FAR struct nxbe_state_s *be, int planeno);
|
||||
void nxglib_cursor_draw_8bpp(FAR struct nxbe_state_s *be,
|
||||
FAR const struct nxgl_rect_s *bounds,
|
||||
int planeno);
|
||||
void nxglib_cursor_draw_16bpp(FAR struct nxbe_state_s *be,
|
||||
FAR const struct nxgl_rect_s *bounds,
|
||||
int planeno);
|
||||
void nxglib_cursor_draw_24bpp(FAR struct nxbe_state_s *be,
|
||||
FAR const struct nxgl_rect_s *bounds,
|
||||
int planeno);
|
||||
void nxglib_cursor_draw_32bpp(FAR struct nxbe_state_s *be,
|
||||
FAR const struct nxgl_rect_s *bounds,
|
||||
int planeno);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -480,10 +488,18 @@ void nxglib_cursor_draw_32bpp(FAR struct nxbe_state_s *be, int planeno);
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NX_SWCURSOR
|
||||
void nxglib_cursor_erase_8bpp(FAR struct nxbe_state_s *be, int planeno);
|
||||
void nxglib_cursor_erase_16bpp(FAR struct nxbe_state_s *be, int planeno);
|
||||
void nxglib_cursor_erase_24bpp(FAR struct nxbe_state_s *be, int planeno);
|
||||
void nxglib_cursor_erase_32bpp(FAR struct nxbe_state_s *be, int planeno);
|
||||
void nxglib_cursor_erase_8bpp(FAR struct nxbe_state_s *be,
|
||||
FAR const struct nxgl_rect_s *bounds,
|
||||
int planeno);
|
||||
void nxglib_cursor_erase_16bpp(FAR struct nxbe_state_s *be,
|
||||
FAR const struct nxgl_rect_s *bounds,
|
||||
int planeno);
|
||||
void nxglib_cursor_erase_24bpp(FAR struct nxbe_state_s *be,
|
||||
FAR const struct nxgl_rect_s *bounds,
|
||||
int planeno);
|
||||
void nxglib_cursor_erase_32bpp(FAR struct nxbe_state_s *be,
|
||||
FAR const struct nxgl_rect_s *bounds,
|
||||
int planeno);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -496,10 +512,18 @@ void nxglib_cursor_erase_32bpp(FAR struct nxbe_state_s *be, int planeno);
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NX_SWCURSOR
|
||||
void nxglib_cursor_backup_8bpp(FAR struct nxbe_state_s *be, int planeno);
|
||||
void nxglib_cursor_backup_16bpp(FAR struct nxbe_state_s *be, int planeno);
|
||||
void nxglib_cursor_backup_24bpp(FAR struct nxbe_state_s *be, int planeno);
|
||||
void nxglib_cursor_backup_32bpp(FAR struct nxbe_state_s *be, int planeno);
|
||||
void nxglib_cursor_backup_8bpp(FAR struct nxbe_state_s *be,
|
||||
FAR const struct nxgl_rect_s *bounds,
|
||||
int planeno);
|
||||
void nxglib_cursor_backup_16bpp(FAR struct nxbe_state_s *be,
|
||||
FAR const struct nxgl_rect_s *bounds,
|
||||
int planeno);
|
||||
void nxglib_cursor_backup_24bpp(FAR struct nxbe_state_s *be,
|
||||
FAR const struct nxgl_rect_s *bounds,
|
||||
int planeno);
|
||||
void nxglib_cursor_backup_32bpp(FAR struct nxbe_state_s *be,
|
||||
FAR const struct nxgl_rect_s *bounds,
|
||||
int planeno);
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
|
|
|
@ -871,7 +871,7 @@ void nx_notify_rectangle(FAR NX_PLANEINFOTYPE *pinfo,
|
|||
|
||||
DEBUGASSERT(pinfo != NULL && rect != NULL);
|
||||
|
||||
/* Recover the session informatin from the display number in the planeinfo
|
||||
/* Recover the session information from the display number in the planeinfo
|
||||
* structure.
|
||||
*/
|
||||
|
||||
|
|
|
@ -78,12 +78,13 @@ extern "C"
|
|||
* a process space and will not be generally available. In that case,
|
||||
* we could keep the image in a shared memory region or perhaps copy the
|
||||
* image into a kernel internal buffer. Neither of those are implemented.
|
||||
* 4. Only a single color plane is supported at present.
|
||||
*/
|
||||
|
||||
#if (defined(CONFIG_NX_SWCURSOR) && \
|
||||
(defined(CONFIG_NX_LCDDRIVER) || !defined(CONFIG_NX_DISABLE_1BPP) || \
|
||||
!defined(CONFIG_NX_DISABLE_2BPP) || !defined(CONFIG_NX_DISABLE_4BPP) || \
|
||||
defined(CONFIG_BUILD_KERNEL)))
|
||||
defined(CONFIG_BUILD_KERNEL) || CONFIG_NX_NPLANES > 1))
|
||||
# undef CONFIG_NX_NOCURSOR
|
||||
# undef CONFIG_NX_SWCURSOR
|
||||
# define CONFIG_NX_NOCURSOR 1
|
||||
|
|
Loading…
Reference in a new issue