First rasterizer builds OK
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1313 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
fac43407b1
commit
e77aa25163
@ -63,6 +63,31 @@ BIN = libgraphics$(LIBEXT)
|
|||||||
VPATH = nxglib:nx
|
VPATH = nxglib:nx
|
||||||
|
|
||||||
all: $(BIN)
|
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
|
$(AOBJS): %$(OBJEXT): %.S
|
||||||
$(call ASSEMBLE, $<, $@)
|
$(call ASSEMBLE, $<, $@)
|
||||||
@ -70,22 +95,24 @@ $(AOBJS): %$(OBJEXT): %.S
|
|||||||
$(COBJS): %$(OBJEXT): %.c
|
$(COBJS): %$(OBJEXT): %.c
|
||||||
$(call COMPILE, $<, $@)
|
$(call COMPILE, $<, $@)
|
||||||
|
|
||||||
$(BIN): $(OBJS)
|
$(BIN): gensources $(OBJS)
|
||||||
@( for obj in $(OBJS) ; do \
|
@( for obj in $(OBJS) ; do \
|
||||||
$(call ARCHIVE, $@, $${obj}); \
|
$(call ARCHIVE, $@, $${obj}); \
|
||||||
done ; )
|
done ; )
|
||||||
|
|
||||||
.depend: Makefile $(SRCS)
|
.depend: gensources Makefile $(SRCS)
|
||||||
@$(MKDEP) $(DEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
@$(MKDEP) $(DEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||||
@touch $@
|
@touch $@
|
||||||
|
|
||||||
depend: .depend
|
depend: .depend
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
@make -C nxglib -f Makefile.sources clean TOPDIR=$(TOPDIR)
|
||||||
@rm -f $(BIN) *~ .*.swp
|
@rm -f $(BIN) *~ .*.swp
|
||||||
$(call CLEAN)
|
$(call CLEAN)
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
|
@make -C nxglib -f Makefile.sources distclean TOPDIR=$(TOPDIR)
|
||||||
@rm -f Make.dep .depend
|
@rm -f Make.dep .depend
|
||||||
|
|
||||||
-include Make.dep
|
-include Make.dep
|
||||||
|
@ -33,6 +33,11 @@
|
|||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
NXGLIB_ASRCS =
|
NXGLIB_ASRCS =
|
||||||
NXGLIB_CSRCS = nxglib_rgb2yuv.c nxglib_yuv2rgb.c
|
|
||||||
|
#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)
|
||||||
|
|
||||||
|
@ -51,24 +51,35 @@ endif
|
|||||||
ifeq ($(NXGLIB_BITSPERPIXEL),16)
|
ifeq ($(NXGLIB_BITSPERPIXEL),16)
|
||||||
NXGLIB_SUFFIX := _16bpp
|
NXGLIB_SUFFIX := _16bpp
|
||||||
endif
|
endif
|
||||||
ifeq ($(NXGLIB_BITSPERPIXEL),2)
|
ifeq ($(NXGLIB_BITSPERPIXEL),24)
|
||||||
NXGLIB_SUFFIX := _32bpp
|
NXGLIB_SUFFIX := _24bpp
|
||||||
endif
|
endif
|
||||||
ifeq ($(NXGLIB_BITSPERPIXEL),2)
|
ifeq ($(NXGLIB_BITSPERPIXEL),32)
|
||||||
NXGLIB_SUFFIX := _64bpp
|
NXGLIB_SUFFIX := _32bpp
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CPPFLAGS += -DNXGLIB_BITSPERPIXEL=$(NXGLIB_BITSPERPIXEL)
|
CPPFLAGS += -DNXGLIB_BITSPERPIXEL=$(NXGLIB_BITSPERPIXEL)
|
||||||
CPPFLAGS += -DNXGLIB_SUFFIX=$(NXGLIB_SUFFIX)
|
CPPFLAGS += -DNXGLIB_SUFFIX=$(NXGLIB_SUFFIX)
|
||||||
|
|
||||||
FILL_CSRC = nxglib_fillrectangle$(NXGLIB_SUFFIX).c
|
FILL1_CSRCS = nxglib_fillrectangle_1bpp.c nxglib_fillrectangle_2bpp.c \
|
||||||
GEN_CSRCS = $(FILL_CSRC)
|
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)
|
all: $(GEN_CSRCS)
|
||||||
.PHONY : clean distclean $(GEN_CSRCS)
|
.PHONY : clean distclean
|
||||||
|
|
||||||
$(FILL_CSRC) : nxglib_fillrectangle.c nxglib_bitblit.h
|
$(FILL1_CSRCS) : nxglib_fillrectangle.c nxglib_bitblit.h
|
||||||
$(call PREPROCESS, $<, $@)
|
ifneq ($(NXGLIB_BITSPERPIXEL),)
|
||||||
|
$(call PREPROCESS, nxglib_fillrectangle.c, $@)
|
||||||
|
endif
|
||||||
|
|
||||||
|
$(FILL2_CSRCS) : nxglib_fillrectangle.c nxglib_bitblit.h
|
||||||
|
ifneq ($(NXGLIB_BITSPERPIXEL),)
|
||||||
|
$(call PREPROCESS, nxglib_fillrectangle.c, $@)
|
||||||
|
endif
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@rm -f *~ .*.swp
|
@rm -f *~ .*.swp
|
||||||
|
@ -122,8 +122,8 @@
|
|||||||
|
|
||||||
# define NXGL_MEMSET(dest,value,width) \
|
# define NXGL_MEMSET(dest,value,width) \
|
||||||
{ \
|
{ \
|
||||||
FAR uybte *_ptr = (FAR ubyte*)dest; \
|
FAR ubyte *_ptr = (FAR ubyte*)dest; \
|
||||||
int nbytes = NX_SCALEX(width)); \
|
int nbytes = NX_SCALEX(width); \
|
||||||
while (nbytes--) \
|
while (nbytes--) \
|
||||||
{ \
|
{ \
|
||||||
*_ptr++ = value; \
|
*_ptr++ = value; \
|
||||||
@ -133,7 +133,7 @@
|
|||||||
{ \
|
{ \
|
||||||
FAR ubyte *_dptr = (FAR ubyte*)dest; \
|
FAR ubyte *_dptr = (FAR ubyte*)dest; \
|
||||||
FAR ubyte *_sptr = (FAR ubyte*)src; \
|
FAR ubyte *_sptr = (FAR ubyte*)src; \
|
||||||
int nbytes = NX_SCALEX(width)); \
|
int nbytes = NX_SCALEX(width); \
|
||||||
while (npixels--) \
|
while (npixels--) \
|
||||||
{ \
|
{ \
|
||||||
*_dptr++ = *_sptr++; \
|
*_dptr++ = *_sptr++; \
|
||||||
@ -143,7 +143,7 @@
|
|||||||
#elif NXGLIB_BITSPERPIXEL == 24
|
#elif NXGLIB_BITSPERPIXEL == 24
|
||||||
# define NXGL_MEMSET(dest,value,width) \
|
# define NXGL_MEMSET(dest,value,width) \
|
||||||
{ \
|
{ \
|
||||||
FAR uybte *_ptr = (FAR ubyte*)dest; \
|
FAR ubyte *_ptr = (FAR ubyte*)dest; \
|
||||||
while (width--) \
|
while (width--) \
|
||||||
{ \
|
{ \
|
||||||
*_ptr++ = value; \
|
*_ptr++ = value; \
|
||||||
@ -182,6 +182,11 @@
|
|||||||
}
|
}
|
||||||
#endif
|
#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
|
* Public Types
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -81,11 +81,8 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void nxgl_fillrectangle##NXGLIB_SUFFIX
|
void NXGL_FUNCNAME(nxgl_fillrectangle,NXGLIB_SUFFIX)
|
||||||
(
|
(FAR struct fb_planeinfo_s *pinfo, FAR const struct nxgl_rect_s *rect, NX_PIXEL_T color)
|
||||||
FAR struct fb_planeinfo_s *pinfo,
|
|
||||||
FAR const struct nxgl_rect_s *rect, NX_PIXEL_T color
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ubyte *line;
|
ubyte *line;
|
||||||
unsigned int width;
|
unsigned int width;
|
||||||
@ -98,12 +95,12 @@ void nxgl_fillrectangle##NXGLIB_SUFFIX
|
|||||||
|
|
||||||
/* Get the dimensions of the rectange to fill in pixels */
|
/* Get the dimensions of the rectange to fill in pixels */
|
||||||
|
|
||||||
width = rect.pt2.x - rect.pt1.x;
|
width = rect->pt2.x - rect->pt1.x;
|
||||||
rows = rect.pt2.y - rect.pt1.y;
|
rows = rect->pt2.y - rect->pt1.y;
|
||||||
|
|
||||||
/* Get the address of the first byte in the first line to write */
|
/* 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 */
|
/* Then fill the rectangle line-by-line */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user