Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: linebender/vello
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3f56e51fae1322ad6958135b0c8d1e29501f0e8c
Choose a base ref
..
head repository: linebender/vello
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7bfca34d0244f24982f36f5fc2179a73242e3d0f
Choose a head ref
Showing with 5 additions and 5 deletions.
  1. +5 −5 crates/encoding/src/estimate.rs
10 changes: 5 additions & 5 deletions crates/encoding/src/estimate.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 The Vello authors
// Copyright 2024 the Vello authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

//! This utility provides conservative size estimation for buffer allocations backing
@@ -243,10 +243,10 @@ fn transform_scale(t: Option<&Transform>) -> f32 {
/// For recursive subdivisions that split a curve into 2 segments at each level, the minimum number
/// of segments is given by 2^l. From the formula above it follows that:
///
/// segments >= 2^l >= 2^log_4(x) (1)
/// segments^2 >= 2^(2*log_4(x)) >= 4^log_4(x) (2)
/// segments^2 >= x
/// segments >= sqrt((n * (n - 1) * m) / (8 * tol)) (3)
/// segments >= 2^l >= 2^log_4(x) (1)
/// segments^2 >= 2^(2*log_4(x)) >= 4^log_4(x) (2)
/// segments^2 >= x
/// segments >= sqrt((n * (n - 1) * m) / (8 * tol)) (3)
///
/// Wang's formula computes an error bound on recursive subdivision based on the second derivative
/// which tends to result in a suboptimal estimate when the curvature within the curve has a lot of