From owner-svn-src-head@freebsd.org Mon May 15 23:12:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DCFED6EF36; Mon, 15 May 2017 23:12:06 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DED7765B; Mon, 15 May 2017 23:12:05 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4FNC4DS084210; Mon, 15 May 2017 23:12:04 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4FNC4EQ084209; Mon, 15 May 2017 23:12:04 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201705152312.v4FNC4EQ084209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Mon, 15 May 2017 23:12:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318326 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 May 2017 23:12:06 -0000 Author: jkim Date: Mon May 15 23:12:04 2017 New Revision: 318326 URL: https://svnweb.freebsd.org/changeset/base/318326 Log: - Revert r317171. [1] - Fix overlapping corners and fix an off-by-one bug. MFC after: 3 days Requested by: emaste [1] Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Mon May 15 22:52:25 2017 (r318325) +++ head/sys/dev/vt/vt_core.c Mon May 15 23:12:04 2017 (r318326) @@ -1150,30 +1150,33 @@ vt_mark_mouse_position_as_dirty(struct v #endif static void -vt_set_border(struct vt_device *vd, term_color_t c) +vt_set_border(struct vt_device *vd, const term_rect_t *area, + const term_color_t c) { - term_rect_t *tarea = &vd->vd_curwindow->vw_draw_area; - int x, y; + vd_drawrect_t *drawrect = vd->vd_driver->vd_drawrect; - /* Top bar. */ - for (y = 0; y < tarea->tr_begin.tp_row; y++) - for (x = 0; x < vd->vd_width; x++) - vd->vd_driver->vd_setpixel(vd, x, y, c); - - for (y = tarea->tr_begin.tp_row; y < tarea->tr_end.tp_row; y++) { - /* Left bar. */ - for (x = 0; x < tarea->tr_begin.tp_col; x++) - vd->vd_driver->vd_setpixel(vd, x, y, c); - - /* Right bar. */ - for (x = tarea->tr_end.tp_col; x < vd->vd_width; x++) - vd->vd_driver->vd_setpixel(vd, x, y, c); - } - - /* Bottom bar. */ - for (y = tarea->tr_end.tp_row; y < vd->vd_height; y++) - for (x = 0; x < vd->vd_width; x++) - vd->vd_driver->vd_setpixel(vd, x, y, c); + if (drawrect == NULL) + return; + + /* Top bar */ + if (area->tr_begin.tp_row > 0) + drawrect(vd, 0, 0, vd->vd_width - 1, + area->tr_begin.tp_row - 1, 1, c); + + /* Left bar */ + if (area->tr_begin.tp_col > 0) + drawrect(vd, 0, area->tr_begin.tp_row, + area->tr_begin.tp_col - 1, area->tr_end.tp_row - 1, 1, c); + + /* Right bar */ + if (area->tr_end.tp_col < vd->vd_width) + drawrect(vd, area->tr_end.tp_col, area->tr_begin.tp_row, + vd->vd_width - 1, area->tr_end.tp_row - 1, 1, c); + + /* Bottom bar */ + if (area->tr_end.tp_row < vd->vd_height) + drawrect(vd, 0, area->tr_end.tp_row, vd->vd_width - 1, + vd->vd_height - 1, 1, c); } static int @@ -1241,7 +1244,7 @@ vt_flush(struct vt_device *vd) if (vd->vd_flags & VDF_INVALID) { vd->vd_flags &= ~VDF_INVALID; - vt_set_border(vd, TC_BLACK); + vt_set_border(vd, &vw->vw_draw_area, TC_BLACK); vt_termrect(vd, vf, &tarea); if (vt_draw_logo_cpus) vtterm_draw_cpu_logos(vd);