Deleted Added
full compact
ofwfb.c (270431) ofwfb.c (270613)
1/*-
2 * Copyright (c) 2011 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) 2011 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/vt/hw/ofwfb/ofwfb.c 270431 2014-08-23 20:35:33Z dumbbell $");
28__FBSDID("$FreeBSD: head/sys/dev/vt/hw/ofwfb/ofwfb.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>

--- 167 unchanged lines hidden (view full) ---

204 term_color_t fg, bg;
205 const uint8_t *pattern;
206
207 vf = vw->vw_font;
208
209 for (row = area->tr_begin.tp_row; row < area->tr_end.tp_row; ++row) {
210 for (col = area->tr_begin.tp_col; col < area->tr_end.tp_col;
211 ++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>

--- 167 unchanged lines hidden (view full) ---

204 term_color_t fg, bg;
205 const uint8_t *pattern;
206
207 vf = vw->vw_font;
208
209 for (row = area->tr_begin.tp_row; row < area->tr_end.tp_row; ++row) {
210 for (col = area->tr_begin.tp_col; col < area->tr_end.tp_col;
211 ++col) {
212 x = col * vf->vf_width + vw->vw_offset.tp_col;
213 y = row * vf->vf_height + vw->vw_offset.tp_row;
212 x = col * vf->vf_width +
213 vw->vw_draw_area.tr_begin.tp_col;
214 y = row * vf->vf_height +
215 vw->vw_draw_area.tr_begin.tp_row;
214
215 c = VTBUF_GET_FIELD(&vw->vw_buf, row, col);
216 pattern = vtfont_lookup(vf, c);
217 vt_determine_colors(c,
218 VTBUF_ISCURSOR(&vw->vw_buf, row, col), &fg, &bg);
219
220 ofwfb_bitblt_bitmap(vd, vw,
221 pattern, NULL, vf->vf_width, vf->vf_height,
222 x, y, fg, bg);
223 }
224 }
225
226#ifndef SC_NO_CUTPASTE
227 if (!vd->vd_mshown)
228 return;
229
230 term_rect_t drawn_area;
231
232 drawn_area.tr_begin.tp_col = area->tr_begin.tp_col * vf->vf_width +
216
217 c = VTBUF_GET_FIELD(&vw->vw_buf, row, col);
218 pattern = vtfont_lookup(vf, c);
219 vt_determine_colors(c,
220 VTBUF_ISCURSOR(&vw->vw_buf, row, col), &fg, &bg);
221
222 ofwfb_bitblt_bitmap(vd, vw,
223 pattern, NULL, vf->vf_width, vf->vf_height,
224 x, y, fg, bg);
225 }
226 }
227
228#ifndef SC_NO_CUTPASTE
229 if (!vd->vd_mshown)
230 return;
231
232 term_rect_t drawn_area;
233
234 drawn_area.tr_begin.tp_col = area->tr_begin.tp_col * vf->vf_width +
233 vw->vw_offset.tp_col;
235 vw->vw_draw_area.tr_begin.tp_col;
234 drawn_area.tr_begin.tp_row = area->tr_begin.tp_row * vf->vf_height +
236 drawn_area.tr_begin.tp_row = area->tr_begin.tp_row * vf->vf_height +
235 vw->vw_offset.tp_row;
237 vw->vw_draw_area.tr_begin.tp_row;
236 drawn_area.tr_end.tp_col = area->tr_end.tp_col * vf->vf_width +
238 drawn_area.tr_end.tp_col = area->tr_end.tp_col * vf->vf_width +
237 vw->vw_offset.tp_col;
239 vw->vw_draw_area.tr_begin.tp_col;
238 drawn_area.tr_end.tp_row = area->tr_end.tp_row * vf->vf_height +
240 drawn_area.tr_end.tp_row = area->tr_end.tp_row * vf->vf_height +
239 vw->vw_offset.tp_row;
241 vw->vw_draw_area.tr_begin.tp_row;
240
241 if (vt_is_cursor_in_area(vd, &drawn_area)) {
242 ofwfb_bitblt_bitmap(vd, vw,
243 vd->vd_mcursor->map, vd->vd_mcursor->mask,
244 vd->vd_mcursor->width, vd->vd_mcursor->height,
245 vd->vd_mx_drawn, vd->vd_my_drawn,
246 vd->vd_mcursor_fg, vd->vd_mcursor_bg);
247 }

--- 213 unchanged lines hidden ---
242
243 if (vt_is_cursor_in_area(vd, &drawn_area)) {
244 ofwfb_bitblt_bitmap(vd, vw,
245 vd->vd_mcursor->map, vd->vd_mcursor->mask,
246 vd->vd_mcursor->width, vd->vd_mcursor->height,
247 vd->vd_mx_drawn, vd->vd_my_drawn,
248 vd->vd_mcursor_fg, vd->vd_mcursor_bg);
249 }

--- 213 unchanged lines hidden ---