Move mesh::Style to triangle and reuse it in fill and stroke

This commit is contained in:
Héctor Ramón Jiménez 2022-11-03 05:50:53 +01:00
parent e0bb707f1e
commit 84d1b79fef
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
10 changed files with 72 additions and 98 deletions

View file

@ -3,8 +3,11 @@ mod gradient;
mod solid;
use crate::{program, Transformation};
use iced_graphics::layer::mesh::{self, Mesh};
use iced_graphics::triangle;
use glow::HasContext;
use iced_graphics::layer::{mesh, Mesh};
use std::marker::PhantomData;
pub use iced_graphics::triangle::{Mesh2D, Vertex2D};
@ -136,10 +139,10 @@ impl Pipeline {
);
match mesh.style {
mesh::Style::Solid(color) => {
triangle::Style::Solid(color) => {
self.programs.solid.use_program(gl, color, &transform);
}
mesh::Style::Gradient(gradient) => {
triangle::Style::Gradient(gradient) => {
self.programs
.gradient
.use_program(gl, gradient, &transform);