Skip to main content

repose_core/
render_api.rs

1use crate::units::Px;
2use crate::view::Scene;
3
4#[derive(Clone, Copy)]
5pub struct GlyphRasterConfig {
6    /// Rasterization size in physical pixels.
7    pub px: Px,
8}
9
10pub trait RenderBackend {
11    /// Configure the framebuffer for `width` x `height` and return the size
12    /// actually used.
13    ///
14    /// Device texture limits can make the framebuffer smaller than the
15    /// viewport, so the caller must adopt the returned size for layout and
16    /// hit testing. Anything else lets the scene project against one size
17    /// while input is resolved against another.
18    fn configure_surface(&mut self, width: u32, height: u32) -> (u32, u32);
19    fn frame(&mut self, scene: &Scene, glyph_cfg: GlyphRasterConfig) -> bool;
20}