diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-05-10 16:25:56 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-05-10 16:25:56 +0000 |
commit | 68f3044b5099572850a9e81a1c63161c20809547 (patch) | |
tree | 1160b821f035a4e90a5ed6472800e6d7e03468b8 /nuttx/graphics/nxmu/nx_filltrapezoid.c | |
parent | 2bfda8161a877d7e618a37353f806981c0ab4a4b (diff) | |
download | px4-nuttx-68f3044b5099572850a9e81a1c63161c20809547.tar.gz px4-nuttx-68f3044b5099572850a9e81a1c63161c20809547.tar.bz2 px4-nuttx-68f3044b5099572850a9e81a1c63161c20809547.zip |
NX trapezoid fixes; Various NxWM fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4720 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/graphics/nxmu/nx_filltrapezoid.c')
-rw-r--r-- | nuttx/graphics/nxmu/nx_filltrapezoid.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/nuttx/graphics/nxmu/nx_filltrapezoid.c b/nuttx/graphics/nxmu/nx_filltrapezoid.c index 8708225d3..f0a55fc62 100644 --- a/nuttx/graphics/nxmu/nx_filltrapezoid.c +++ b/nuttx/graphics/nxmu/nx_filltrapezoid.c @@ -1,8 +1,8 @@ /**************************************************************************** * graphics/nxmu/nx_filltrapezoid.c * - * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -98,6 +98,8 @@ int nx_filltrapezoid(NXWINDOW hwnd, FAR const struct nxgl_rect_s *clip, int ret; int i; + /* Some debug-only sanity checks */ + #ifdef CONFIG_DEBUG if (!wnd || !wnd->conn || !trap || !color) { @@ -111,22 +113,31 @@ int nx_filltrapezoid(NXWINDOW hwnd, FAR const struct nxgl_rect_s *clip, outmsg.msgid = NX_SVRMSG_FILLTRAP; outmsg.wnd = wnd; + /* If no clipping window was provided, then use the size of the entire window */ + if (clip) { nxgl_rectcopy(&outmsg.clip, clip); } else { - memset(&outmsg.clip, 0, sizeof(struct nxgl_rect_s)); + nxgl_rectcopy(&outmsg.clip, &wnd->bounds); } + + /* Copy the trapezod and the color into the message */ + nxgl_trapcopy(&outmsg.trap, trap); +#if CONFIG_NX_NPLANES > 1 for (i = 0; i < CONFIG_NX_NPLANES; i++) +#else + i = 0; +#endif { outmsg.color[i] = color[i]; } - /* Forward the fill command to the server */ + /* Forward the trapezoid fill command to the server */ ret = mq_send(wnd->conn->cwrmq, &outmsg, sizeof(struct nxsvrmsg_filltrapezoid_s), NX_SVRMSG_PRIO); |