summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-11-28 01:33:18 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-11-28 01:33:18 +0000
commitcb311769b6806d5eb0a0b976d062d3c1c3cad2d4 (patch)
tree5c867724b8d0f8996fe6e515b20772f0eb7ef217
parent0363cbbc1a111f650c8e6ec52d9a0719737511e3 (diff)
downloadpx4-nuttx-cb311769b6806d5eb0a0b976d062d3c1c3cad2d4.tar.gz
px4-nuttx-cb311769b6806d5eb0a0b976d062d3c1c3cad2d4.tar.bz2
px4-nuttx-cb311769b6806d5eb0a0b976d062d3c1c3cad2d4.zip
minor refactoring
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1322 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--nuttx/graphics/nxbe/nxbe_bitmap.c17
-rw-r--r--nuttx/graphics/nxbe/nxbe_fill.c6
-rw-r--r--nuttx/graphics/nxbe/nxbe_move.c6
-rw-r--r--nuttx/graphics/nxbe/nxbe_setposition.c4
-rw-r--r--nuttx/graphics/nxbe/nxbe_setsize.c4
5 files changed, 24 insertions, 13 deletions
diff --git a/nuttx/graphics/nxbe/nxbe_bitmap.c b/nuttx/graphics/nxbe/nxbe_bitmap.c
index 974114f91..dbaa1c6b1 100644
--- a/nuttx/graphics/nxbe/nxbe_bitmap.c
+++ b/nuttx/graphics/nxbe/nxbe_bitmap.c
@@ -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,
diff --git a/nuttx/graphics/nxbe/nxbe_fill.c b/nuttx/graphics/nxbe/nxbe_fill.c
index 6664d8e2d..e92b21b10 100644
--- a/nuttx/graphics/nxbe/nxbe_fill.c
+++ b/nuttx/graphics/nxbe/nxbe_fill.c
@@ -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))
diff --git a/nuttx/graphics/nxbe/nxbe_move.c b/nuttx/graphics/nxbe/nxbe_move.c
index 872ed55eb..440a53016 100644
--- a/nuttx/graphics/nxbe/nxbe_move.c
+++ b/nuttx/graphics/nxbe/nxbe_move.c
@@ -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))
diff --git a/nuttx/graphics/nxbe/nxbe_setposition.c b/nuttx/graphics/nxbe/nxbe_setposition.c
index 87083a8c7..d4d36b2bb 100644
--- a/nuttx/graphics/nxbe/nxbe_setposition.c
+++ b/nuttx/graphics/nxbe/nxbe_setposition.c
@@ -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);
}
diff --git a/nuttx/graphics/nxbe/nxbe_setsize.c b/nuttx/graphics/nxbe/nxbe_setsize.c
index b75aabfe6..c979b870c 100644
--- a/nuttx/graphics/nxbe/nxbe_setsize.c
+++ b/nuttx/graphics/nxbe/nxbe_setsize.c
@@ -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);
}