mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 08:38:38 +08:00
Make prototypes of rasterizers same at all resolutions
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1317 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
076808fec7
commit
528ffcbed0
6 changed files with 75 additions and 53 deletions
13
Makefile
13
Makefile
|
@ -61,13 +61,17 @@ ADDON_DIRS := $(PCODE_DIR) $(NX_DIR)
|
|||
# (except for parts of FSDIRS). We will exclude FSDIRS
|
||||
# from the build if file descriptor support is disabled
|
||||
|
||||
NONFSDIRS = sched lib $(ARCH_SRC) mm examples/$(CONFIG_EXAMPLE) $(ADDON_DIRS) graphics
|
||||
NONFSDIRS = sched lib $(ARCH_SRC) mm examples/$(CONFIG_EXAMPLE) $(ADDON_DIRS)
|
||||
FSDIRS = fs drivers
|
||||
|
||||
ifeq ($(CONFIG_NET),y)
|
||||
NONFSDIRS += net netutils
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_NXGRAPHICS),y)
|
||||
NONFSDIRS += graphics
|
||||
endif
|
||||
|
||||
# CLEANDIRS are the directories that will clean in. These are
|
||||
# all directories that we know about.
|
||||
# MAKEDIRS are the directories in which we will build targets
|
||||
|
@ -92,8 +96,7 @@ endif
|
|||
# is disabled.
|
||||
|
||||
LINKLIBS = sched/libsched$(LIBEXT) $(ARCH_SRC)/libarch$(LIBEXT) mm/libmm$(LIBEXT) \
|
||||
lib/liblib$(LIBEXT) examples/$(CONFIG_EXAMPLE)/lib$(CONFIG_EXAMPLE)$(LIBEXT) \
|
||||
graphics/libgraphics$(LIBEXT)
|
||||
lib/liblib$(LIBEXT) examples/$(CONFIG_EXAMPLE)/lib$(CONFIG_EXAMPLE)$(LIBEXT)
|
||||
|
||||
ifeq ($(CONFIG_NET),y)
|
||||
LINKLIBS += net/libnet$(LIBEXT) netutils/libnetutils$(LIBEXT)
|
||||
|
@ -118,6 +121,10 @@ ifneq ($(NX_DIR),)
|
|||
LINKLIBS += $(NX_DIR)/libnx$(LIBEXT)
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_NXGRAPHICS),y)
|
||||
LINKLIBS += graphics/libgraphics$(LIBEXT)
|
||||
endif
|
||||
|
||||
# This is the name of the final target
|
||||
BIN = nuttx$(EXEEXT)
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ include nxglib/Make.defs
|
|||
DEPPATH += --dep-path nxglib
|
||||
CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh "$(CC)" $(TOPDIR)/graphics/nxglib}
|
||||
|
||||
HAVENX = `if [ -d nx ]; then echo "y"; else echo "n";fi`
|
||||
HAVENX := ${shell if [ -d nx ]; then echo "y"; else echo "n";fi}
|
||||
ifeq ($(HAVENX),y)
|
||||
include nx/Make.defs
|
||||
DEPPATH += --dep-path nx
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: nxs_copyrectangle_*bpp
|
||||
* Name: nxgl_copyrectangle_*bpp
|
||||
*
|
||||
* Descripton:
|
||||
* Copy a rectangular bitmap image into the specific position in the
|
||||
|
@ -78,9 +78,9 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void NXGL_FUNCNAME(nxs_copyrectangle,NXGLIB_SUFFIX)
|
||||
void NXGL_FUNCNAME(nxgl_copyrectangle,NXGLIB_SUFFIX)
|
||||
(FAR struct fb_planeinfo_s *pinfo, FAR const struct nxgl_rect_s *dest,
|
||||
FAR const NXGL_PIXEL_T *src, FAR const struct nxgl_point_s *origin,
|
||||
FAR const void *src, FAR const struct nxgl_point_s *origin,
|
||||
unsigned int srcstride)
|
||||
{
|
||||
const ubyte *sptr;
|
||||
|
@ -105,7 +105,7 @@ void NXGL_FUNCNAME(nxs_copyrectangle,NXGLIB_SUFFIX)
|
|||
|
||||
while (rows--)
|
||||
{
|
||||
NXGL_MEMCPY(dest, sptr, width);
|
||||
NXGL_MEMCPY((NXGL_PIXEL_T*)dest, (NXGL_PIXEL_T*)sptr, width);
|
||||
dptr += deststride;
|
||||
sptr += srcstride;
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
void NXGL_FUNCNAME(nxgl_fillrectangle,NXGLIB_SUFFIX)
|
||||
(FAR struct fb_planeinfo_s *pinfo, FAR const struct nxgl_rect_s *rect, NXGL_PIXEL_T color)
|
||||
(FAR struct fb_planeinfo_s *pinfo, FAR const struct nxgl_rect_s *rect, nxgl_mxpixel_t color)
|
||||
{
|
||||
ubyte *line;
|
||||
unsigned int width;
|
||||
|
@ -106,7 +106,7 @@ void NXGL_FUNCNAME(nxgl_fillrectangle,NXGLIB_SUFFIX)
|
|||
|
||||
while (rows--)
|
||||
{
|
||||
NXGL_MEMSET(line, color, width);
|
||||
NXGL_MEMSET(line, (NXGL_PIXEL_T)color, width);
|
||||
line += stride;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
|
||||
void NXGL_FUNCNAME(nxglib_filltrapezoid,NXGLIB_SUFFIX)
|
||||
(FAR struct fb_videoinfo_s *vinfo, FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_trapezoid_s *trap, NXGL_PIXEL_T color)
|
||||
FAR const struct nxgl_trapezoid_s *trap, nxgl_mxpixel_t color)
|
||||
{
|
||||
unsigned int stride;
|
||||
ubyte *line;
|
||||
|
@ -152,7 +152,7 @@ void NXGL_FUNCNAME(nxglib_filltrapezoid,NXGLIB_SUFFIX)
|
|||
|
||||
/* Then draw the run from (line + clipx1) to (line + clipx2) */
|
||||
|
||||
NXGL_MEMSET(line + NXGL_SCALEX(ix1), color, ix2 - ix1 + 1);
|
||||
NXGL_MEMSET(line + NXGL_SCALEX(ix1), (NXGL_PIXEL_T)color, ix2 - ix1 + 1);
|
||||
}
|
||||
|
||||
/* Move to the start of the next line */
|
||||
|
|
|
@ -59,6 +59,21 @@
|
|||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/* Pixels *******************************************************************/
|
||||
|
||||
/* The size of graphics solutions can be reduced by disabling support for
|
||||
* specific resolutions. One thing we can do, for example, is to select
|
||||
* the smallest common pixel representation:
|
||||
*/
|
||||
|
||||
#if !defined(CONFIG_NXGLIB_DISABLE_32BPP) || defined(CONFIG_NXGLIB_DISABLE_24BPP)
|
||||
typedef uint32 nxgl_mxpixel_t;
|
||||
#elif !defined(CONFIG_NXGLIB_DISABLE_16BPP)
|
||||
typedef uint16 nxgl_mxpixel_t;
|
||||
#else
|
||||
typedef ubyte nxgl_mxpixel_t;
|
||||
#endif
|
||||
|
||||
/* Graphics structures ******************************************************/
|
||||
|
||||
/* A given coordinate is limited to the screen height an width. If either
|
||||
|
@ -156,25 +171,25 @@ EXTERN void nxgl_yuv2rgb(ubyte y, ubyte u, ubyte v, ubyte *r, ubyte *g, ubyte *b
|
|||
|
||||
EXTERN void nxgl_fillrectangle_1bpp(FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_rect_s *rect,
|
||||
ubyte color);
|
||||
nxgl_mxpixel_t color);
|
||||
EXTERN void nxgl_fillrectangle_2bpp(FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_rect_s *rect,
|
||||
ubyte color);
|
||||
nxgl_mxpixel_t color);
|
||||
EXTERN void nxgl_fillrectangle_4bpp(FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_rect_s *rect,
|
||||
ubyte color);
|
||||
nxgl_mxpixel_t color);
|
||||
EXTERN void nxgl_fillrectangle_8bpp(FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_rect_s *rect,
|
||||
ubyte color);
|
||||
nxgl_mxpixel_t color);
|
||||
EXTERN void nxgl_fillrectangle_16bpp(FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_rect_s *rect,
|
||||
uint16 color);
|
||||
nxgl_mxpixel_t color);
|
||||
EXTERN void nxgl_fillrectangle_24bpp(FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_rect_s *rect,
|
||||
uint32 color);
|
||||
nxgl_mxpixel_t color);
|
||||
EXTERN void nxgl_fillrectangle_32bpp(FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_rect_s *rect,
|
||||
uint32 color);
|
||||
nxgl_mxpixel_t color);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: nxglib_filltrapezoid_*bpp
|
||||
|
@ -189,31 +204,31 @@ EXTERN void nxgl_fillrectangle_32bpp(FAR struct fb_planeinfo_s *pinfo,
|
|||
EXTERN void nxglib_filltrapezoid_1bpp(FAR struct fb_videoinfo_s *vinfo,
|
||||
FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_trapezoid_s *trap,
|
||||
ubyte color);
|
||||
nxgl_mxpixel_t color);
|
||||
EXTERN void nxglib_filltrapezoid_2bpp(FAR struct fb_videoinfo_s *vinfo,
|
||||
FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_trapezoid_s *trap,
|
||||
ubyte color);
|
||||
nxgl_mxpixel_t color);
|
||||
EXTERN void nxglib_filltrapezoid_4bpp(FAR struct fb_videoinfo_s *vinfo,
|
||||
FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_trapezoid_s *trap,
|
||||
ubyte color);
|
||||
nxgl_mxpixel_t color);
|
||||
EXTERN void nxglib_filltrapezoid_8bpp(FAR struct fb_videoinfo_s *vinfo,
|
||||
FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_trapezoid_s *trap,
|
||||
ubyte color);
|
||||
nxgl_mxpixel_t color);
|
||||
EXTERN void nxglib_filltrapezoid_16bpp(FAR struct fb_videoinfo_s *vinfo,
|
||||
FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_trapezoid_s *trap,
|
||||
uint16 color);
|
||||
nxgl_mxpixel_t color);
|
||||
EXTERN void nxglib_filltrapezoid_24bpp(FAR struct fb_videoinfo_s *vinfo,
|
||||
FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_trapezoid_s *trap,
|
||||
uint32 color);
|
||||
nxgl_mxpixel_t color);
|
||||
EXTERN void nxglib_filltrapezoid_32bpp(FAR struct fb_videoinfo_s *vinfo,
|
||||
FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_trapezoid_s *trap,
|
||||
uint32 color);
|
||||
nxgl_mxpixel_t color);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: nxgl_moverectangle_*bpp
|
||||
|
@ -247,7 +262,7 @@ EXTERN void nxgl_moverectangle_32bpp(FAR struct fb_planeinfo_s *pinfo,
|
|||
FAR struct nxgl_point_s *offset);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: nxs_copyrectangle_*bpp
|
||||
* Name: nxgl_copyrectangle_*bpp
|
||||
*
|
||||
* Descripton:
|
||||
* Copy a rectangular bitmap image into the specific position in the
|
||||
|
@ -255,41 +270,41 @@ EXTERN void nxgl_moverectangle_32bpp(FAR struct fb_planeinfo_s *pinfo,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
EXTERN void nxs_copyrectangle_1bpp(FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_rect_s *dest,
|
||||
FAR const ubyte *src,
|
||||
FAR const struct nxgl_point_s *origin,
|
||||
unsigned int srcstride);
|
||||
EXTERN void nxs_copyrectangle_2bpp(FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_rect_s *dest,
|
||||
FAR const ubyte *src,
|
||||
FAR const struct nxgl_point_s *origin,
|
||||
unsigned int srcstride);
|
||||
EXTERN void nxs_copyrectangle_4bpp(FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_rect_s *dest,
|
||||
FAR const ubyte *src,
|
||||
FAR const struct nxgl_point_s *origin,
|
||||
unsigned int srcstride);
|
||||
EXTERN void nxs_copyrectangle_8bpp(FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_rect_s *dest,
|
||||
FAR const ubyte *src,
|
||||
FAR const struct nxgl_point_s *origin,
|
||||
unsigned int srcstride);
|
||||
EXTERN void nxs_copyrectangle_16bpp(FAR struct fb_planeinfo_s *pinfo,
|
||||
EXTERN void nxgl_copyrectangle_1bpp(FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_rect_s *dest,
|
||||
FAR const uint16 *src,
|
||||
FAR const void *src,
|
||||
FAR const struct nxgl_point_s *origin,
|
||||
unsigned int srcstride);
|
||||
EXTERN void nxs_copyrectangle_24bpp(FAR struct fb_planeinfo_s *pinfo,
|
||||
EXTERN void nxgl_copyrectangle_2bpp(FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_rect_s *dest,
|
||||
FAR const uint32 *src,
|
||||
FAR const void *src,
|
||||
FAR const struct nxgl_point_s *origin,
|
||||
unsigned int srcstride);
|
||||
EXTERN void nxs_copyrectangle_32bpp(FAR struct fb_planeinfo_s *pinfo,
|
||||
EXTERN void nxgl_copyrectangle_4bpp(FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_rect_s *dest,
|
||||
FAR const uint32 *src,
|
||||
FAR const void *src,
|
||||
FAR const struct nxgl_point_s *origin,
|
||||
unsigned int srcstride);
|
||||
EXTERN void nxgl_copyrectangle_8bpp(FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_rect_s *dest,
|
||||
FAR const void *src,
|
||||
FAR const struct nxgl_point_s *origin,
|
||||
unsigned int srcstride);
|
||||
EXTERN void nxgl_copyrectangle_16bpp(FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_rect_s *dest,
|
||||
FAR const void *src,
|
||||
FAR const struct nxgl_point_s *origin,
|
||||
unsigned int srcstride);
|
||||
EXTERN void nxgl_copyrectangle_24bpp(FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_rect_s *dest,
|
||||
FAR const void *src,
|
||||
FAR const struct nxgl_point_s *origin,
|
||||
unsigned int srcstride);
|
||||
EXTERN void nxgl_copyrectangle_32bpp(FAR struct fb_planeinfo_s *pinfo,
|
||||
FAR const struct nxgl_rect_s *dest,
|
||||
FAR const void *src,
|
||||
FAR const struct nxgl_point_s *origin,
|
||||
unsigned int srcstride);
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
|
|
Loading…
Reference in a new issue