Cargo fmt

This commit is contained in:
Raph Levien 2021-09-06 10:19:55 -07:00
parent 4b2a720289
commit 056446c23d
2 changed files with 10 additions and 6 deletions

View file

@ -173,7 +173,7 @@ impl Session {
// Reuse of command buffers works on Vulkan, but not at all on
// Metal and is problematic on DX12 (the allocator is returned)
// to the pool. Punt for now.
let mut pool = self.0.cmd_buf_pool.lock().unwrap();
pool.push((item.cmd_buf, item.fence));
std::mem::drop(item.resources);
@ -181,7 +181,6 @@ impl Session {
pool.push((staging_cmd_buf.cmd_buf, staging_cmd_buf.fence));
std::mem::drop(staging_cmd_buf.resources);
}
} else {
i += 1;
}

View file

@ -2,10 +2,12 @@
use rand::{Rng, RngCore};
use piet::{Color, FixedGradient, FixedLinearGradient, GradientStop, Text, TextAttribute, TextLayoutBuilder};
use piet::kurbo::{BezPath, Circle, Line, Point, Rect, Shape};
use piet::{
Color, FixedGradient, FixedLinearGradient, GradientStop, Text, TextAttribute, TextLayoutBuilder,
};
use crate::{RenderContext, PicoSvg, Vec2};
use crate::{PicoSvg, RenderContext, Vec2};
const N_CIRCLES: usize = 0;
@ -190,7 +192,10 @@ fn render_tiger(rc: &mut impl RenderContext) {
}
pub fn render_anim_frame(rc: &mut impl RenderContext, i: usize) {
rc.fill(Rect::new(0.0, 0.0, 1000.0, 1000.0), &Color::rgb8(128, 128, 128));
rc.fill(
Rect::new(0.0, 0.0, 1000.0, 1000.0),
&Color::rgb8(128, 128, 128),
);
let text_size = 60.0 + 40.0 * (0.01 * i as f64).sin();
rc.save().unwrap();
//rc.transform(Affine::new([0.2, 0.0, 0.0, -0.2, 200.0, 800.0]));
@ -208,4 +213,4 @@ pub fn render_anim_frame(rc: &mut impl RenderContext, i: usize) {
let p1 = center + 400.0 * Vec2::from_angle(th);
let line = Line::new(center, p1);
rc.stroke(line, &Color::rgb8(128, 0, 0), 5.0);
}
}