mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
Compiler: move the image and font embedding behind a software-renderer flag
Limit the dependency tree of things like the interpreter or the C++ compiler that doesn't support it anyway. It is still enabled inconditionally in slint-build though
This commit is contained in:
parent
a2838bb6ce
commit
4556291e1a
8 changed files with 86 additions and 66 deletions
|
@ -506,7 +506,9 @@ pub fn generate(doc: &Document) -> impl std::fmt::Display {
|
|||
init: Some(init),
|
||||
})
|
||||
}
|
||||
#[cfg(feature = "software-renderer")]
|
||||
crate::embedded_resources::EmbeddedResourcesKind::TextureData(_) => todo!(),
|
||||
#[cfg(feature = "software-renderer")]
|
||||
crate::embedded_resources::EmbeddedResourcesKind::BitmapFontData(_) => todo!(),
|
||||
}
|
||||
},
|
||||
|
|
|
@ -188,6 +188,7 @@ pub fn generate(doc: &Document) -> TokenStream {
|
|||
let data = embedded_file_tokens(path);
|
||||
quote!(static #symbol: &'static [u8] = #data;)
|
||||
}
|
||||
#[cfg(feature = "software-renderer")]
|
||||
crate::embedded_resources::EmbeddedResourcesKind::TextureData(crate::embedded_resources::Texture {
|
||||
data, format, rect,
|
||||
total_size: crate::embedded_resources::Size{width, height},
|
||||
|
@ -220,6 +221,7 @@ pub fn generate(doc: &Document) -> TokenStream {
|
|||
};
|
||||
)
|
||||
},
|
||||
#[cfg(feature = "software-renderer")]
|
||||
crate::embedded_resources::EmbeddedResourcesKind::BitmapFontData(crate::embedded_resources::BitmapFont { family_name, character_map, units_per_em, ascent, descent, glyphs }) => {
|
||||
|
||||
let character_map_size = character_map.len();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue