svn commit: r270324 - head/sys/dev/vt/hw/vga

Jean-Sebastien Pedron dumbbell at FreeBSD.org
Fri Aug 22 10:49:52 UTC 2014


Author: dumbbell
Date: Fri Aug 22 10:49:51 2014
New Revision: 270324
URL: http://svnweb.freebsd.org/changeset/base/270324

Log:
  vt_vga: Clip the draw area to never draw offscreen
  
  This fixes a bug when two windows use different fonts, but a longer-term
  solution is required. The dirty area should be stored as pixels, not
  character cells, because such coordinates don't have the same meaning in
  all windows, when using different fonts.
  
  MFC after:	1 week

Modified:
  head/sys/dev/vt/hw/vga/vt_vga.c

Modified: head/sys/dev/vt/hw/vga/vt_vga.c
==============================================================================
--- head/sys/dev/vt/hw/vga/vt_vga.c	Fri Aug 22 10:31:57 2014	(r270323)
+++ head/sys/dev/vt/hw/vga/vt_vga.c	Fri Aug 22 10:49:51 2014	(r270324)
@@ -741,6 +741,19 @@ vga_bitblt_text_gfxmode(struct vt_device
 	y2 = row * vf->vf_height + vd->vd_offset.tp_row;
 
 	/*
+	 * Clip the area to the screen size.
+	 *
+	 * FIXME: The problem with handling the dirty area in character
+	 * cells is that when using different fonts, the dirty area was
+	 * possibly calculated with a different font than the one we use
+	 * here, leading to out-of-screen coordinates. The dirty area
+	 * should be stored in pixels.
+	 */
+
+	x2 = min(x2, vd->vd_width - 1);
+	y2 = min(y2, vd->vd_height - 1);
+
+	/*
 	 * Now, we take care of N pixels line at a time (the first for
 	 * loop, N = font height), and for these lines, draw one pixels
 	 * block at a time (the second for loop), not a character at a


More information about the svn-src-head mailing list