1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-08 23:58:09 +00:00

fixup! feat(core): introduce new drawing library

This commit is contained in:
cepetr 2024-05-13 11:43:41 +02:00
parent f246d98d49
commit 2f46beee66
2 changed files with 6 additions and 3 deletions

View File

@ -16,7 +16,10 @@ impl<'a> BlurCache<'a> {
where
T: LocalAllocLeakExt<'alloc>,
{
let buff = bump.alloc_t()?.uninit.init(UnsafeCell::new([0; 7928])); // TODO !!! 7928
let buff = bump
.alloc_t()?
.uninit
.init(UnsafeCell::new([0; core::mem::size_of::<BlurBuff>()]));
Some(Self {
algo: None,

View File

@ -1,4 +1,4 @@
use crate::ui::geometry::Offset;
use crate::{trezorhal::display, ui::geometry::Offset};
/// This is a simple and fast blurring algorithm that uses a box filter -
/// a square kernel with all coefficients set to 1.
///
@ -42,7 +42,7 @@ use core::mem::size_of;
const MAX_RADIUS: usize = 4;
const MAX_SIDE: usize = 1 + MAX_RADIUS * 2;
const MAX_WIDTH: usize = 240;
const MAX_WIDTH: usize = display::DISPLAY_RESX as usize;
pub type BlurBuff = [u8; MAX_WIDTH * (MAX_SIDE * 3 + size_of::<u16>() * 3) + 8];