2022-11-19 10:45:42 -06:00
|
|
|
// SPDX-License-Identifier: Apache-2.0 OR MIT OR Unlicense
|
|
|
|
|
2022-11-10 19:48:36 -08: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-29 13:28:25 -05:00
|
|
|
struct ClipInp {
|
2022-11-29 14:52:03 -05:00
|
|
|
// Index of the draw object.
|
2022-11-29 13:28:25 -05:00
|
|
|
ix: u32,
|
2022-11-29 14:52:03 -05: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-29 13:28:25 -05:00
|
|
|
path_ix: i32,
|
|
|
|
}
|
|
|
|
|
2022-11-10 19:48:36 -08:00
|
|
|
struct ClipEl {
|
|
|
|
parent_ix: u32,
|
|
|
|
bbox: vec4<f32>,
|
|
|
|
}
|