Checkpoint

This commit is contained in:
Nathan Sobo 2023-10-03 13:52:10 -06:00
parent a8c1958c75
commit 3b27d41c72
9 changed files with 234 additions and 93 deletions

View file

@ -215,9 +215,13 @@ impl TextSystem {
})
}
pub fn raster_bounds(&self, params: &GlyphRasterizationParams) -> Result<Bounds<DevicePixels>> {
self.platform_text_system.glyph_raster_bounds(params)
}
pub fn rasterize_glyph(
&self,
glyph_id: &RasterizeGlyphParams,
glyph_id: &GlyphRasterizationParams,
) -> Result<(Size<DevicePixels>, Vec<u8>)> {
self.platform_text_system.rasterize_glyph(glyph_id)
}
@ -380,7 +384,7 @@ pub struct ShapedGlyph {
}
#[derive(Clone, Debug, PartialEq)]
pub struct RasterizeGlyphParams {
pub struct GlyphRasterizationParams {
pub(crate) font_id: FontId,
pub(crate) glyph_id: GlyphId,
pub(crate) font_size: Pixels,
@ -388,9 +392,9 @@ pub struct RasterizeGlyphParams {
pub(crate) scale_factor: f32,
}
impl Eq for RasterizeGlyphParams {}
impl Eq for GlyphRasterizationParams {}
impl Hash for RasterizeGlyphParams {
impl Hash for GlyphRasterizationParams {
fn hash<H: Hasher>(&self, state: &mut H) {
self.font_id.0.hash(state);
self.glyph_id.0.hash(state);