mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-08-04 05:18:19 +00:00
Correctly apply transforms to vector data and strokes (#1977)
* Fix adding a layer to a transformed group * Fix assorted transform issues * Default stroke transform * Fix bench * Transform gradient * Gradient fix * Add gradient reversal buttons to Fill node in the Properties panel --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
parent
2fa8773092
commit
dd4a97b09f
19 changed files with 152 additions and 59 deletions
|
@ -1,9 +1,11 @@
|
|||
use graph_craft::document::NodeNetwork;
|
||||
#[cfg(any(feature = "criterion", feature = "iai"))]
|
||||
use graph_craft::{document::NodeNetwork, graphene_compiler::Compiler, proto::ProtoNetwork};
|
||||
use graph_craft::graphene_compiler::Compiler;
|
||||
#[cfg(any(feature = "criterion", feature = "iai"))]
|
||||
use graph_craft::proto::ProtoNetwork;
|
||||
|
||||
#[cfg(feature = "criterion")]
|
||||
use criterion::{black_box, criterion_group, criterion_main, Criterion};
|
||||
|
||||
#[cfg(all(not(feature = "criterion"), feature = "iai"))]
|
||||
use iai_callgrind::{black_box, library_benchmark, library_benchmark_group, main};
|
||||
|
||||
|
@ -18,7 +20,6 @@ fn compile(network: NodeNetwork) -> ProtoNetwork {
|
|||
let compiler = Compiler {};
|
||||
compiler.compile_single(network).unwrap()
|
||||
}
|
||||
|
||||
#[cfg(all(not(feature = "criterion"), feature = "iai"))]
|
||||
fn load_from_name(name: &str) -> NodeNetwork {
|
||||
let content = std::fs::read(&format!("../../demo-artwork/{name}.graphite")).expect("failed to read file");
|
||||
|
@ -27,7 +28,6 @@ fn load_from_name(name: &str) -> NodeNetwork {
|
|||
black_box(compile(black_box(network)));
|
||||
load_network(content)
|
||||
}
|
||||
|
||||
#[cfg(feature = "criterion")]
|
||||
fn compile_to_proto(c: &mut Criterion) {
|
||||
let artworks = glob::glob("../../demo-artwork/*.graphite").expect("failed to read glob pattern");
|
||||
|
@ -42,17 +42,15 @@ fn compile_to_proto(c: &mut Criterion) {
|
|||
|
||||
#[cfg_attr(all(feature = "iai", not(feature = "criterion")), library_benchmark)]
|
||||
#[cfg_attr(all(feature = "iai", not(feature="criterion")), benches::with_setup(args = ["isometric-fountain", "painted-dreams", "procedural-string-lights", "red-dress", "valley-of-spires"], setup = load_from_name))]
|
||||
#[cfg(all(not(feature = "criterion"), feature = "iai"))]
|
||||
pub fn iai_compile_to_proto(input: NodeNetwork) {
|
||||
black_box(compile(input));
|
||||
pub fn iai_compile_to_proto(_input: NodeNetwork) {
|
||||
#[cfg(all(feature = "iai", not(feature = "criterion")))]
|
||||
black_box(compile(_input));
|
||||
}
|
||||
|
||||
#[cfg(feature = "criterion")]
|
||||
criterion_group!(benches, compile_to_proto);
|
||||
|
||||
#[cfg(feature = "criterion")]
|
||||
criterion_main!(benches);
|
||||
|
||||
#[cfg(all(not(feature = "criterion"), feature = "iai"))]
|
||||
library_benchmark_group!(name = compile_group; benchmarks = iai_compile_to_proto);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue