Skip to content
Snippets Groups Projects
Commit 73128462 authored by John Hodge's avatar John Hodge
Browse files

Kernel video - Faster bootvideo

parent c88df819
No related merge requests found
......@@ -196,31 +196,29 @@ impl super::Framebuffer for Framebuffer
let bpp = output_fmt.bytes_per_pixel();
// Iterate across destination row nums and source rows
//for (row,src) in Iterator::zip( dst.top() .. dst.bottom(), buf.chunks(src_pitch) )
for (row,src) in ::lib::ExactZip::new( dst.top() .. dst.bottom(), buf.chunks(src_pitch) )
match output_fmt
{
let seg = self.buffer.scanline_slice(row as usize, dst.left() as usize, dst.right() as usize);
match output_fmt
VideoFormat::X8R8G8B8 => {
assert!(bpp == 4);
// This mode corresponds to the internal format, so can use fast operations (raw byte copy)
for (row,src) in ::lib::ExactZip::new( dst.top() .. dst.bottom(), buf.chunks(src_pitch) )
{
VideoFormat::X8R8G8B8 => {
// TODO: Find a faster way of bliting.
for (px,&col) in ::lib::ExactZip::new( seg.chunks_mut(bpp), src.iter() )
{
px[0] = ((col >> 0) & 0xFF) as u8;
px[1] = ((col >> 8) & 0xFF) as u8;
px[2] = ((col >> 16) & 0xFF) as u8;
//px[3] = ((col >> 24) & 0xFF) as u8;
}
},
VideoFormat::R5G6B5 => {
let seg = self.buffer.scanline_slice(row as usize, dst.left() as usize, dst.right() as usize);
seg.copy_from_slice( ::lib::as_byte_slice(src) );
}
},
VideoFormat::R5G6B5 =>
for (row,src) in ::lib::ExactZip::new( dst.top() .. dst.bottom(), buf.chunks(src_pitch) )
{
let seg = self.buffer.scanline_slice(row as usize, dst.left() as usize, dst.right() as usize);
for (px,&col) in ::lib::ExactZip::new( seg.chunks_mut(bpp), src.iter() )
{
let col16 = output_fmt.col_from_xrgb(col);
px[0] = ((col16 >> 0) & 0xFF) as u8;
px[1] = ((col16 >> 8) & 0xFF) as u8;
}
},
fmt @ _ => todo!("Framebuffer::blit_buf - {:?}", fmt),
}
},
fmt @ _ => todo!("Framebuffer::blit_buf - {:?}", fmt),
}
if redraw_cursor {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment