From 056446c23d752c462721f2b4a04a06b00d0689ac Mon Sep 17 00:00:00 2001 From: Raph Levien Date: Mon, 6 Sep 2021 10:19:55 -0700 Subject: [PATCH] Cargo fmt --- piet-gpu-hal/src/hub.rs | 3 +-- piet-gpu/src/test_scenes.rs | 13 +++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/piet-gpu-hal/src/hub.rs b/piet-gpu-hal/src/hub.rs index f4a7938..8312d4e 100644 --- a/piet-gpu-hal/src/hub.rs +++ b/piet-gpu-hal/src/hub.rs @@ -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; } diff --git a/piet-gpu/src/test_scenes.rs b/piet-gpu/src/test_scenes.rs index fa4c8e3..47ace66 100644 --- a/piet-gpu/src/test_scenes.rs +++ b/piet-gpu/src/test_scenes.rs @@ -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); -} \ No newline at end of file +}