diff options
Diffstat (limited to 'nuttx/graphics/nxglib')
-rw-r--r-- | nuttx/graphics/nxglib/Make.defs | 9 | ||||
-rw-r--r-- | nuttx/graphics/nxglib/Makefile.sources | 29 | ||||
-rw-r--r-- | nuttx/graphics/nxglib/nxglib_bitblit.h | 13 | ||||
-rw-r--r-- | nuttx/graphics/nxglib/nxglib_fillrectangle.c | 13 |
4 files changed, 41 insertions, 23 deletions
diff --git a/nuttx/graphics/nxglib/Make.defs b/nuttx/graphics/nxglib/Make.defs index 274e1a1ac..bf7c2bef8 100644 --- a/nuttx/graphics/nxglib/Make.defs +++ b/nuttx/graphics/nxglib/Make.defs @@ -33,6 +33,11 @@ # ############################################################################ -NXGLIB_ASRCS = -NXGLIB_CSRCS = nxglib_rgb2yuv.c nxglib_yuv2rgb.c +NXGLIB_ASRCS = + +#FILL_CSRCS1 = nxglib_fillrectangle_1bpp.c nxglib_fillrectangle_2bpp.c \ +# nxglib_fillrectangle_4bpp.c +FILL_CSRCS2 = nxglib_fillrectangle_8bpp.c nxglib_fillrectangle_16bpp.c \ + nxglib_fillrectangle_24bpp.c nxglib_fillrectangle_32bpp.c +NXGLIB_CSRCS = nxglib_rgb2yuv.c nxglib_yuv2rgb.c $(FILL_CSRCS1) $(FILL_CSRCS2) diff --git a/nuttx/graphics/nxglib/Makefile.sources b/nuttx/graphics/nxglib/Makefile.sources index a624488cc..2d38547a2 100644 --- a/nuttx/graphics/nxglib/Makefile.sources +++ b/nuttx/graphics/nxglib/Makefile.sources @@ -51,24 +51,35 @@ endif ifeq ($(NXGLIB_BITSPERPIXEL),16) NXGLIB_SUFFIX := _16bpp endif -ifeq ($(NXGLIB_BITSPERPIXEL),2) -NXGLIB_SUFFIX := _32bpp +ifeq ($(NXGLIB_BITSPERPIXEL),24) +NXGLIB_SUFFIX := _24bpp endif -ifeq ($(NXGLIB_BITSPERPIXEL),2) -NXGLIB_SUFFIX := _64bpp +ifeq ($(NXGLIB_BITSPERPIXEL),32) +NXGLIB_SUFFIX := _32bpp endif CPPFLAGS += -DNXGLIB_BITSPERPIXEL=$(NXGLIB_BITSPERPIXEL) CPPFLAGS += -DNXGLIB_SUFFIX=$(NXGLIB_SUFFIX) -FILL_CSRC = nxglib_fillrectangle$(NXGLIB_SUFFIX).c -GEN_CSRCS = $(FILL_CSRC) +FILL1_CSRCS = nxglib_fillrectangle_1bpp.c nxglib_fillrectangle_2bpp.c \ + nxglib_fillrectangle_4bpp.c +FILL2_CSRCS = nxglib_fillrectangle_8bpp.c nxglib_fillrectangle_16bpp.c \ + nxglib_fillrectangle_24bpp.c nxglib_fillrectangle_32bpp.c + +GEN_CSRCS = $(FILL1_CSRCS) $(FILL2_CSRCS) all: $(GEN_CSRCS) -.PHONY : clean distclean $(GEN_CSRCS) +.PHONY : clean distclean + +$(FILL1_CSRCS) : nxglib_fillrectangle.c nxglib_bitblit.h +ifneq ($(NXGLIB_BITSPERPIXEL),) + $(call PREPROCESS, nxglib_fillrectangle.c, $@) +endif -$(FILL_CSRC) : nxglib_fillrectangle.c nxglib_bitblit.h - $(call PREPROCESS, $<, $@) +$(FILL2_CSRCS) : nxglib_fillrectangle.c nxglib_bitblit.h +ifneq ($(NXGLIB_BITSPERPIXEL),) + $(call PREPROCESS, nxglib_fillrectangle.c, $@) +endif clean: @rm -f *~ .*.swp diff --git a/nuttx/graphics/nxglib/nxglib_bitblit.h b/nuttx/graphics/nxglib/nxglib_bitblit.h index 6ebb97c2b..b327204bd 100644 --- a/nuttx/graphics/nxglib/nxglib_bitblit.h +++ b/nuttx/graphics/nxglib/nxglib_bitblit.h @@ -122,8 +122,8 @@ # define NXGL_MEMSET(dest,value,width) \ { \ - FAR uybte *_ptr = (FAR ubyte*)dest; \ - int nbytes = NX_SCALEX(width)); \ + FAR ubyte *_ptr = (FAR ubyte*)dest; \ + int nbytes = NX_SCALEX(width); \ while (nbytes--) \ { \ *_ptr++ = value; \ @@ -133,7 +133,7 @@ { \ FAR ubyte *_dptr = (FAR ubyte*)dest; \ FAR ubyte *_sptr = (FAR ubyte*)src; \ - int nbytes = NX_SCALEX(width)); \ + int nbytes = NX_SCALEX(width); \ while (npixels--) \ { \ *_dptr++ = *_sptr++; \ @@ -143,7 +143,7 @@ #elif NXGLIB_BITSPERPIXEL == 24 # define NXGL_MEMSET(dest,value,width) \ { \ - FAR uybte *_ptr = (FAR ubyte*)dest; \ + FAR ubyte *_ptr = (FAR ubyte*)dest; \ while (width--) \ { \ *_ptr++ = value; \ @@ -182,6 +182,11 @@ } #endif +/* Form a function name by concatenating two strings */ + +#define _NXGL_FUNCNAME(a,b) a ## b +#define NXGL_FUNCNAME(a,b) _NXGL_FUNCNAME(a,b) + /**************************************************************************** * Public Types ****************************************************************************/ diff --git a/nuttx/graphics/nxglib/nxglib_fillrectangle.c b/nuttx/graphics/nxglib/nxglib_fillrectangle.c index d8550dd7e..3da969c4a 100644 --- a/nuttx/graphics/nxglib/nxglib_fillrectangle.c +++ b/nuttx/graphics/nxglib/nxglib_fillrectangle.c @@ -81,11 +81,8 @@ * ****************************************************************************/ -void nxgl_fillrectangle##NXGLIB_SUFFIX -( - FAR struct fb_planeinfo_s *pinfo, - FAR const struct nxgl_rect_s *rect, NX_PIXEL_T color -) +void NXGL_FUNCNAME(nxgl_fillrectangle,NXGLIB_SUFFIX) +(FAR struct fb_planeinfo_s *pinfo, FAR const struct nxgl_rect_s *rect, NX_PIXEL_T color) { ubyte *line; unsigned int width; @@ -98,12 +95,12 @@ void nxgl_fillrectangle##NXGLIB_SUFFIX /* Get the dimensions of the rectange to fill in pixels */ - width = rect.pt2.x - rect.pt1.x; - rows = rect.pt2.y - rect.pt1.y; + width = rect->pt2.x - rect->pt1.x; + rows = rect->pt2.y - rect->pt1.y; /* Get the address of the first byte in the first line to write */ - line = pinfo->fbmem + rect.pt1.y * stride + NX_SCALEX(rect.pt1.x); + line = pinfo->fbmem + rect->pt1.y * stride + NX_SCALEX(rect->pt1.x); /* Then fill the rectangle line-by-line */ |