vt(4): Remove vt_buf->vb_dirtymask
This structure and the associated functions were unused since the implementation of vd_bitblt_text_t callbacks. MFC after: 3 days
This commit is contained in:
parent
f2cafe032f
commit
2e7b781164
@ -172,11 +172,6 @@ struct vt_device {
|
||||
* been modified.
|
||||
*/
|
||||
|
||||
struct vt_bufmask {
|
||||
uint64_t vbm_row, vbm_col;
|
||||
#define VBM_DIRTY UINT64_MAX
|
||||
};
|
||||
|
||||
struct vt_buf {
|
||||
struct mtx vb_lock; /* Buffer lock. */
|
||||
term_pos_t vb_scr_size; /* (b) Screen dimensions. */
|
||||
@ -195,7 +190,6 @@ struct vt_buf {
|
||||
term_pos_t vb_mark_end; /* (b) Copy region end. */
|
||||
int vb_mark_last; /* Last mouse event. */
|
||||
term_rect_t vb_dirtyrect; /* (b) Dirty rectangle. */
|
||||
struct vt_bufmask vb_dirtymask; /* (b) Dirty bitmasks. */
|
||||
term_char_t *vb_buffer; /* (u) Data buffer. */
|
||||
term_char_t **vb_rows; /* (u) Array of rows */
|
||||
};
|
||||
@ -209,7 +203,7 @@ void vtbuf_putchar(struct vt_buf *, const term_pos_t *, term_char_t);
|
||||
void vtbuf_cursor_position(struct vt_buf *, const term_pos_t *);
|
||||
void vtbuf_scroll_mode(struct vt_buf *vb, int yes);
|
||||
void vtbuf_dirty(struct vt_buf *vb, const term_rect_t *area);
|
||||
void vtbuf_undirty(struct vt_buf *, term_rect_t *, struct vt_bufmask *);
|
||||
void vtbuf_undirty(struct vt_buf *, term_rect_t *);
|
||||
void vtbuf_sethistory_size(struct vt_buf *, int);
|
||||
int vtbuf_iscursor(const struct vt_buf *vb, int row, int col);
|
||||
void vtbuf_cursor_visibility(struct vt_buf *, int);
|
||||
|
@ -195,39 +195,6 @@ vtbuf_iscursor(const struct vt_buf *vb, int row, int col)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static inline uint64_t
|
||||
vtbuf_dirty_axis(unsigned int begin, unsigned int end)
|
||||
{
|
||||
uint64_t left, right, mask;
|
||||
|
||||
/*
|
||||
* Mark all bits between begin % 64 and end % 64 dirty.
|
||||
* This code is functionally equivalent to:
|
||||
*
|
||||
* for (i = begin; i < end; i++)
|
||||
* mask |= (uint64_t)1 << (i % 64);
|
||||
*/
|
||||
|
||||
/* Obvious case. Mark everything dirty. */
|
||||
if (end - begin >= 64)
|
||||
return (VBM_DIRTY);
|
||||
|
||||
/* 1....0; used bits on the left. */
|
||||
left = VBM_DIRTY << begin % 64;
|
||||
/* 0....1; used bits on the right. */
|
||||
right = VBM_DIRTY >> -end % 64;
|
||||
|
||||
/*
|
||||
* Only take the intersection. If the result of that is 0, it
|
||||
* means that the selection crossed a 64 bit boundary along the
|
||||
* way, which means we have to take the complement.
|
||||
*/
|
||||
mask = left & right;
|
||||
if (mask == 0)
|
||||
mask = left | right;
|
||||
return (mask);
|
||||
}
|
||||
|
||||
static inline void
|
||||
vtbuf_dirty_locked(struct vt_buf *vb, const term_rect_t *area)
|
||||
{
|
||||
@ -240,10 +207,6 @@ vtbuf_dirty_locked(struct vt_buf *vb, const term_rect_t *area)
|
||||
vb->vb_dirtyrect.tr_end.tp_row = area->tr_end.tp_row;
|
||||
if (vb->vb_dirtyrect.tr_end.tp_col < area->tr_end.tp_col)
|
||||
vb->vb_dirtyrect.tr_end.tp_col = area->tr_end.tp_col;
|
||||
vb->vb_dirtymask.vbm_row |=
|
||||
vtbuf_dirty_axis(area->tr_begin.tp_row, area->tr_end.tp_row);
|
||||
vb->vb_dirtymask.vbm_col |=
|
||||
vtbuf_dirty_axis(area->tr_begin.tp_col, area->tr_end.tp_col);
|
||||
}
|
||||
|
||||
void
|
||||
@ -272,16 +235,14 @@ vtbuf_make_undirty(struct vt_buf *vb)
|
||||
|
||||
vb->vb_dirtyrect.tr_begin = vb->vb_scr_size;
|
||||
vb->vb_dirtyrect.tr_end.tp_row = vb->vb_dirtyrect.tr_end.tp_col = 0;
|
||||
vb->vb_dirtymask.vbm_row = vb->vb_dirtymask.vbm_col = 0;
|
||||
}
|
||||
|
||||
void
|
||||
vtbuf_undirty(struct vt_buf *vb, term_rect_t *r, struct vt_bufmask *m)
|
||||
vtbuf_undirty(struct vt_buf *vb, term_rect_t *r)
|
||||
{
|
||||
|
||||
VTBUF_LOCK(vb);
|
||||
*r = vb->vb_dirtyrect;
|
||||
*m = vb->vb_dirtymask;
|
||||
vtbuf_make_undirty(vb);
|
||||
VTBUF_UNLOCK(vb);
|
||||
}
|
||||
|
@ -992,7 +992,6 @@ vt_flush(struct vt_device *vd)
|
||||
{
|
||||
struct vt_window *vw;
|
||||
struct vt_font *vf;
|
||||
struct vt_bufmask tmask;
|
||||
term_rect_t tarea;
|
||||
term_pos_t size;
|
||||
#ifndef SC_NO_CUTPASTE
|
||||
@ -1048,14 +1047,13 @@ vt_flush(struct vt_device *vd)
|
||||
vt_mark_mouse_position_as_dirty(vd);
|
||||
#endif
|
||||
|
||||
vtbuf_undirty(&vw->vw_buf, &tarea, &tmask);
|
||||
vtbuf_undirty(&vw->vw_buf, &tarea);
|
||||
vt_termsize(vd, vf, &size);
|
||||
|
||||
/* Force a full redraw when the screen contents are invalid. */
|
||||
if (vd->vd_flags & VDF_INVALID) {
|
||||
tarea.tr_begin.tp_row = tarea.tr_begin.tp_col = 0;
|
||||
tarea.tr_end = size;
|
||||
tmask.vbm_row = tmask.vbm_col = VBM_DIRTY;
|
||||
|
||||
vd->vd_flags &= ~VDF_INVALID;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user