creator_vt.c (270431) | creator_vt.c (270613) |
---|---|
1/*- 2 * Copyright (c) 2014 Nathan Whitehorn 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2014 Nathan Whitehorn 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/dev/fb/creator_vt.c 270431 2014-08-23 20:35:33Z dumbbell $"); | 28__FBSDID("$FreeBSD: head/sys/dev/fb/creator_vt.c 270613 2014-08-25 19:06:31Z dumbbell $"); |
29 30#include <sys/param.h> 31#include <sys/kernel.h> 32#include <sys/systm.h> 33#include <sys/fbio.h> 34 35#include <dev/vt/vt.h> 36#include <dev/vt/hw/fb/vt_fb.h> --- 194 unchanged lines hidden (view full) --- 231 term_color_t fg, bg; 232 const uint8_t *pattern; 233 234 vf = vw->vw_font; 235 236 for (row = area->tr_begin.tp_row; row < area->tr_end.tp_row; ++row) { 237 for (col = area->tr_begin.tp_col; col < area->tr_end.tp_col; 238 ++col) { | 29 30#include <sys/param.h> 31#include <sys/kernel.h> 32#include <sys/systm.h> 33#include <sys/fbio.h> 34 35#include <dev/vt/vt.h> 36#include <dev/vt/hw/fb/vt_fb.h> --- 194 unchanged lines hidden (view full) --- 231 term_color_t fg, bg; 232 const uint8_t *pattern; 233 234 vf = vw->vw_font; 235 236 for (row = area->tr_begin.tp_row; row < area->tr_end.tp_row; ++row) { 237 for (col = area->tr_begin.tp_col; col < area->tr_end.tp_col; 238 ++col) { |
239 x = col * vf->vf_width + vw->vw_offset.tp_col; 240 y = row * vf->vf_height + vw->vw_offset.tp_row; | 239 x = col * vf->vf_width + 240 vw->vw_draw_area.tr_begin.tp_col; 241 y = row * vf->vf_height + 242 vw->vw_draw_area.tr_begin.tp_row; |
241 242 c = VTBUF_GET_FIELD(&vw->vw_buf, row, col); 243 pattern = vtfont_lookup(vf, c); 244 vt_determine_colors(c, 245 VTBUF_ISCURSOR(&vw->vw_buf, row, col), &fg, &bg); 246 247 creatorfb_bitblt_bitmap(vd, vw, 248 pattern, NULL, vf->vf_width, vf->vf_height, 249 x, y, fg, bg); 250 } 251 } 252 253#ifndef SC_NO_CUTPASTE 254 if (!vd->vd_mshown) 255 return; 256 257 term_rect_t drawn_area; 258 259 drawn_area.tr_begin.tp_col = area->tr_begin.tp_col * vf->vf_width + | 243 244 c = VTBUF_GET_FIELD(&vw->vw_buf, row, col); 245 pattern = vtfont_lookup(vf, c); 246 vt_determine_colors(c, 247 VTBUF_ISCURSOR(&vw->vw_buf, row, col), &fg, &bg); 248 249 creatorfb_bitblt_bitmap(vd, vw, 250 pattern, NULL, vf->vf_width, vf->vf_height, 251 x, y, fg, bg); 252 } 253 } 254 255#ifndef SC_NO_CUTPASTE 256 if (!vd->vd_mshown) 257 return; 258 259 term_rect_t drawn_area; 260 261 drawn_area.tr_begin.tp_col = area->tr_begin.tp_col * vf->vf_width + |
260 vw->vw_offset.tp_col; | 262 vw->vw_draw_area.tr_begin.tp_col; |
261 drawn_area.tr_begin.tp_row = area->tr_begin.tp_row * vf->vf_height + | 263 drawn_area.tr_begin.tp_row = area->tr_begin.tp_row * vf->vf_height + |
262 vw->vw_offset.tp_row; | 264 vw->vw_draw_area.tr_begin.tp_row; |
263 drawn_area.tr_end.tp_col = area->tr_end.tp_col * vf->vf_width + | 265 drawn_area.tr_end.tp_col = area->tr_end.tp_col * vf->vf_width + |
264 vw->vw_offset.tp_col; | 266 vw->vw_draw_area.tr_begin.tp_col; |
265 drawn_area.tr_end.tp_row = area->tr_end.tp_row * vf->vf_height + | 267 drawn_area.tr_end.tp_row = area->tr_end.tp_row * vf->vf_height + |
266 vw->vw_offset.tp_row; | 268 vw->vw_draw_area.tr_begin.tp_row; |
267 268 if (vt_is_cursor_in_area(vd, &drawn_area)) { 269 creatorfb_bitblt_bitmap(vd, vw, 270 vd->vd_mcursor->map, vd->vd_mcursor->mask, 271 vd->vd_mcursor->width, vd->vd_mcursor->height, 272 vd->vd_mx_drawn, vd->vd_my_drawn, 273 vd->vd_mcursor_fg, vd->vd_mcursor_bg); 274 } 275#endif 276} | 269 270 if (vt_is_cursor_in_area(vd, &drawn_area)) { 271 creatorfb_bitblt_bitmap(vd, vw, 272 vd->vd_mcursor->map, vd->vd_mcursor->mask, 273 vd->vd_mcursor->width, vd->vd_mcursor->height, 274 vd->vd_mx_drawn, vd->vd_my_drawn, 275 vd->vd_mcursor_fg, vd->vd_mcursor_bg); 276 } 277#endif 278} |