1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! Cutouts patterns act a mask on top of already rendered content.
//!
//! Their main purpose is to "punch a hole" in the current layer so that
//! an underlay layer can be seen through it.
//! The clip chain controls the shape of the mask. When rendering the
//! cutout, opaque white means pixels will be fully masked, transparent
//! black means pixels will be shown, and values in between represent
//! different levels of transparency.
use ;
use crate;
use crateBlendMode;
;
// TODO: Cutouts are applied to the destination layer entirely in the alpha
// pass, the fully masked segments could be drawn in the opaque pass.
// TODO: Currently, complex masks for cutouts are drawn into intermediate
// surfaces using the same logic as regular patterns. They could be drawn
// directly into the the destination layer.