9
0
Fork 0

minor refactoring

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@1322 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo 2008-11-28 01:33:18 +00:00
parent 2f38e9af2f
commit 73bfb28a68
5 changed files with 24 additions and 13 deletions

View File

@ -123,6 +123,8 @@ void nxbe_bitmap(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s *de
FAR const struct nxgl_point_s *origin, unsigned int stride)
{
struct nx_bitmap_s info;
struct nxgl_rect_s bounds;
struct nxgl_point_s offset;
struct nxgl_rect_s remaining;
int i;
@ -133,11 +135,16 @@ void nxbe_bitmap(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s *de
}
#endif
/* Offset the rectangle and image origin by the window origin */
nxgl_rectoffset(&bounds, dest, wnd->origin.x, wnd->origin.y);
nxgl_vectoradd(&offset, origin, &wnd->origin);
/* Verify that the destination rectangle begins "below" and to the "right"
* of the origin
*/
if (dest->pt1.x < origin->x || dest->pt1.y < origin->y)
if (bounds.pt1.x < origin->x || bounds.pt1.y < origin->y)
{
gdbg("Bad dest start position\n");
return;
@ -147,7 +154,7 @@ void nxbe_bitmap(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s *de
* with of the source bitmap data
*/
if ((((dest->pt2.x - origin->x) * wnd->be->plane[0].pinfo.bpp) >> 3) > stride)
if ((((bounds.pt2.x - offset.x) * wnd->be->plane[0].pinfo.bpp) >> 3) > stride)
{
gdbg("Bad dest width\n");
return;
@ -155,7 +162,7 @@ void nxbe_bitmap(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s *de
/* Clip to the limits of the window and of the background screen */
nxgl_rectintersect(&remaining, dest, &wnd->bounds);
nxgl_rectintersect(&remaining, &bounds, &wnd->bounds);
nxgl_rectintersect(&remaining, &remaining, &wnd->be->bkgd.bounds);
if (nxgl_nullrect(&remaining))
{
@ -173,8 +180,8 @@ void nxbe_bitmap(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s *de
info.cops.visible = nxs_clipcopy;
info.cops.obscured = nxbe_clipnull;
info.src = src[i];
info.origin.x = origin->x;
info.origin.y = origin->y;
info.origin.x = offset.x;
info.origin.y = offset.y;
info.stride = stride;
nxbe_clipper(wnd->above, &remaining, NX_CLIPORDER_DEFAULT,

View File

@ -121,9 +121,13 @@ void nxbe_fill(FAR struct nxbe_window_s *wnd,
}
#endif
/* Offset the rectangle by the window origin to convert it into a bounding box */
nxgl_rectoffset(&remaining, rect, wnd->origin.x, wnd->origin.y);
/* Clip to the limits of the window and of the background screen */
nxgl_rectintersect(&remaining, rect, &wnd->bounds);
nxgl_rectintersect(&remaining, &remaining, &wnd->bounds);
nxgl_rectintersect(&remaining, &remaining, &wnd->be->bkgd.bounds);
if (!nxgl_nullrect(&remaining))

View File

@ -209,9 +209,13 @@ void nxbe_move(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s *rect
}
#endif
/* Offset the rectangle by the window origin to create a bounding box */
nxgl_rectoffset(&remaining, rect, wnd->origin.x, wnd->origin.y);
/* Clip to the limits of the window and of the background screen */
nxgl_rectintersect(&remaining, rect, &wnd->bounds);
nxgl_rectintersect(&remaining, &remaining, &wnd->bounds);
nxgl_rectintersect(&remaining, &remaining, &wnd->be->bkgd.bounds);
if (nxgl_nullrect(&remaining))

View File

@ -118,7 +118,5 @@ void nxbe_setposition(FAR struct nxbe_window_s *wnd,
/* Report the new size/position */
#ifdef CONFIG_NX_MULTIUSER
nxmu_reportposition(wnd);
#endif
nxfe_reportposition(wnd);
}

View File

@ -107,7 +107,5 @@ void nxbe_setsize(FAR struct nxbe_window_s *wnd,
/* Report the new size/position */
#ifdef CONFIG_NX_MULTIUSER
nxmu_reportposition(wnd);
#endif
nxfe_reportposition(wnd);
}