Merge branch 'fix_console_draw' into 'main'
drivers/graphics/console-draw: Fix corrupted drawing See merge request redox-os/base!272
This commit is contained in:
@@ -398,7 +398,7 @@ impl TextScreen {
|
||||
for raw_y in 0..h {
|
||||
let y = if from_y > to_y { raw_y } else { h - raw_y - 1 };
|
||||
|
||||
for pixel_y in 0..self.font.width {
|
||||
for pixel_y in 0..self.font.height {
|
||||
{
|
||||
let off_from = ((from_y + y) * self.font.height + pixel_y) * width
|
||||
+ from_x * self.font.width;
|
||||
@@ -504,7 +504,7 @@ impl TextScreen {
|
||||
copy_row(old_map, new_map, row, row);
|
||||
}
|
||||
} else {
|
||||
let deleted_rows = (old_map.height - new_map.height).div_ceil(16);
|
||||
let deleted_rows = (old_map.height - new_map.height).div_ceil(self.font.height);
|
||||
for row in 0..new_map.height {
|
||||
if row + (deleted_rows + 1) * self.font.height >= old_map.height {
|
||||
break;
|
||||
|
||||
@@ -232,10 +232,7 @@ impl SchemeSync for FbbootlogScheme {
|
||||
|
||||
if !self.is_scrollback {
|
||||
let damage = self.text_screen.write(map, buf, &mut VecDeque::new());
|
||||
|
||||
if let Some(map) = &mut self.display_map {
|
||||
map.dirty_fb(damage).unwrap();
|
||||
}
|
||||
map.dirty_fb(damage).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use console_draw::{Damage, TextScreen, V2DisplayMap};
|
||||
use console_draw::{TextScreen, V2DisplayMap};
|
||||
use drm::buffer::Buffer;
|
||||
use drm::control::Device;
|
||||
use graphics_ipc::V2GraphicsHandle;
|
||||
@@ -74,10 +74,4 @@ impl Display {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn sync_rect(&mut self, damage: Damage) {
|
||||
if let Some(map) = &mut self.map {
|
||||
map.dirty_fb(damage).unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ use std::os::fd::AsRawFd;
|
||||
|
||||
use console_draw::ConsoleFont;
|
||||
use event::{EventQueue, UserData};
|
||||
use orbclient::FONT;
|
||||
use redox_scheme::scheme::SchemeSync;
|
||||
use redox_scheme::{CallerCtx, OpenResult};
|
||||
use scheme_utils::{FpathWriter, HandleMap};
|
||||
|
||||
@@ -125,8 +125,7 @@ impl TextScreen {
|
||||
Display::handle_resize(map, &mut self.inner);
|
||||
|
||||
let damage = self.inner.write(map, buf, &mut self.input);
|
||||
|
||||
self.display.sync_rect(damage);
|
||||
map.dirty_fb(damage).unwrap();
|
||||
}
|
||||
|
||||
Ok(buf.len())
|
||||
|
||||
Reference in New Issue
Block a user