Lines Matching refs:vf

84 vtfont_lookup(const struct vt_font *vf, term_char_t c)  in vtfont_lookup()  argument
102 dst = vtfont_bisearch(vf->vf_map[bold_map], in vtfont_lookup()
103 vf->vf_map_count[bold_map], src); in vtfont_lookup()
107 dst = vtfont_bisearch(vf->vf_map[normal_map], in vtfont_lookup()
108 vf->vf_map_count[normal_map], src); in vtfont_lookup()
111 stride = howmany(vf->vf_width, 8) * vf->vf_height; in vtfont_lookup()
112 return (&vf->vf_bytes[dst * stride]); in vtfont_lookup()
116 vtfont_ref(struct vt_font *vf) in vtfont_ref() argument
119 refcount_acquire(&vf->vf_refcount); in vtfont_ref()
120 return (vf); in vtfont_ref()
124 vtfont_unref(struct vt_font *vf) in vtfont_unref() argument
128 if (refcount_release(&vf->vf_refcount)) { in vtfont_unref()
130 free(vf->vf_map[i], M_VTFONT); in vtfont_unref()
131 free(vf->vf_bytes, M_VTFONT); in vtfont_unref()
132 free(vf, M_VTFONT); in vtfont_unref()
162 struct vt_font *vf; in vtfont_load() local
187 vf = malloc(sizeof *vf, M_VTFONT, M_WAITOK | M_ZERO); in vtfont_load()
188 vf->vf_bytes = malloc(glyphsize, M_VTFONT, M_WAITOK); in vtfont_load()
189 vf->vf_height = f->height; in vtfont_load()
190 vf->vf_width = f->width; in vtfont_load()
191 vf->vf_refcount = 1; in vtfont_load()
195 vf->vf_map_count[i] = f->map_count[i]; in vtfont_load()
199 vf->vf_map[i] = malloc(mapsize, M_VTFONT, M_WAITOK); in vtfont_load()
200 error = copyin(f->map[i], vf->vf_map[i], mapsize); in vtfont_load()
203 error = vtfont_validate_map(vf->vf_map[i], vf->vf_map_count[i], in vtfont_load()
210 error = copyin(f->glyphs, vf->vf_bytes, glyphsize); in vtfont_load()
215 *ret = vf; in vtfont_load()
218 bad: vtfont_unref(vf); in vtfont_load()