Skip to content

Commit

Permalink
Expose scan_for_image_keys and scan_for_font_keys
Browse files Browse the repository at this point in the history
  • Loading branch information
fschutt committed Nov 6, 2024
1 parent e61bad8 commit d7da3ac
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions azul-core/src/styled_dom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2915,19 +2915,17 @@ impl StyledDom {
}

/// Scans the display list for all font IDs + their font size
#[cfg(feature = "multithreading")]
pub(crate) fn scan_for_font_keys(
pub fn scan_for_font_keys(
&self,
resources: &RendererResources,
) -> FastHashMap<ImmediateFontId, FastBTreeSet<Au>> {
use crate::app_resources::font_size_to_au;
use crate::dom::NodeType::*;
use rayon::prelude::*;

let keys = self
.node_data
.as_ref()
.par_iter()
.iter()
.enumerate()
.filter_map(|(node_id, node_data)| {
let node_id = NodeId::new(node_id);
Expand Down Expand Up @@ -2980,8 +2978,7 @@ impl StyledDom {
}

/// Scans the display list for all image keys
#[cfg(feature = "multithreading")]
pub(crate) fn scan_for_image_keys(
pub fn scan_for_image_keys(
&self,
css_image_cache: &ImageCache,
) -> FastBTreeSet<ImageRef> {
Expand All @@ -2996,15 +2993,13 @@ impl StyledDom {
clip_mask: Option<ImageRef>,
}

use rayon::prelude::*;

let default_backgrounds: StyleBackgroundContentVec = Vec::new().into();

let images = self
.node_data
.as_container()
.internal
.par_iter()
.iter()
.enumerate()
.map(|(node_id, node_data)| {
let node_id = NodeId::new(node_id);
Expand Down

0 comments on commit d7da3ac

Please sign in to comment.