From 68f3044b5099572850a9e81a1c63161c20809547 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 10 May 2012 16:25:56 +0000 Subject: NX trapezoid fixes; Various NxWM fixes git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4720 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/graphics/nxmu/nx_filltrapezoid.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'nuttx/graphics/nxmu/nx_filltrapezoid.c') 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 + * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * 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); -- cgit v1.2.3