NX graphics library: Macroize some color operators that become trivial when there is only one color plane

This commit is contained in:
Gregory Nutt
2014-07-12 07:44:56 -06:00
parent 39c6f74966
commit 58ab6ec03f
3 changed files with 27 additions and 11 deletions
+8
View File
@@ -633,8 +633,12 @@ void nxgl_trapcopy(FAR struct nxgl_trapezoid_s *dest,
*
****************************************************************************/
#if CONFIG_NX_NPLANES == 1
# define nxgl_colorcopy(d,s) do { (d)[0] = s[0]; } while (0)
#else
void nxgl_colorcopy(nxgl_mxpixel_t dest[CONFIG_NX_NPLANES],
const nxgl_mxpixel_t src[CONFIG_NX_NPLANES]);
#endif
/****************************************************************************
* Name: nxgl_colorcmp
@@ -646,8 +650,12 @@ void nxgl_colorcopy(nxgl_mxpixel_t dest[CONFIG_NX_NPLANES],
*
****************************************************************************/
#if CONFIG_NX_NPLANES == 1
# define nxgl_colorcmp(d,s) ((d)[0] == s[0])
#else
bool nxgl_colorcmp(const nxgl_mxpixel_t color1[CONFIG_NX_NPLANES],
const nxgl_mxpixel_t color2[CONFIG_NX_NPLANES]);
#endif
/****************************************************************************
* Name: nxgl_splitline