address initial review feedback

* move "formerly piet-gpu" text from title to body in readme
* use [T;N]::map() for affine conversion functions
This commit is contained in:
Chad Brokaw 2022-12-09 14:17:16 -05:00
parent 628bc9566d
commit 093af31e05
2 changed files with 4 additions and 19 deletions

View file

@ -1,6 +1,6 @@
# vello (formerly piet-gpu) # vello
This repo contains the new prototype for a new compute-centric 2D GPU renderer. This repo contains the new prototype for a new compute-centric 2D GPU renderer (formerly known as piet-gpu).
It succeeds the previous prototype, [piet-metal]. It succeeds the previous prototype, [piet-metal].

View file

@ -620,26 +620,11 @@ impl<'a> PathBuilder<'a> {
} }
fn affine_to_f32(affine: &Affine) -> [f32; 6] { fn affine_to_f32(affine: &Affine) -> [f32; 6] {
let c = affine.as_coeffs(); affine.as_coeffs().map(|value| value as f32)
[
c[0] as f32,
c[1] as f32,
c[2] as f32,
c[3] as f32,
c[4] as f32,
c[5] as f32,
]
} }
fn affine_from_f32(coeffs: &[f32; 6]) -> Affine { fn affine_from_f32(coeffs: &[f32; 6]) -> Affine {
Affine::new([ Affine::new(coeffs.map(|value| value as f64))
coeffs[0] as f64,
coeffs[1] as f64,
coeffs[2] as f64,
coeffs[3] as f64,
coeffs[4] as f64,
coeffs[5] as f64,
])
} }
fn point_to_f32(point: Point) -> [f32; 2] { fn point_to_f32(point: Point) -> [f32; 2] {