Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Nathan Sobo 2021-03-29 22:56:47 -06:00
parent 64af4c694a
commit b538f5cfb7

View file

@ -32,7 +32,7 @@ pub struct Renderer {
instances: metal::Buffer, instances: metal::Buffer,
} }
struct PathStencil { struct PathSprite {
layer_id: usize, layer_id: usize,
atlas_id: usize, atlas_id: usize,
sprite: shaders::GPUISprite, sprite: shaders::GPUISprite,
@ -128,7 +128,7 @@ impl Renderer {
scene: &Scene, scene: &Scene,
offset: &mut usize, offset: &mut usize,
drawable_size: Vector2F, drawable_size: Vector2F,
) -> Vec<PathStencil> { ) -> Vec<PathSprite> {
let mut stencils = Vec::new(); let mut stencils = Vec::new();
let mut vertices = Vec::<shaders::GPUIPathVertex>::new(); let mut vertices = Vec::<shaders::GPUIPathVertex>::new();
let mut current_atlas_id = None; let mut current_atlas_id = None;
@ -137,7 +137,7 @@ impl Renderer {
// Push a PathStencil struct for use later when sampling from the atlas as we draw the content of the layers // Push a PathStencil struct for use later when sampling from the atlas as we draw the content of the layers
let size = path.bounds.size().ceil().to_i32(); let size = path.bounds.size().ceil().to_i32();
let (atlas_id, atlas_origin) = self.path_stencils.allocate(size).unwrap(); let (atlas_id, atlas_origin) = self.path_stencils.allocate(size).unwrap();
stencils.push(PathStencil { stencils.push(PathSprite {
layer_id, layer_id,
atlas_id, atlas_id,
sprite: shaders::GPUISprite { sprite: shaders::GPUISprite {