From 4c10a4f643f95567c503aad06f4b0ece9c18e9be Mon Sep 17 00:00:00 2001 From: matejcik Date: Fri, 5 Jul 2024 09:38:22 +0200 Subject: [PATCH] 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()` --- .../rust/src/ui/shape/display/fake_display.rs | 2 +- core/embed/rust/src/ui/shape/display/fb_mono8.rs | 2 +- .../embed/rust/src/ui/shape/display/fb_rgb565.rs | 2 +- .../rust/src/ui/shape/display/fb_rgba8888.rs | 2 +- core/embed/rust/src/ui/shape/display/mod.rs | 16 ++++++++-------- .../rust/src/ui/shape/display/nofb_rgb565.rs | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/core/embed/rust/src/ui/shape/display/fake_display.rs b/core/embed/rust/src/ui/shape/display/fake_display.rs index 99a4dcd6f2..1840355593 100644 --- a/core/embed/rust/src/ui/shape/display/fake_display.rs +++ b/core/embed/rust/src/ui/shape/display/fake_display.rs @@ -3,7 +3,7 @@ use crate::ui::{ 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, _bg_color: Option, _func: F) where diff --git a/core/embed/rust/src/ui/shape/display/fb_mono8.rs b/core/embed/rust/src/ui/shape/display/fb_mono8.rs index 713978f3db..42cd43fc29 100644 --- a/core/embed/rust/src/ui/shape/display/fb_mono8.rs +++ b/core/embed/rust/src/ui/shape/display/fb_mono8.rs @@ -10,7 +10,7 @@ use crate::trezorhal::display; 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 /// user-defined function that takes a single argument `target`. The user's diff --git a/core/embed/rust/src/ui/shape/display/fb_rgb565.rs b/core/embed/rust/src/ui/shape/display/fb_rgb565.rs index 8af5ebd79a..6c8600fee9 100644 --- a/core/embed/rust/src/ui/shape/display/fb_rgb565.rs +++ b/core/embed/rust/src/ui/shape/display/fb_rgb565.rs @@ -10,7 +10,7 @@ use super::bumps; 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 /// user-defined function that takes a single argument `target`. The user's diff --git a/core/embed/rust/src/ui/shape/display/fb_rgba8888.rs b/core/embed/rust/src/ui/shape/display/fb_rgba8888.rs index e75941aadc..78975a198a 100644 --- a/core/embed/rust/src/ui/shape/display/fb_rgba8888.rs +++ b/core/embed/rust/src/ui/shape/display/fb_rgba8888.rs @@ -10,7 +10,7 @@ use super::bumps; 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 /// user-defined function that takes a single argument `target`. The user's diff --git a/core/embed/rust/src/ui/shape/display/mod.rs b/core/embed/rust/src/ui/shape/display/mod.rs index f72561bebd..3da85bbf30 100644 --- a/core/embed/rust/src/ui/shape/display/mod.rs +++ b/core/embed/rust/src/ui/shape/display/mod.rs @@ -15,7 +15,7 @@ pub mod nofb_rgb565; #[cfg(not(feature = "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")] @@ -23,31 +23,31 @@ mod _new_rendering { #[cfg(not(feature = "xframebuffer"))] mod _xframebuffer { #[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"))] - pub use super::super::fake_display::render_on_display; + pub use super::super::fake_display::{render_on_display, ConcreteRenderer}; } #[cfg(feature = "xframebuffer")] mod _xframebuffer { #[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")))] - pub use super::super::fb_rgba8888::render_on_display; + pub use super::super::fb_rgba8888::{render_on_display, ConcreteRenderer}; #[cfg(all( feature = "display_mono", not(feature = "display_rgb565"), 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; diff --git a/core/embed/rust/src/ui/shape/display/nofb_rgb565.rs b/core/embed/rust/src/ui/shape/display/nofb_rgb565.rs index b2d372e6d8..36dc2f43d3 100644 --- a/core/embed/rust/src/ui/shape/display/nofb_rgb565.rs +++ b/core/embed/rust/src/ui/shape/display/nofb_rgb565.rs @@ -17,7 +17,7 @@ use super::bumps; use static_alloc::Bump; -type ConcreteRenderer<'a, 'alloc> = +pub type ConcreteRenderer<'a, 'alloc> = ProgressiveRenderer<'a, 'alloc, Bump<[u8; bumps::BUMP_A_SIZE]>, DisplayCanvas>; /// Creates the `Renderer` object for drawing on a display and invokes a