fixup! feat(core): introduce new drawing library

cepetr/gfx-alpha
cepetr 2 weeks ago
parent 79bfa5a65c
commit e0f93141b8

@ -190,8 +190,8 @@ pub struct BitBltCopy<'a> {
}
impl<'a> BitBltCopy<'a> {
/// Prepares `BitBltCopy` structure for copying or blending a part of the source
/// bitmap to the destination bitmap or display.
/// Prepares `BitBltCopy` structure for copying or blending a part of the
/// source bitmap to the destination bitmap or display.
///
/// - `r` is the rectangle in the destination bitmap.
/// - `clip` is the clipping rectangle and must be completely inside the

@ -118,11 +118,16 @@ impl<'a> ZlibCache<'a> {
fn select_slot_for_reuse(&self) -> Result<usize, ()> {
if self.slots.capacity() > 0 {
// Try to find a free slot. If there's no free slot,
// select the one that performed the least amount of work
// based on the offset in the uncompressed data.
let mut selected = 0;
for (i, slot) in self.slots.iter().enumerate() {
if slot.dc.is_none() {
selected = i;
break;
} else if slot.offset < self.slots[selected].offset {
selected = i;
}
}
Ok(selected)

@ -1,4 +1,7 @@
use crate::trezorhal::{bitblt::{BitBltCopy, BitBltFill}, display};
use crate::trezorhal::{
bitblt::{BitBltCopy, BitBltFill},
display,
};
use crate::ui::{
display::Color,

Loading…
Cancel
Save