use super::*;
#[cfg(not(target_arch = "wasm32"))]
#[derive(Clone, Copy, Data, Debug, Default)]
pub(crate) struct BandTaskSlice {
#[get(type(copy))]
pub(crate) pixels_ptr: usize,
#[get(type(copy))]
pub(crate) pixels_len: usize,
#[get(type(copy))]
pub(crate) width: u32,
#[get(type(copy))]
pub(crate) y_start: u32,
#[get(type(copy))]
pub(crate) height: u32,
#[get(type(copy))]
pub(crate) base_src_ptr: usize,
}
#[cfg(not(target_arch = "wasm32"))]
#[derive(Debug)]
pub(crate) struct BandJob {
pub(crate) tasks_ptr: usize,
pub(crate) tasks_len: usize,
pub(crate) commands_ptr: usize,
pub(crate) commands_len: usize,
pub(crate) prepped_ptr: usize,
pub(crate) prepped_len: usize,
pub(crate) layouts_ptr: usize,
pub(crate) layouts_len: usize,
pub(crate) atlas_ptr: usize,
pub(crate) scale: f32,
pub(crate) aa: AntialiasingMode,
pub(crate) next_idx: AtomicUsize,
pub(crate) workers_done: AtomicUsize,
pub(crate) total_shaded: AtomicUsize,
}
#[cfg(not(target_arch = "wasm32"))]
#[derive(Clone, Copy, Data, Debug, Default)]
pub(crate) struct BandPoolState {
#[get(type(copy))]
pub(crate) epoch: u64,
#[get(type(copy))]
pub(crate) active_job: usize,
}
#[cfg(not(target_arch = "wasm32"))]
#[derive(Debug)]
pub(crate) struct BandWorkerPool {
pub(crate) worker_count: usize,
pub(crate) dispatch_lock: Mutex<()>,
pub(crate) shared: Arc<(Mutex<BandPoolState>, Condvar, Condvar)>,
}
#[derive(Clone, Copy, Data, Debug, Default, PartialEq)]
pub(crate) struct PreppedCommand {
#[get(type(copy))]
pub(crate) cmd_index: usize,
#[get(type(copy))]
pub(crate) active_clip: Rect,
#[get(type(copy))]
pub(crate) y0: u32,
#[get(type(copy))]
pub(crate) y1: u32,
#[get(type(copy))]
pub(crate) opaque_cutout_h: Rect,
#[get(type(copy))]
pub(crate) opaque_cutout_v: Rect,
#[get(type(copy))]
pub(crate) text_layout_idx: u32,
}
#[derive(Clone, Data, Debug, Default)]
pub struct SoftwareRenderer {
pub(crate) framebuffer: Framebuffer,
pub(crate) glyph_atlas: GlyphAtlas,
pub(crate) font_provider: NativeSystemFont,
#[get(type(copy))]
pub(crate) measurer: DeterministicTextMeasurer,
#[get(pub(crate))]
#[get_mut(pub(crate))]
pub(crate) text_layout_cache: HashMap<(u64, u32), TextLayoutResult>,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) clip_stack: Vec<Rect>,
#[get(type(copy))]
pub(crate) antialiasing: AntialiasingMode,
#[get(type(copy))]
pub(crate) tile_size: u32,
#[get(pub(crate), type(copy))]
#[set(pub(crate))]
pub(crate) base_cache_width: u32,
#[get(pub(crate), type(copy))]
#[set(pub(crate))]
pub(crate) base_cache_height: u32,
#[get(pub(crate), type(copy))]
#[set(pub(crate))]
pub(crate) base_cache_hash: u64,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) base_cache_pixels: Vec<u8>,
}