mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
fixup apis to use traits
This commit is contained in:
parent
8acb9e7521
commit
cc8a0a57a7
1 changed files with 5 additions and 4 deletions
|
|
@ -128,7 +128,7 @@ impl ComposedType {
|
|||
|
||||
/// Note: it is up to the caller to ensure that clip_rect is within the renderable screen area. We do no
|
||||
/// additional checks around this.
|
||||
pub fn render(&self, frbuf: &mut [u32], offset: Point, invert: bool, clip_rect: Rectangle) {
|
||||
pub fn render<T: FrameBuffer>(&self, frbuf: &mut T, offset: Point, invert: bool, clip_rect: Rectangle) {
|
||||
const MAX_GLYPH_MARGIN: isize = 16;
|
||||
// let mut strpos; // just for debugging insertion points
|
||||
for word in self.words.iter() {
|
||||
|
|
@ -159,18 +159,19 @@ impl ComposedType {
|
|||
} else {
|
||||
let cr =
|
||||
ClipRect::new(clip_rect.tl().x, clip_rect.tl().y, clip_rect.br().x, clip_rect.br().y);
|
||||
let rawbuf = unsafe { frbuf.raw_mut() };
|
||||
if glyph.large {
|
||||
blitstr2::xor_glyph_large(
|
||||
frbuf,
|
||||
rawbuf,
|
||||
(maybe_x, maybe_y),
|
||||
*glyph,
|
||||
glyph.invert ^ invert,
|
||||
cr,
|
||||
);
|
||||
} else if !glyph.double {
|
||||
blitstr2::xor_glyph(frbuf, (maybe_x, maybe_y), *glyph, glyph.invert ^ invert, cr);
|
||||
blitstr2::xor_glyph(rawbuf, (maybe_x, maybe_y), *glyph, glyph.invert ^ invert, cr);
|
||||
} else {
|
||||
blitstr2::xor_glyph_2x(frbuf, (maybe_x, maybe_y), *glyph, glyph.invert ^ invert, cr);
|
||||
blitstr2::xor_glyph_2x(rawbuf, (maybe_x, maybe_y), *glyph, glyph.invert ^ invert, cr);
|
||||
}
|
||||
if glyph.insert {
|
||||
// log::info!("insert at {},{}", glyph.ch, strpos - 1);
|
||||
|
|
|
|||
Loading…
Reference in a new issue