summaryrefslogtreecommitdiffstats
path: root/wgpu/src/geometry.rs
diff options
context:
space:
mode:
authorLibravatar Bingus <shankern@protonmail.com>2023-05-25 10:49:26 -0700
committerLibravatar Bingus <shankern@protonmail.com>2023-05-25 10:49:26 -0700
commit413526ad09d006853eb9659efabee168f4a0e0a4 (patch)
tree371ed639b36af4108e76447da5ccc8c7163cc369 /wgpu/src/geometry.rs
parenta395e78596d0711a50108cb6654121541337ceb5 (diff)
downloadiced-413526ad09d006853eb9659efabee168f4a0e0a4.tar.gz
iced-413526ad09d006853eb9659efabee168f4a0e0a4.tar.bz2
iced-413526ad09d006853eb9659efabee168f4a0e0a4.zip
Created "Packed" data structure for gradient data.
Diffstat (limited to 'wgpu/src/geometry.rs')
-rw-r--r--wgpu/src/geometry.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/wgpu/src/geometry.rs b/wgpu/src/geometry.rs
index 13ce2359..f3fed7ae 100644
--- a/wgpu/src/geometry.rs
+++ b/wgpu/src/geometry.rs
@@ -7,6 +7,7 @@ use crate::graphics::geometry::{
use crate::graphics::primitive::{self, Primitive};
use crate::graphics::Gradient;
+use iced_graphics::gradient;
use lyon::geom::euclid;
use lyon::tessellation;
use std::borrow::Cow;
@@ -490,7 +491,7 @@ impl Frame {
}
struct GradientVertex2DBuilder {
- gradient: [f32; 44],
+ gradient: gradient::Packed,
}
impl tessellation::FillVertexConstructor<primitive::GradientVertex2D>
@@ -504,7 +505,7 @@ impl tessellation::FillVertexConstructor<primitive::GradientVertex2D>
primitive::GradientVertex2D {
position: [position.x, position.y],
- gradient: self.gradient,
+ gradient: self.gradient.data,
}
}
}
@@ -520,7 +521,7 @@ impl tessellation::StrokeVertexConstructor<primitive::GradientVertex2D>
primitive::GradientVertex2D {
position: [position.x, position.y],
- gradient: self.gradient,
+ gradient: self.gradient.data,
}
}
}