Move text layout and rendering to Parley
This commit is contained in:
1 parent
fc1ba3cdc3
commit
f659e319ff
19 files changed
+1333
-798
No files matched your search
@@ -202,6 +202,7 @@ impl PrimitiveHandle {
|
||||
primitives!(
|
||||
rects: RectPrimitive => 0,
|
||||
textures: TexturePrimitive => 1,
|
||||
glyphs: GlyphPrimitive => 2,
|
||||
);
|
||||
|
||||
#[repr(C)]
|
||||
@@ -231,6 +232,22 @@ pub struct TexturePrimitive {
|
||||
pub sampler_idx: u32,
|
||||
}
|
||||
|
||||
/// An atlas subrectangle, tinted for masks or unchanged for color glyphs.
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct GlyphPrimitive {
|
||||
pub uv_min: [f32; 2],
|
||||
pub uv_max: [f32; 2],
|
||||
pub view_idx: u32,
|
||||
pub sampler_idx: u32,
|
||||
pub color: Color<u8>,
|
||||
pub flags: u32,
|
||||
}
|
||||
|
||||
impl GlyphPrimitive {
|
||||
pub const IS_COLOR: u32 = 1;
|
||||
}
|
||||
|
||||
pub struct PrimitiveVec<T> {
|
||||
vec: Vec<T>,
|
||||
free: Vec<usize>,
|
||||
|
||||
Reference in new issue
Block a user