You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9517b00
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: node-graph/libraries/graphic-types/src/effect_layers.rs
+65-8Lines changed: 65 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,8 @@ pub enum PiecePlace {
22
22
IntoContent{over:bool},
23
23
/// The part of an interior piece blending with what shows through the content's fill, in a layer of its mode beneath the content's, or with `over`, over it.
24
24
Through{over:bool},
25
+
/// What lies beneath the content, filtered and cut to its silhouette, at the bottom of the content's own layer.
26
+
Backdrop,
25
27
}
26
28
27
29
/// One coverage of an effect that draws as a piece of its own, named like the map of it.
@@ -115,10 +117,16 @@ impl EffectLayers {
115
117
.chain([(LayerPart::Content, blend_mode)])
116
118
.collect();
117
119
118
-
// A shadow not knocked out in the content's layer, flattened or layered, would hide a part placed beneath that layer
120
+
// A blurred backdrop, or a shadow not knocked out (flattened or layered), in the content's layer would hide a part placed beneath that layer
121
+
let backdrop:Vec<LayerPart> = pieces_from(0, operations.len())
// Interior pieces of normal content blend within its share, in its layer. Below a full fill, a blended one splits off its part through the fill into a layer beneath
124
132
// the content's, or over it when its mode isn't straight along what lies beneath or a shadow covers that, as every later piece then does to keep their order.
// One normal layer at a full fill draws the same with all its effects flattened into the content's image, which takes fewer passes
170
-
if blends_into_content && matches!(layers.as_slice(),[layer]if layer.blend_mode == BlendMode::Normal){
177
+
// One normal layer at a full fill draws the same with all its effects flattened into the content's image, which takes fewer passes, unless it blurs what lies beneath
178
+
if blends_into_content && backdrop.is_empty() && matches!(layers.as_slice(),[layer]if layer.blend_mode == BlendMode::Normal){
171
179
let content = EffectLayer{
172
180
blend_mode:BlendMode::Normal,
173
181
parts:vec![LayerPart::Content],
@@ -179,6 +187,11 @@ impl EffectLayers {
179
187
};
180
188
}
181
189
190
+
// What lies beneath, filtered, goes at the bottom of the content's own layer, which fades and blends it with the content, even from a row flattened into the content
/// Whether an effect row can draw as layered pieces, rather than being carried out within the content's image.
267
292
/// Blurs, adjustments, masks, and feathers process the pixels of everything before them, and blend modes CSS lacks can't blend against the backdrop in SVG or a GPU layer,
268
293
/// though interior pieces that `blend_into_content` blend with the content alone, which the renderers do themselves.
/// How far past the content the effects together can paint, in the effect space of a run of them.
458
+
/// How far past the content the effects together can paint, or a background blur among them reads what lies beneath, in the effect space of a run of them.
456
459
/// It leaves out what [`Effects::reach_around`] adds from the content's bounds and what it paints past its frame, for the effects relative to its extent.
/// Whether this operation reads the pixels around each one of the image the effects before it leave, like a blur or a warp, rather than casting from the content's shape or changing each pixel alone.
0 commit comments