Skip to content

Commit

Permalink
Update to piet 0.13
Browse files Browse the repository at this point in the history
Get rid of kurbo patch, as we now use kurbo through piet. Also clean up
some warnings.
  • Loading branch information
raphlinus committed May 12, 2020
1 parent c1f4f66 commit 8d01aba
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 23 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions Cargo.toml
Expand Up @@ -6,7 +6,3 @@ members = [
"piet-gpu-hal",
"piet-gpu-types"
]

# TODO: remove when the flatten feature is published
[patch.crates-io]
kurbo = { git = "https://github.com/linebender/kurbo", rev = "7bd7e66bd137e757305d170a0f9f2b4f7beeb299" }
7 changes: 4 additions & 3 deletions piet-gpu-hal/src/vulkan.rs
Expand Up @@ -62,7 +62,8 @@ pub struct Buffer {

pub struct Image {
image: vk::Image,
image_memory: vk::DeviceMemory,
// Not used now but probably will be for destruction.
_image_memory: vk::DeviceMemory,
image_view: vk::ImageView,
extent: vk::Extent3D,
}
Expand Down Expand Up @@ -475,7 +476,7 @@ impl crate::Device for VkDevice {
)?;
Ok(Image {
image,
image_memory,
_image_memory: image_memory,
image_view,
extent,
})
Expand Down Expand Up @@ -984,7 +985,7 @@ impl VkSwapchain {
pub unsafe fn image(&self, idx: usize) -> Image {
Image {
image: self.images[idx],
image_memory: vk::DeviceMemory::null(),
_image_memory: vk::DeviceMemory::null(),
image_view: vk::ImageView::null(),
extent: vk::Extent3D {
width: self.extent.width,
Expand Down
3 changes: 1 addition & 2 deletions piet-gpu/Cargo.toml
Expand Up @@ -21,8 +21,7 @@ path = "../piet-gpu-hal"
path = "../piet-gpu-types"

[dependencies]
kurbo = "0.5.11"
piet = "0.0.12"
piet = "0.0.13"
png = "0.16.2"
rand = "0.7.3"
roxmltree = "0.11"
Expand Down
3 changes: 0 additions & 3 deletions piet-gpu/bin/cli.rs
Expand Up @@ -2,9 +2,6 @@ use std::fs::File;
use std::io::BufWriter;
use std::path::Path;


use piet::Color;

use piet_gpu_hal::vulkan::VkInstance;
use piet_gpu_hal::{CmdBuf, Device, Error, MemFlags};

Expand Down
1 change: 0 additions & 1 deletion piet-gpu/src/lib.rs
Expand Up @@ -8,7 +8,6 @@ use rand::{Rng, RngCore};
use piet::kurbo::{BezPath, Circle, Line, Point, Vec2};
use piet::{Color, RenderContext};

use piet_gpu_hal::vulkan::VkInstance;
use piet_gpu_hal::{CmdBuf, Device, Error, ImageLayout, MemFlags};

use pico_svg::PicoSvg;
Expand Down
4 changes: 2 additions & 2 deletions piet-gpu/src/pico_svg.rs
Expand Up @@ -4,7 +4,7 @@ use std::str::FromStr;

use roxmltree::Document;

use kurbo::BezPath;
use piet::kurbo::{Affine, BezPath};

use piet::{Color, RenderContext};

Expand Down Expand Up @@ -38,7 +38,7 @@ impl PicoSvg {
if el.is_element() {
let d = el.attribute("d").ok_or("missing 'd' attribute")?;
let bp = BezPath::from_svg(d)?;
let path = kurbo::Affine::scale(scale) * bp;
let path = Affine::scale(scale) * bp;
if let Some(fill_color) = el.attribute("fill") {
let color = parse_color(fill_color);
items.push(Item::Fill(FillItem { color, path: path.clone() }));
Expand Down
6 changes: 3 additions & 3 deletions piet-gpu/src/render_ctx.rs
Expand Up @@ -248,7 +248,7 @@ fn flatten_shape(
let mut points = Vec::new();
let mut start_pt = None;
let mut last_pt = None;
kurbo::flatten(path, TOLERANCE, |el| {
piet::kurbo::flatten(path, TOLERANCE, |el| {
match el {
PathEl::MoveTo(p) => {
let scene_pt = to_scene_point(p);
Expand Down Expand Up @@ -296,7 +296,7 @@ impl Text for PietGpuText {
&mut self,
_font: &Self::Font,
_text: &str,
_width: f64,
_width: impl Into<Option<f64>>,
) -> Self::TextLayoutBuilder {
unimplemented!();
}
Expand Down Expand Up @@ -325,7 +325,7 @@ impl TextLayout for PietGpuTextLayout {
0.0
}

fn update_width(&mut self, _new_width: f64) -> Result<(), Error> {
fn update_width(&mut self, _new_width: impl Into<Option<f64>>) -> Result<(), Error> {
unimplemented!()
}

Expand Down

0 comments on commit 8d01aba

Please sign in to comment.