PERFORCE change 213951 for review
Brooks Davis
brooks at FreeBSD.org
Thu Jul 5 23:23:29 UTC 2012
http://p4web.freebsd.org/@@213951?ac=10
Change 213951 by brooks at brooks_ecr_current on 2012/07/05 23:23:23
Implement text rendering using fonts from syscons. Font file parsing
code is from vidcontol.
Also implement a fb_post_region() function to update rectangular
regions of the framebuffer.
Affected files ...
.. //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/Makefile#3 edit
.. //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/de4tc.c#3 edit
.. //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/de4tc.h#3 edit
.. //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/syscons-fonts.c#1 add
Differences ...
==== //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/Makefile#3 (text+ko) ====
@@ -5,12 +5,15 @@
LIB= de4tc
SHLIB_MAJOR= 1
-SRCS= de4tc.c
+SRCS= de4tc.c syscons-fonts.c
INCS= de4tc.h
+.PATH: ${.CURDIR}/../../usr.sbin/vidcontrol
+CFLAGS+=-I${.CURDIR}/../../usr.sbin/vidcontrol
+SRCS+= decode.c
+
CFLAGS+= -I${.CURDIR}/../libvuln_png/
-#LDADD+= -L../libvuln_png/ -lvuln_png -lz -lm
#WARNS?= 0
==== //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/de4tc.c#3 (text+ko) ====
@@ -52,7 +52,7 @@
static int dispfd;
static int textfd;
static int fademode=0;
-static volatile u_int32_t *pfbp;
+volatile u_int32_t *pfbp;
static volatile u_int16_t *tfbp;
static volatile u_int32_t *mtlctrl;
@@ -62,6 +62,9 @@
// number of lines in the line pattern
static const int num_lines_pattern = 600;
+const int fb_height = 480;
+const int fb_width = 800;
+
/*****************************************************************************
* hack around endian issue
@@ -217,6 +220,17 @@
void
+fb_post_region(u_int32_t *buf, int x, int y, int w, int h)
+{
+ int col, row;
+
+ for (row = 0; row < h; row++)
+ for (col = 0; col < w; col++)
+ pfbp[(y + row) * fb_width + (x + col)] = buf[row * w + col];
+}
+
+
+void
fb_blend(int blend_text_bg, int blend_text_fg, int blend_pixel, int wash __unused)
{
mtlctrl[0] =
==== //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/de4tc.h#3 (text+ko) ====
@@ -1,5 +1,6 @@
/*-
* Copyright (c) 2012 Simon W. Moore
+ * Copyright (c) 2012 SRI International
* All rights reserved.
*
* This software was developed by SRI International and the University of
@@ -38,8 +39,8 @@
extern int touch_gesture;
extern int touch_count;
-const int fb_height = 480;
-const int fb_width = 800;
+extern const int fb_height;
+extern const int fb_width;
void multitouch_pole(void);
void multitouch_filter(void);
@@ -50,6 +51,7 @@
void fb_putpixel(int px, int py, int colour);
void fb_fill(int col);
void fb_post(u_int32_t *buf);
+void fb_post_region(u_int32_t *buf, int x, int y, int w, int h);
void fb_blend(int blend_text_bg, int blend_text_fg, int blend_pixel, int wash);
void fb_text_cursor(int x, int y);
void fb_fade2off(void);
@@ -58,4 +60,10 @@
void plot_line(int x1, int y1, int x2, int y2, unsigned int colour);
void read_png_file(const char* file_name, u_int32_t* imgbuf, int maxwidth, int maxheight);
+void fb_load_syscons_font(const char *type, const char *filename);
+int fb_get_font_height(void);
+int fb_get_font_width(void);
+void fb_render_text(const char *string, int expand, u_int32_t con, u_int32_t coff,
+ u_int32_t *buffer, int w, int h);
+
#endif /* !_DE4TC_H_ */
More information about the p4-projects
mailing list