2022-11-20 03:45:42 +11:00
|
|
|
// SPDX-License-Identifier: Apache-2.0 OR MIT OR Unlicense
|
|
|
|
|
2022-11-11 14:48:36 +11:00
|
|
|
struct Bic {
|
|
|
|
a: u32,
|
|
|
|
b: u32,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn bic_combine(x: Bic, y: Bic) -> Bic {
|
|
|
|
let m = min(x.b, y.a);
|
|
|
|
return Bic(x.a + y.a - m, x.b + y.b - m);
|
|
|
|
}
|
|
|
|
|
2022-11-30 05:28:25 +11:00
|
|
|
struct ClipInp {
|
2022-11-30 06:52:03 +11:00
|
|
|
// Index of the draw object.
|
2022-11-30 05:28:25 +11:00
|
|
|
ix: u32,
|
2022-11-30 06:52:03 +11:00
|
|
|
// This is a packed encoding of an enum with the sign bit as the tag. If positive,
|
|
|
|
// this entry is a BeginClip and contains the associated path index. If negative,
|
|
|
|
// it is an EndClip and contains the bitwise-not of the EndClip draw object index.
|
2022-11-30 05:28:25 +11:00
|
|
|
path_ix: i32,
|
|
|
|
}
|
|
|
|
|
2022-11-11 14:48:36 +11:00
|
|
|
struct ClipEl {
|
|
|
|
parent_ix: u32,
|
|
|
|
bbox: vec4<f32>,
|
|
|
|
}
|