diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-05-16 18:02:37 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-05-16 18:02:37 +0000 |
commit | b9aa66266d4afd4ff8fe978bca4d706a809a4c1c (patch) | |
tree | 2c6577a1a781572dd6edfd6606277bd191b19545 /nuttx/graphics | |
parent | 694de4eb08b74ddea49c85716f452ddd33a15925 (diff) | |
download | px4-nuttx-b9aa66266d4afd4ff8fe978bca4d706a809a4c1c.tar.gz px4-nuttx-b9aa66266d4afd4ff8fe978bca4d706a809a4c1c.tar.bz2 px4-nuttx-b9aa66266d4afd4ff8fe978bca4d706a809a4c1c.zip |
Fixes for rendering fonts at 4bpp
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2682 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/graphics')
-rw-r--r-- | nuttx/graphics/nxfonts/nxfonts_convert.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/nuttx/graphics/nxfonts/nxfonts_convert.c b/nuttx/graphics/nxfonts/nxfonts_convert.c index ea8672c26..0f8788b8f 100644 --- a/nuttx/graphics/nxfonts/nxfonts_convert.c +++ b/nuttx/graphics/nxfonts/nxfonts_convert.c @@ -1,7 +1,7 @@ /**************************************************************************** * graphics/nxfonts/nxfonts_convert.c * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -96,6 +96,14 @@ #endif +#if NXFONTS_BITSPERPIXEL < 8 +# ifdef CONFIG_NX_PACKEDMSFIRST +# define NXF_INITMASK (NXF_PIXELMASK << (8 - NXFONTS_BITSPERPIXEL)) +# else +# define NXF_INITMASK NXF_PIXELMASK +# endif +#endif + /* Form a function name by concatenating two strings */ #define _NXF_FUNCNAME(a,b) a ## b @@ -182,11 +190,7 @@ int NXF_FUNCNAME(nxf_convert,NXFONTS_SUFFIX) col = 0; dptr = (FAR NXF_PIXEL_T*)line; pixel = *dptr; -#ifdef CONFIG_NX_PACKEDMSFIRST - mask = NXF_PIXELMASK << (8 - NXFONTS_BITSPERPIXEL); -#else - mask = NXF_PIXELMASK; -#endif + mask = NXF_INITMASK; nbits = 0; for (bmndx = 0; bmndx < bm->metric.stride && col < width; bmndx++) @@ -216,7 +220,7 @@ int NXF_FUNCNAME(nxf_convert,NXFONTS_SUFFIX) { *dptr++ = pixel; pixel = *dptr; - mask = NXF_PIXELMASK; + mask = NXF_INITMASK; nbits = 0; } } |