From adf49ab9327052a8b24d60c0f6676097eb67817b Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 10 Jan 2019 10:01:21 -0800 Subject: [PATCH] Rename `path-utils` to `geometry` --- Cargo.lock | 28 +++++++++---------- Cargo.toml | 2 +- demo/server/Cargo.toml | 6 ++-- demo/server/src/main.rs | 10 +++---- {path-utils => geometry}/Cargo.toml | 4 +-- {path-utils => geometry}/src/clip.rs | 4 +-- .../src/cubic_to_quadratic.rs | 4 +-- {path-utils => geometry}/src/lib.rs | 8 +++--- {path-utils => geometry}/src/normals.rs | 4 +-- {path-utils => geometry}/src/orientation.rs | 4 +-- {path-utils => geometry}/src/segments.rs | 4 +-- {path-utils => geometry}/src/stroke.rs | 4 +-- {path-utils => geometry}/src/transform.rs | 4 +-- partitioner/Cargo.toml | 4 +-- partitioner/src/builder.rs | 2 +- partitioner/src/lib.rs | 2 +- partitioner/src/mesh.rs | 4 +-- utils/frontend/Cargo.toml | 6 ++-- utils/frontend/src/main.rs | 8 +++--- utils/tile-svg/Cargo.toml | 4 +-- utils/tile-svg/src/main.rs | 2 +- 21 files changed, 59 insertions(+), 59 deletions(-) rename {path-utils => geometry}/Cargo.toml (75%) rename {path-utils => geometry}/src/clip.rs (97%) rename {path-utils => geometry}/src/cubic_to_quadratic.rs (97%) rename {path-utils => geometry}/src/lib.rs (72%) rename {path-utils => geometry}/src/normals.rs (98%) rename {path-utils => geometry}/src/orientation.rs (94%) rename {path-utils => geometry}/src/segments.rs (99%) rename {path-utils => geometry}/src/stroke.rs (98%) rename {path-utils => geometry}/src/transform.rs (95%) diff --git a/Cargo.lock b/Cargo.lock index a63eea90..51e2f698 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -961,8 +961,18 @@ dependencies = [ "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)", "font-kit 0.1.0 (git+https://github.com/pcwalton/font-kit)", "lyon_path 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pathfinder_geometry 0.3.0", "pathfinder_partitioner 0.2.0", - "pathfinder_path_utils 0.2.0", +] + +[[package]] +name = "pathfinder_geometry" +version = "0.3.0" +dependencies = [ + "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "lyon_path 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -986,17 +996,7 @@ dependencies = [ "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "lyon_geom 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", "lyon_path 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pathfinder_path_utils 0.2.0", - "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "pathfinder_path_utils" -version = "0.2.0" -dependencies = [ - "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "lyon_path 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pathfinder_geometry 0.3.0", "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1019,8 +1019,8 @@ dependencies = [ "lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "lyon_geom 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", "lyon_path 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pathfinder_geometry 0.3.0", "pathfinder_partitioner 0.2.0", - "pathfinder_path_utils 0.2.0", "rocket 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "rocket_codegen 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "rocket_contrib 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1535,7 +1535,7 @@ dependencies = [ "jemallocator 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "lyon_geom 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", "lyon_path 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pathfinder_path_utils 0.2.0", + "pathfinder_geometry 0.3.0", "quickcheck 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 0ad4ec38..ededb848 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,8 @@ [workspace] members = [ + "geometry", "gfx-utils", "partitioner", - "path-utils", "demo/server", "utils/area-lut", "utils/frontend", diff --git a/demo/server/Cargo.toml b/demo/server/Cargo.toml index d1281dcb..b6eb1584 100644 --- a/demo/server/Cargo.toml +++ b/demo/server/Cargo.toml @@ -42,11 +42,11 @@ git = "https://github.com/servo/fontsan.git" [dependencies.font-kit] git = "https://github.com/pcwalton/font-kit" +[dependencies.pathfinder_geometry] +path = "../../geometry" + [dependencies.pathfinder_partitioner] path = "../../partitioner" -[dependencies.pathfinder_path_utils] -path = "../../path-utils" - [patch.crates-io] ring = { git = "https://github.com/SergioBenitez/ring", branch = "v0.12" } diff --git a/demo/server/src/main.rs b/demo/server/src/main.rs index 260cfcbe..3442427b 100644 --- a/demo/server/src/main.rs +++ b/demo/server/src/main.rs @@ -21,8 +21,8 @@ extern crate image; extern crate lru_cache; extern crate lyon_geom; extern crate lyon_path; +extern crate pathfinder_geometry; extern crate pathfinder_partitioner; -extern crate pathfinder_path_utils; extern crate rocket; extern crate rocket_contrib; @@ -46,14 +46,14 @@ use image::{DynamicImage, ImageBuffer, ImageFormat, ImageRgba8}; use lru_cache::LruCache; use lyon_path::PathEvent; use lyon_path::builder::{FlatPathBuilder, PathBuilder}; +use pathfinder_geometry::cubic_to_quadratic::CubicToQuadraticTransformer; +use pathfinder_geometry::stroke::{StrokeStyle, StrokeToFillIter}; +use pathfinder_geometry::transform::Transform2DPathIter; use lyon_path::iterator::PathIter; use pathfinder_partitioner::FillRule; use pathfinder_partitioner::mesh::Mesh; use pathfinder_partitioner::mesh_pack::MeshPack; use pathfinder_partitioner::partitioner::Partitioner; -use pathfinder_path_utils::cubic_to_quadratic::CubicToQuadraticTransformer; -use pathfinder_path_utils::stroke::{StrokeStyle, StrokeToFillIter}; -use pathfinder_path_utils::transform::Transform2DPathIter; use rocket::http::{ContentType, Header, Status}; use rocket::request::Request; use rocket::response::{NamedFile, Redirect, Responder, Response}; @@ -844,7 +844,7 @@ fn main() { mod tiling { use euclid::{Point2D, Rect, Size2D, Vector2D}; use lyon_path::PathEvent; - use pathfinder_path_utils::clip::RectClipper; + use pathfinder_geometry::clip::RectClipper; use std::f32; use std::mem; diff --git a/path-utils/Cargo.toml b/geometry/Cargo.toml similarity index 75% rename from path-utils/Cargo.toml rename to geometry/Cargo.toml index 097741ca..fe93bd3a 100644 --- a/path-utils/Cargo.toml +++ b/geometry/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "pathfinder_path_utils" -version = "0.2.0" +name = "pathfinder_geometry" +version = "0.3.0" authors = ["Patrick Walton "] [dependencies] diff --git a/path-utils/src/clip.rs b/geometry/src/clip.rs similarity index 97% rename from path-utils/src/clip.rs rename to geometry/src/clip.rs index 8a71b2e9..bfc6bbef 100644 --- a/path-utils/src/clip.rs +++ b/geometry/src/clip.rs @@ -1,6 +1,6 @@ -// pathfinder/partitioner/src/clip.rs +// pathfinder/geometry/src/clip.rs // -// Copyright © 2018 The Pathfinder Project Developers. +// Copyright © 2019 The Pathfinder Project Developers. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/path-utils/src/cubic_to_quadratic.rs b/geometry/src/cubic_to_quadratic.rs similarity index 97% rename from path-utils/src/cubic_to_quadratic.rs rename to geometry/src/cubic_to_quadratic.rs index daf23ad9..924f91fe 100644 --- a/path-utils/src/cubic_to_quadratic.rs +++ b/geometry/src/cubic_to_quadratic.rs @@ -1,6 +1,6 @@ -// pathfinder/partitioner/src/cubic_to_quadratic.rs +// pathfinder/geometry/src/cubic_to_quadratic.rs // -// Copyright © 2018 The Pathfinder Project Developers. +// Copyright © 2019 The Pathfinder Project Developers. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/path-utils/src/lib.rs b/geometry/src/lib.rs similarity index 72% rename from path-utils/src/lib.rs rename to geometry/src/lib.rs index 711c63cd..0dde3fda 100644 --- a/path-utils/src/lib.rs +++ b/geometry/src/lib.rs @@ -1,6 +1,6 @@ -// pathfinder/path-utils/src/lib.rs +// pathfinder/geometry/src/lib.rs // -// Copyright © 2018 The Pathfinder Project Developers. +// Copyright © 2019 The Pathfinder Project Developers. // // Licensed under the Apache License, Version 2.0 or the MIT license @@ -8,9 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -//! Various utilities for manipulating Bézier curves. +//! Utilities for Bézier curves. //! -//! Most of these should go upstream to Lyon at some point. +//! These may be merged into upstream Lyon eventually. extern crate arrayvec; extern crate lyon_path; diff --git a/path-utils/src/normals.rs b/geometry/src/normals.rs similarity index 98% rename from path-utils/src/normals.rs rename to geometry/src/normals.rs index ee56ccae..dda127a8 100644 --- a/path-utils/src/normals.rs +++ b/geometry/src/normals.rs @@ -1,6 +1,6 @@ -// pathfinder/path-utils/src/normals.rs +// pathfinder/geometry/src/normals.rs // -// Copyright © 2018 The Pathfinder Project Developers. +// Copyright © 2019 The Pathfinder Project Developers. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/path-utils/src/orientation.rs b/geometry/src/orientation.rs similarity index 94% rename from path-utils/src/orientation.rs rename to geometry/src/orientation.rs index e004048b..00216d1b 100644 --- a/path-utils/src/orientation.rs +++ b/geometry/src/orientation.rs @@ -1,6 +1,6 @@ -// pathfinder/path-utils/src/orientation.rs +// pathfinder/geometry/src/orientation.rs // -// Copyright © 2018 The Pathfinder Project Developers. +// Copyright © 2019 The Pathfinder Project Developers. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/path-utils/src/segments.rs b/geometry/src/segments.rs similarity index 99% rename from path-utils/src/segments.rs rename to geometry/src/segments.rs index c43a43c6..3a9a682c 100644 --- a/path-utils/src/segments.rs +++ b/geometry/src/segments.rs @@ -1,6 +1,6 @@ -// pathfinder/path-utils/src/segments.rs +// pathfinder/geometry/src/segments.rs // -// Copyright © 2018 The Pathfinder Project Developers. +// Copyright © 2019 The Pathfinder Project Developers. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/path-utils/src/stroke.rs b/geometry/src/stroke.rs similarity index 98% rename from path-utils/src/stroke.rs rename to geometry/src/stroke.rs index 069646e3..505f0137 100644 --- a/path-utils/src/stroke.rs +++ b/geometry/src/stroke.rs @@ -1,6 +1,6 @@ -// pathfinder/path-utils/src/stroke.rs +// pathfinder/geometry/src/stroke.rs // -// Copyright © 2018 The Pathfinder Project Developers. +// Copyright © 2019 The Pathfinder Project Developers. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/path-utils/src/transform.rs b/geometry/src/transform.rs similarity index 95% rename from path-utils/src/transform.rs rename to geometry/src/transform.rs index 004a03c1..e3c75f3e 100644 --- a/path-utils/src/transform.rs +++ b/geometry/src/transform.rs @@ -1,6 +1,6 @@ -// pathfinder/path-utils/src/transform.rs +// pathfinder/geometry/src/transform.rs // -// Copyright © 2018 The Pathfinder Project Developers. +// Copyright © 2019 The Pathfinder Project Developers. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/partitioner/Cargo.toml b/partitioner/Cargo.toml index ef707246..d9bc9568 100644 --- a/partitioner/Cargo.toml +++ b/partitioner/Cargo.toml @@ -23,5 +23,5 @@ serde_derive = "1.0" version = "0.19" features = ["serde"] -[dependencies.pathfinder_path_utils] -path = "../path-utils" +[dependencies.pathfinder_geometry] +path = "../geometry" diff --git a/partitioner/src/builder.rs b/partitioner/src/builder.rs index 1a391745..4790f0f4 100644 --- a/partitioner/src/builder.rs +++ b/partitioner/src/builder.rs @@ -12,7 +12,7 @@ use arrayvec::ArrayVec; use euclid::{Angle, Point2D, Vector2D}; use lyon_geom::{CubicBezierSegment, QuadraticBezierSegment}; use lyon_path::builder::{FlatPathBuilder, PathBuilder}; -use pathfinder_path_utils::cubic_to_quadratic::CubicToQuadraticSegmentIter; +use pathfinder_builder::cubic_to_quadratic::CubicToQuadraticSegmentIter; use std::ops::Range; const TANGENT_PARAMETER_TOLERANCE: f32 = 0.001; diff --git a/partitioner/src/lib.rs b/partitioner/src/lib.rs index 07c9cc06..edbd5697 100644 --- a/partitioner/src/lib.rs +++ b/partitioner/src/lib.rs @@ -28,7 +28,7 @@ extern crate byteorder; extern crate env_logger; extern crate euclid; extern crate lyon_path; -extern crate pathfinder_path_utils; +extern crate pathfinder_geometry; extern crate serde; use lyon_path::geom as lyon_geom; diff --git a/partitioner/src/mesh.rs b/partitioner/src/mesh.rs index f61b43d6..0dd0943d 100644 --- a/partitioner/src/mesh.rs +++ b/partitioner/src/mesh.rs @@ -11,8 +11,8 @@ use euclid::approxeq::ApproxEq; use euclid::{Point2D, Rect, Size2D, Vector2D}; use lyon_path::PathEvent; -use pathfinder_path_utils::normals::PathNormals; -use pathfinder_path_utils::segments::{self, SegmentIter}; +use pathfinder_geometry::normals::PathNormals; +use pathfinder_geometry::segments::{self, SegmentIter}; use std::f32; use std::u32; diff --git a/utils/frontend/Cargo.toml b/utils/frontend/Cargo.toml index 3795e482..88d24ab8 100644 --- a/utils/frontend/Cargo.toml +++ b/utils/frontend/Cargo.toml @@ -11,8 +11,8 @@ lyon_path = "0.12" git = "https://github.com/pcwalton/font-kit" features = ["loader-freetype-default"] +[dependencies.pathfinder_geometry] +path = "../../geometry" + [dependencies.pathfinder_partitioner] path = "../../partitioner" - -[dependencies.pathfinder_path_utils] -path = "../../path-utils" diff --git a/utils/frontend/src/main.rs b/utils/frontend/src/main.rs index 1d9f1833..131927ba 100644 --- a/utils/frontend/src/main.rs +++ b/utils/frontend/src/main.rs @@ -26,8 +26,8 @@ extern crate clap; extern crate font_kit; extern crate lyon_path; +extern crate pathfinder_geometry; extern crate pathfinder_partitioner; -extern crate pathfinder_path_utils; use clap::{App, Arg}; use font_kit::font::Font; @@ -35,9 +35,9 @@ use font_kit::hinting::HintingOptions; use lyon_path::PathEvent; use lyon_path::builder::{FlatPathBuilder, PathBuilder}; use lyon_path::default::Path as LyonPath; -use pathfinder_partitioner::FillRule; -use pathfinder_partitioner::mesh_pack::MeshPack; -use pathfinder_partitioner::partitioner::Partitioner; +use pathfinder_geometry::FillRule; +use pathfinder_geometry::mesh_pack::MeshPack; +use pathfinder_geometry::partitioner::Partitioner; use std::fs::File; use std::path::{Path, PathBuf}; use std::process; diff --git a/utils/tile-svg/Cargo.toml b/utils/tile-svg/Cargo.toml index ea7bd086..1a49510a 100644 --- a/utils/tile-svg/Cargo.toml +++ b/utils/tile-svg/Cargo.toml @@ -19,8 +19,8 @@ simdeez = "0.4" svgtypes = "0.3" usvg = "0.4" -[dependencies.pathfinder_path_utils] -path = "../../path-utils" +[dependencies.pathfinder_geometry] +path = "../../geometry" [dev-dependencies] quickcheck = "0.7" diff --git a/utils/tile-svg/src/main.rs b/utils/tile-svg/src/main.rs index 173ed7f4..68811838 100644 --- a/utils/tile-svg/src/main.rs +++ b/utils/tile-svg/src/main.rs @@ -28,7 +28,7 @@ use lyon_geom::math::Transform; use lyon_geom::{CubicBezierSegment, QuadraticBezierSegment}; use lyon_path::PathEvent; use lyon_path::iterator::PathIter; -use pathfinder_path_utils::stroke::{StrokeStyle, StrokeToFillIter}; +use pathfinder_geometry::stroke::{StrokeStyle, StrokeToFillIter}; use rayon::ThreadPoolBuilder; use rayon::iter::{IndexedParallelIterator, IntoParallelRefIterator, ParallelIterator}; use simdeez::Simd;