Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
621 changes: 617 additions & 4 deletions crates/gpui/src/scene.rs

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion crates/gpui/src/styled.rs
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,12 @@ pub trait Styled: Sized {
self
}

/// Sets the blur radius applied to content behind this element.
/// Sets the blur extent applied to content behind this element.
///
/// The radius approximates the filter's three-sigma support. At render
/// scale, positive radii below the pyramid's roughly 3.7-device-pixel
/// minimum use that minimum. Non-positive and non-finite values disable
/// the effect.
fn backdrop_blur(mut self, blur_radius: Pixels) -> Self {
self.style().backdrop_blur = Some(blur_radius);
self
Expand Down
8 changes: 8 additions & 0 deletions crates/gpui/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3709,13 +3709,21 @@ impl Window {
}

/// Paint a backdrop blur region into the scene for the next frame.
///
/// `blur_radius` approximates the filter's three-sigma support. At render
/// scale, positive radii below the pyramid's roughly 3.7-device-pixel
/// minimum use that minimum.
pub fn paint_backdrop_blur(
&mut self,
bounds: Bounds<Pixels>,
corner_radii: Corners<Pixels>,
blur_radius: Pixels,
) {
self.invalidator.debug_assert_paint();
if !blur_radius.0.is_finite() || blur_radius <= Pixels::ZERO {
return;
}

let scale_factor = self.scale_factor();
let content_mask = self.content_mask();
self.next_frame.scene.insert_primitive(BackdropBlur {
Expand Down
Loading
Loading