summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-11-26 18:59:52 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-11-26 18:59:52 +0000
commit09b6c18505705e403b6d0f9236075d526b3071e5 (patch)
tree657960a7d9407f88d2d0435fd15c1d5fd33f79cb
parent5bd8df9d37f1ed4e504ff6b43545ba8300cd2de1 (diff)
downloadnuttx-09b6c18505705e403b6d0f9236075d526b3071e5.tar.gz
nuttx-09b6c18505705e403b6d0f9236075d526b3071e5.tar.bz2
nuttx-09b6c18505705e403b6d0f9236075d526b3071e5.zip
First rasterizer builds OK
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1313 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--nuttx/graphics/Makefile31
-rw-r--r--nuttx/graphics/nxglib/Make.defs9
-rw-r--r--nuttx/graphics/nxglib/Makefile.sources29
-rw-r--r--nuttx/graphics/nxglib/nxglib_bitblit.h13
-rw-r--r--nuttx/graphics/nxglib/nxglib_fillrectangle.c13
5 files changed, 70 insertions, 25 deletions
diff --git a/nuttx/graphics/Makefile b/nuttx/graphics/Makefile
index 6b39cd676..fc258d997 100644
--- a/nuttx/graphics/Makefile
+++ b/nuttx/graphics/Makefile
@@ -63,6 +63,31 @@ BIN = libgraphics$(LIBEXT)
VPATH = nxglib:nx
all: $(BIN)
+.PHONY : depend clean distclean gensources gen1bppsources gen2bppsource gen4bppsource \
+ gen8bppsource gen16bppsource gen24bppsource gen32bppsources
+
+gen1bppsources:
+ @make -C nxglib -f Makefile.sources TOPDIR=$(TOPDIR) NXGLIB_BITSPERPIXEL=1
+
+gen2bppsource:
+ @make -C nxglib -f Makefile.sources TOPDIR=$(TOPDIR) NXGLIB_BITSPERPIXEL=2
+
+gen4bppsource:
+ @make -C nxglib -f Makefile.sources TOPDIR=$(TOPDIR) NXGLIB_BITSPERPIXEL=4
+
+gen8bppsource:
+ @make -C nxglib -f Makefile.sources TOPDIR=$(TOPDIR) NXGLIB_BITSPERPIXEL=8
+
+gen16bppsource:
+ @make -C nxglib -f Makefile.sources TOPDIR=$(TOPDIR) NXGLIB_BITSPERPIXEL=16
+
+gen24bppsource:
+ @make -C nxglib -f Makefile.sources TOPDIR=$(TOPDIR) NXGLIB_BITSPERPIXEL=24
+
+gen32bppsources:
+ @make -C nxglib -f Makefile.sources TOPDIR=$(TOPDIR) NXGLIB_BITSPERPIXEL=32
+
+gensources: gen1bppsources gen2bppsource gen4bppsource gen8bppsource gen16bppsource gen24bppsource gen32bppsources
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
@@ -70,22 +95,24 @@ $(AOBJS): %$(OBJEXT): %.S
$(COBJS): %$(OBJEXT): %.c
$(call COMPILE, $<, $@)
-$(BIN): $(OBJS)
+$(BIN): gensources $(OBJS)
@( for obj in $(OBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \
done ; )
-.depend: Makefile $(SRCS)
+.depend: gensources Makefile $(SRCS)
@$(MKDEP) $(DEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@touch $@
depend: .depend
clean:
+ @make -C nxglib -f Makefile.sources clean TOPDIR=$(TOPDIR)
@rm -f $(BIN) *~ .*.swp
$(call CLEAN)
distclean: clean
+ @make -C nxglib -f Makefile.sources distclean TOPDIR=$(TOPDIR)
@rm -f Make.dep .depend
-include Make.dep
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 */