use super::*;
#[derive(Clone, Copy, Data, Debug, Default, Eq, Hash, PartialEq)]
pub struct TextShapingKey {
#[get(type(copy))]
pub(crate) text_hash_a: u64,
#[get(type(copy))]
pub(crate) text_hash_b: u64,
#[get(type(copy))]
pub(crate) text_len: u32,
#[get(type(copy))]
pub(crate) font_size_bits: u32,
#[get(type(copy))]
pub(crate) family: FontFamily,
#[get(type(copy))]
pub(crate) weight: FontWeight,
#[get(type(copy))]
pub(crate) italic: bool,
#[get(type(copy))]
pub(crate) letter_spacing_bits: u32,
#[get(type(copy))]
pub(crate) locale_hash: u64,
#[get(type(copy))]
pub(crate) rtl: bool,
#[get(type(copy))]
pub(crate) font_chain_revision: u64,
}
#[derive(Clone, Copy, Data, Debug, Default, Eq, Hash, PartialEq)]
pub struct LineBreakKey {
#[get(type(copy))]
pub(crate) shaping_hash_a: u64,
#[get(type(copy))]
pub(crate) shaping_hash_b: u64,
#[get(type(copy))]
pub(crate) max_width_bits: u32,
#[get(type(copy))]
pub(crate) line_height_bits: u32,
#[get(type(copy))]
pub(crate) overflow: TextOverflow,
#[get(type(copy))]
pub(crate) font_chain_revision: u64,
}
#[derive(Clone, Data, Debug, Default, PartialEq)]
pub struct ShapedGlyphRun {
pub(crate) cluster_advances: Vec<f32>,
#[get(type(copy))]
pub(crate) total_width: f32,
#[get(type(copy))]
pub(crate) cluster_count: usize,
#[get(type(copy))]
pub(crate) byte_size: usize,
#[get(type(copy))]
pub(crate) last_used_tick: u64,
}
#[derive(Clone, Debug, Default, PartialEq)]
pub(crate) struct ShapingRunSlot {
pub(crate) occupied: bool,
pub(crate) hash: u64,
pub(crate) key: TextShapingKey,
pub(crate) run: ShapedGlyphRun,
pub(crate) prev: u32,
pub(crate) next: u32,
}
#[derive(Clone, Debug, Default, PartialEq)]
pub(crate) struct LineBreakSlot {
pub(crate) occupied: bool,
pub(crate) hash: u64,
pub(crate) byte_size: usize,
pub(crate) key: LineBreakKey,
pub(crate) layout: TextLayoutResult,
pub(crate) prev: u32,
pub(crate) next: u32,
}
#[derive(Clone, Data, Debug)]
pub struct TextShapingCache {
#[get(type(copy))]
pub(crate) budget_bytes: usize,
#[get(type(copy))]
#[get_mut(skip)]
#[set(skip)]
pub(crate) resident_bytes: usize,
#[get(type(copy))]
#[get_mut(skip)]
#[set(skip)]
pub(crate) font_chain_revision: u64,
#[get(skip)]
#[get_mut(skip)]
#[set(skip)]
pub(crate) lru_clock: u64,
#[get(skip)]
#[get_mut(skip)]
#[set(skip)]
pub(crate) shape_index: Vec<u64>,
#[get(skip)]
#[get_mut(skip)]
#[set(skip)]
pub(crate) line_break_index: Vec<u64>,
#[get(skip)]
#[get_mut(skip)]
#[set(skip)]
pub(crate) shape_slots: Vec<ShapingRunSlot>,
#[get(skip)]
#[get_mut(skip)]
#[set(skip)]
pub(crate) line_break_slots: Vec<LineBreakSlot>,
#[get(skip)]
#[get_mut(skip)]
#[set(skip)]
pub(crate) shape_free_slots: Vec<u32>,
#[get(skip)]
#[get_mut(skip)]
#[set(skip)]
pub(crate) line_break_free_slots: Vec<u32>,
#[get(skip)]
#[get_mut(skip)]
#[set(skip)]
pub(crate) lru_head: u32,
#[get(skip)]
#[get_mut(skip)]
#[set(skip)]
pub(crate) lru_tail: u32,
#[get(skip)]
#[get_mut(skip)]
#[set(skip)]
pub(crate) shape_count: usize,
#[get(skip)]
#[get_mut(skip)]
#[set(skip)]
pub(crate) line_break_count: usize,
#[get(skip)]
#[get_mut(skip)]
#[set(skip)]
pub(crate) shape_occupied: usize,
#[get(skip)]
#[get_mut(skip)]
#[set(skip)]
pub(crate) line_break_occupied: usize,
#[get(type(copy))]
#[get_mut(skip)]
#[set(skip)]
pub(crate) shaping_hits: u64,
#[get(type(copy))]
#[get_mut(skip)]
#[set(skip)]
pub(crate) shaping_misses: u64,
#[get(type(copy))]
#[get_mut(skip)]
#[set(skip)]
pub(crate) line_break_hits: u64,
#[get(type(copy))]
#[get_mut(skip)]
#[set(skip)]
pub(crate) line_break_misses: u64,
#[get(type(copy))]
#[get_mut(skip)]
#[set(skip)]
pub(crate) evictions: u64,
}