Skip to content

Commit

Permalink
Migrate to using raw_resource_handle
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys committed Nov 29, 2024
1 parent 8d8c3d3 commit 88fc88c
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 214 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ This release has an [MSRV] of 1.82.
- `Image` now stores the alpha as an `f32` ([#65][] by [@waywardmonkeys][])
- Use `color` crate. See below for details ([#63][] by [@waywardmonkeys][])
- `Gradient`, `Image`, `Brush` now have `with_alpha` and `Gradient` also gets a `multiply_alpha` ([#67][] by [@waywardmonkeys][])
- `Blob`, `Font`, and `WeakBlob` have been moved to the new `raw_resource_handle` crate ([#68][] by [@waywardmonkeys][])

### Color Changes

Expand All @@ -39,6 +40,13 @@ This leads to a number of breaking changes:

This is the first step towards providing better support for richer color functionality throughout the Linebender stack.

### Raw Resource Changes

Having the `Blob`, `Font`, and `WeakBlob` types in this crate created difficulties in versioning for other crates like Parley.
We've now moved these to a dedicated shared crate so that we can remove the dependency on Peniko from Parley and make managing versions between Vello and other crates easier.

The types are no longer available at the top level of this crate, but the `raw_resource_handle` crate is re-exported and they can be accessed from there.

## [0.2.0][] (2024-09-19)

This release has an [MSRV] of 1.70.
Expand Down
6 changes: 6 additions & 0 deletions Cargo.lock

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

8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ targets = []

[features]
default = ["std"]
std = ["color/std", "kurbo/std"]
std = ["color/std", "kurbo/std", "raw_resource_handle/std"]
libm = ["color/libm", "kurbo/libm"]
mint = ["kurbo/mint"]
serde = ["color/serde", "smallvec/serde", "kurbo/serde", "dep:serde_bytes", "dep:serde"]
Expand All @@ -36,6 +36,12 @@ rev = "bccd4050607eba830cfba3b2f39616a27500288a"
version = "0.1.0"
default-features = false

[dependencies.raw_resource_handle]
git = "https://github.com/linebender/raw_resource_handle.git"
rev = "2a5cab3a137eff660baf99f9edeff87c5306e5d4"
version = "0.1.0"
default-features = false

[dependencies.serde]
version = "1.0.210"
optional = true
Expand Down
187 changes: 0 additions & 187 deletions src/blob.rs

This file was deleted.

21 changes: 0 additions & 21 deletions src/font.rs

This file was deleted.

4 changes: 3 additions & 1 deletion src/image.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Copyright 2022 the Peniko Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use super::{Blob, Extend};
use crate::Extend;

use raw_resource_handle::Blob;

/// Defines the pixel format of an [image](Image).
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
Expand Down
7 changes: 3 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@
)]

mod blend;
mod blob;
mod brush;
mod font;
mod gradient;
mod image;
mod style;
Expand All @@ -40,10 +38,11 @@ pub use color;
/// Re-export of the kurbo 2D curve library.
pub use kurbo;

/// Re-export of the raw resource handle library.
pub use raw_resource_handle;

pub use blend::{BlendMode, Compose, Mix};
pub use blob::{Blob, WeakBlob};
pub use brush::{Brush, BrushRef, Extend};
pub use font::Font;
pub use gradient::{ColorStop, ColorStops, ColorStopsSource, Gradient, GradientKind};
pub use image::{Format, Image};
pub use style::{Fill, Style, StyleRef};
Expand Down

0 comments on commit 88fc88c

Please sign in to comment.