Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Aug 2014 09:22:03 +0000 (UTC)
From:      Jean-Sebastien Pedron <dumbbell@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r270446 - head/sys/dev/vt
Message-ID:  <201408240922.s7O9M3I0093019@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dumbbell
Date: Sun Aug 24 09:22:03 2014
New Revision: 270446
URL: http://svnweb.freebsd.org/changeset/base/270446

Log:
  vt(4): Remove vd_bitbltchr_t
  
  It's replaced by vd_bitblt_text_t, which gives more context to the
  backend and allows it to perform more efficiently when redrawing a given
  area.
  
  MFC after:	1 week

Modified:
  head/sys/dev/vt/vt.h
  head/sys/dev/vt/vt_core.c

Modified: head/sys/dev/vt/vt.h
==============================================================================
--- head/sys/dev/vt/vt.h	Sun Aug 24 09:20:30 2014	(r270445)
+++ head/sys/dev/vt/vt.h	Sun Aug 24 09:22:03 2014	(r270446)
@@ -294,15 +294,6 @@ typedef int vd_init_t(struct vt_device *
 typedef int vd_probe_t(struct vt_device *vd);
 typedef void vd_postswitch_t(struct vt_device *vd);
 typedef void vd_blank_t(struct vt_device *vd, term_color_t color);
-/*
- * FIXME: Remove vd_bitblt_t and vd_putchar_t, once vd_bitblt_text_t is
- * provided by all drivers.
- */
-typedef void vd_bitbltchr_t(struct vt_device *vd, const uint8_t *src,
-    const uint8_t *mask, int bpl, vt_axis_t top, vt_axis_t left,
-    unsigned int width, unsigned int height, term_color_t fg, term_color_t bg);
-typedef void vd_putchar_t(struct vt_device *vd, term_char_t,
-    vt_axis_t top, vt_axis_t left, term_color_t fg, term_color_t bg);
 typedef void vd_bitblt_text_t(struct vt_device *vd, const struct vt_window *vw,
     const term_rect_t *area);
 typedef void vd_bitblt_bmp_t(struct vt_device *vd, const struct vt_window *vw,
@@ -324,7 +315,6 @@ struct vt_driver {
 
 	/* Drawing. */
 	vd_blank_t	*vd_blank;
-	vd_bitbltchr_t	*vd_bitbltchr; /* FIXME: Deprecated. */
 	vd_drawrect_t	*vd_drawrect;
 	vd_setpixel_t	*vd_setpixel;
 	vd_bitblt_text_t *vd_bitblt_text;
@@ -336,9 +326,6 @@ struct vt_driver {
 	/* Framebuffer mmap, if present. */
 	vd_fb_mmap_t	*vd_fb_mmap;
 
-	/* Text mode operation. */
-	vd_putchar_t	*vd_putchar; /* FIXME: Deprecated. */
-
 	/* Update display setting on vt switch. */
 	vd_postswitch_t	*vd_postswitch;
 

Modified: head/sys/dev/vt/vt_core.c
==============================================================================
--- head/sys/dev/vt/vt_core.c	Sun Aug 24 09:20:30 2014	(r270445)
+++ head/sys/dev/vt/vt_core.c	Sun Aug 24 09:22:03 2014	(r270446)
@@ -888,47 +888,15 @@ vt_mark_mouse_position_as_dirty(struct v
 #endif
 
 static void
-vt_bitblt_char(struct vt_device *vd, struct vt_font *vf, term_char_t c,
-    int iscursor, unsigned int row, unsigned int col)
-{
-	term_color_t fg, bg;
-
-	vt_determine_colors(c, iscursor, &fg, &bg);
-
-	if (vf != NULL) {
-		const uint8_t *src;
-		vt_axis_t top, left;
-
-		src = vtfont_lookup(vf, c);
-
-		/*
-		 * Align the terminal to the centre of the screen.
-		 * Fonts may not always be able to fill the entire
-		 * screen.
-		 */
-		top = row * vf->vf_height + vd->vd_curwindow->vw_offset.tp_row;
-		left = col * vf->vf_width + vd->vd_curwindow->vw_offset.tp_col;
-
-		vd->vd_driver->vd_bitbltchr(vd, src, NULL, 0, top, left,
-		    vf->vf_width, vf->vf_height, fg, bg);
-	} else {
-		vd->vd_driver->vd_putchar(vd, TCHAR_CHARACTER(c),
-		    row, col, fg, bg);
-	}
-}
-
-static void
 vt_flush(struct vt_device *vd)
 {
 	struct vt_window *vw;
 	struct vt_font *vf;
 	struct vt_bufmask tmask;
-	unsigned int row, col;
 	term_rect_t tarea;
 	term_pos_t size;
-	term_char_t *r;
 #ifndef SC_NO_CUTPASTE
-	int cursor_was_shown, cursor_moved, bpl, h, w;
+	int cursor_was_shown, cursor_moved;
 #endif
 
 	vw = vd->vd_curwindow;
@@ -992,50 +960,8 @@ vt_flush(struct vt_device *vd)
 		vd->vd_flags &= ~VDF_INVALID;
 	}
 
-	if (vd->vd_driver->vd_bitblt_text != NULL) {
-		if (tarea.tr_begin.tp_col < tarea.tr_end.tp_col) {
-			vd->vd_driver->vd_bitblt_text(vd, vw, &tarea);
-		}
-	} else {
-		/*
-		 * FIXME: Once all backend drivers expose the
-		 * vd_bitblt_text_t callback, this code can be removed.
-		 */
-		for (row = tarea.tr_begin.tp_row; row < tarea.tr_end.tp_row; row++) {
-			if (!VTBUF_DIRTYROW(&tmask, row))
-				continue;
-			r = VTBUF_GET_ROW(&vw->vw_buf, row);
-			for (col = tarea.tr_begin.tp_col;
-			    col < tarea.tr_end.tp_col; col++) {
-				if (!VTBUF_DIRTYCOL(&tmask, col))
-					continue;
-
-				vt_bitblt_char(vd, vf, r[col],
-				    VTBUF_ISCURSOR(&vw->vw_buf, row, col), row, col);
-			}
-		}
-
-#ifndef SC_NO_CUTPASTE
-		if (vd->vd_mshown) {
-			/* Bytes per source line. */
-			bpl = (vd->vd_mcursor->width + 7) >> 3;
-			w = vd->vd_mcursor->width;
-			h = vd->vd_mcursor->height;
-
-			if ((vd->vd_mx + vd->vd_mcursor->width) >
-			    (size.tp_col * vf->vf_width))
-				w = (size.tp_col * vf->vf_width) - vd->vd_mx - 1;
-			if ((vd->vd_my + vd->vd_mcursor->height) >
-			    (size.tp_row * vf->vf_height))
-				h = (size.tp_row * vf->vf_height) - vd->vd_my - 1;
-
-			vd->vd_driver->vd_bitbltchr(vd,
-			    vd->vd_mcursor->map, vd->vd_mcursor->mask, bpl,
-			    vw->vw_offset.tp_row + vd->vd_my,
-			    vw->vw_offset.tp_col + vd->vd_mx,
-			    w, h, vd->vd_mcursor_fg, vd->vd_mcursor_bg);
-		}
-#endif
+	if (tarea.tr_begin.tp_col < tarea.tr_end.tp_col) {
+		vd->vd_driver->vd_bitblt_text(vd, vw, &tarea);
 	}
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408240922.s7O9M3I0093019>