mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-30 18:10:56 +00:00
chore(core/rust): publish the ConcreteRenderer types for each renderer version
we need them to be able to spell out a concrete type of the argument to `render()`
This commit is contained in:
parent
083071dcb9
commit
4c10a4f643
@ -3,7 +3,7 @@ use crate::ui::{
|
|||||||
shape::{render::ScopedRenderer, DirectRenderer, Mono8Canvas, Viewport},
|
shape::{render::ScopedRenderer, DirectRenderer, Mono8Canvas, Viewport},
|
||||||
};
|
};
|
||||||
|
|
||||||
type ConcreteRenderer<'a, 'alloc> = DirectRenderer<'a, 'alloc, Mono8Canvas<'alloc>>;
|
pub type ConcreteRenderer<'a, 'alloc> = DirectRenderer<'a, 'alloc, Mono8Canvas<'alloc>>;
|
||||||
|
|
||||||
pub fn render_on_display<'env, F>(_viewport: Option<Viewport>, _bg_color: Option<Color>, _func: F)
|
pub fn render_on_display<'env, F>(_viewport: Option<Viewport>, _bg_color: Option<Color>, _func: F)
|
||||||
where
|
where
|
||||||
|
@ -10,7 +10,7 @@ use crate::trezorhal::display;
|
|||||||
|
|
||||||
use static_alloc::Bump;
|
use static_alloc::Bump;
|
||||||
|
|
||||||
type ConcreteRenderer<'a, 'alloc> = DirectRenderer<'a, 'alloc, Mono8Canvas<'alloc>>;
|
pub type ConcreteRenderer<'a, 'alloc> = DirectRenderer<'a, 'alloc, Mono8Canvas<'alloc>>;
|
||||||
|
|
||||||
/// Creates the `Renderer` object for drawing on a display and invokes a
|
/// Creates the `Renderer` object for drawing on a display and invokes a
|
||||||
/// user-defined function that takes a single argument `target`. The user's
|
/// user-defined function that takes a single argument `target`. The user's
|
||||||
|
@ -10,7 +10,7 @@ use super::bumps;
|
|||||||
|
|
||||||
use crate::trezorhal::display;
|
use crate::trezorhal::display;
|
||||||
|
|
||||||
type ConcreteRenderer<'a, 'alloc> = DirectRenderer<'a, 'alloc, Rgb565Canvas<'alloc>>;
|
pub type ConcreteRenderer<'a, 'alloc> = DirectRenderer<'a, 'alloc, Rgb565Canvas<'alloc>>;
|
||||||
|
|
||||||
/// Creates the `Renderer` object for drawing on a display and invokes a
|
/// Creates the `Renderer` object for drawing on a display and invokes a
|
||||||
/// user-defined function that takes a single argument `target`. The user's
|
/// user-defined function that takes a single argument `target`. The user's
|
||||||
|
@ -10,7 +10,7 @@ use super::bumps;
|
|||||||
|
|
||||||
use crate::trezorhal::display;
|
use crate::trezorhal::display;
|
||||||
|
|
||||||
type ConcreteRenderer<'a, 'alloc> = DirectRenderer<'a, 'alloc, Rgba8888Canvas<'alloc>>;
|
pub type ConcreteRenderer<'a, 'alloc> = DirectRenderer<'a, 'alloc, Rgba8888Canvas<'alloc>>;
|
||||||
|
|
||||||
/// Creates the `Renderer` object for drawing on a display and invokes a
|
/// Creates the `Renderer` object for drawing on a display and invokes a
|
||||||
/// user-defined function that takes a single argument `target`. The user's
|
/// user-defined function that takes a single argument `target`. The user's
|
||||||
|
@ -15,7 +15,7 @@ pub mod nofb_rgb565;
|
|||||||
|
|
||||||
#[cfg(not(feature = "new_rendering"))]
|
#[cfg(not(feature = "new_rendering"))]
|
||||||
mod _new_rendering {
|
mod _new_rendering {
|
||||||
pub use super::fake_display::render_on_display;
|
pub use super::fake_display::{render_on_display, ConcreteRenderer};
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "new_rendering")]
|
#[cfg(feature = "new_rendering")]
|
||||||
@ -23,31 +23,31 @@ mod _new_rendering {
|
|||||||
#[cfg(not(feature = "xframebuffer"))]
|
#[cfg(not(feature = "xframebuffer"))]
|
||||||
mod _xframebuffer {
|
mod _xframebuffer {
|
||||||
#[cfg(feature = "display_rgb565")]
|
#[cfg(feature = "display_rgb565")]
|
||||||
pub use super::super::nofb_rgb565::render_on_display;
|
pub use super::super::nofb_rgb565::{render_on_display, ConcreteRenderer};
|
||||||
|
|
||||||
#[cfg(not(feature = "display_rgb565"))]
|
#[cfg(not(feature = "display_rgb565"))]
|
||||||
pub use super::super::fake_display::render_on_display;
|
pub use super::super::fake_display::{render_on_display, ConcreteRenderer};
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "xframebuffer")]
|
#[cfg(feature = "xframebuffer")]
|
||||||
mod _xframebuffer {
|
mod _xframebuffer {
|
||||||
#[cfg(feature = "display_rgb565")]
|
#[cfg(feature = "display_rgb565")]
|
||||||
pub use super::super::fb_rgb565::render_on_display;
|
pub use super::super::fb_rgb565::{render_on_display, ConcreteRenderer};
|
||||||
|
|
||||||
#[cfg(all(feature = "display_rgba8888", not(feature = "display_rgb565")))]
|
#[cfg(all(feature = "display_rgba8888", not(feature = "display_rgb565")))]
|
||||||
pub use super::super::fb_rgba8888::render_on_display;
|
pub use super::super::fb_rgba8888::{render_on_display, ConcreteRenderer};
|
||||||
|
|
||||||
#[cfg(all(
|
#[cfg(all(
|
||||||
feature = "display_mono",
|
feature = "display_mono",
|
||||||
not(feature = "display_rgb565"),
|
not(feature = "display_rgb565"),
|
||||||
not(feature = "display_rgba8888")
|
not(feature = "display_rgba8888")
|
||||||
))]
|
))]
|
||||||
pub use super::super::fb_mono8::render_on_display;
|
pub use super::super::fb_mono8::{render_on_display, ConcreteRenderer};
|
||||||
}
|
}
|
||||||
|
|
||||||
pub use _xframebuffer::render_on_display;
|
pub use _xframebuffer::{render_on_display, ConcreteRenderer};
|
||||||
}
|
}
|
||||||
|
|
||||||
pub use _new_rendering::render_on_display;
|
pub use _new_rendering::{render_on_display, ConcreteRenderer};
|
||||||
|
|
||||||
pub use bumps::unlock_bumps_on_failure;
|
pub use bumps::unlock_bumps_on_failure;
|
||||||
|
@ -17,7 +17,7 @@ use super::bumps;
|
|||||||
|
|
||||||
use static_alloc::Bump;
|
use static_alloc::Bump;
|
||||||
|
|
||||||
type ConcreteRenderer<'a, 'alloc> =
|
pub type ConcreteRenderer<'a, 'alloc> =
|
||||||
ProgressiveRenderer<'a, 'alloc, Bump<[u8; bumps::BUMP_A_SIZE]>, DisplayCanvas>;
|
ProgressiveRenderer<'a, 'alloc, Bump<[u8; bumps::BUMP_A_SIZE]>, DisplayCanvas>;
|
||||||
|
|
||||||
/// Creates the `Renderer` object for drawing on a display and invokes a
|
/// Creates the `Renderer` object for drawing on a display and invokes a
|
||||||
|
Loading…
Reference in New Issue
Block a user