Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/vt/vt_cpulogos.c
Show First 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | vtterm_draw_cpu_logos(struct vt_device *vd) | ||||
else { | else { | ||||
ncpu = mp_ncpus; | ncpu = mp_ncpus; | ||||
if (ncpu < 1) | if (ncpu < 1) | ||||
ncpu = 1; | ncpu = 1; | ||||
} | } | ||||
a = teken_get_curattr(&tm->tm_emulator); | a = teken_get_curattr(&tm->tm_emulator); | ||||
if (vd->vd_driver->vd_drawrect) | if (vd->vd_driver->vd_drawrect) | ||||
vd->vd_driver->vd_drawrect(vd, 0, 0, vd->vd_width, | vd->vd_driver->vd_drawrect(vd, 0, 0, vd->vd_width - 1, | ||||
vt_logo_sprite_height, 1, a->ta_bgcolor); | vt_logo_sprite_height - 1, 1, a->ta_bgcolor); | ||||
cem: We also want to subtract one from `vt_logo_sprite_height` as well, right?
But I am a little… | |||||
/* | /* | ||||
* Blank is okay because we only ever draw beasties on full screen | * Blank is okay because we only ever draw beasties on full screen | ||||
* refreshes. | * refreshes. | ||||
*/ | */ | ||||
else if (vd->vd_driver->vd_blank) | else if (vd->vd_driver->vd_blank) | ||||
vd->vd_driver->vd_blank(vd, a->ta_bgcolor); | vd->vd_driver->vd_blank(vd, a->ta_bgcolor); | ||||
ncpu = MIN(ncpu, vd->vd_width / vt_logo_sprite_width); | ncpu = MIN(ncpu, vd->vd_width / vt_logo_sprite_width); | ||||
▲ Show 20 Lines • Show All 125 Lines • Show Last 20 Lines |
We also want to subtract one from vt_logo_sprite_height as well, right?
But I am a little surprised we don't do any dimension validation in vd_drawrect implementations s.t. we get memory corruption.