Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: backdrop blurring and blend modes #924

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

Tropix126
Copy link
Contributor

This PR adds two new properties:

  • backdrop_blur, which applies a blur effect to the contents behind a rect's background.
  • blend_mode, which allows you to change the interaction between an element's colors and the contents behind it.

Todo

  • Figure out why these two properties don't like to work together (blur doesn't apply on blend modes). This is either an implementation detail of skia leaking through (this same bug occurs on chromium, actually) or it's me misunderstanding how layer saving works.
  • Verify that backdrop_blur works with opacity.
  • examples
  • docs

@Tropix126 Tropix126 requested a review from marc2332 as a code owner September 26, 2024 03:23
@Tropix126 Tropix126 marked this pull request as draft September 26, 2024 03:24
@marc2332 marc2332 added the enhancement 🔥 New feature or request label Sep 26, 2024
@marc2332 marc2332 added this to the 0.3.0 milestone Sep 26, 2024
Copy link

codecov bot commented Sep 28, 2024

Codecov Report

Attention: Patch coverage is 0% with 96 lines in your changes missing coverage. Please review.

Project coverage is 75.71%. Comparing base (3078a28) to head (fe3a064).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
crates/core/src/elements/rect.rs 0.00% 45 Missing ⚠️
crates/state/src/values/blend_mode.rs 0.00% 33 Missing ⚠️
crates/core/src/render/pipeline.rs 0.00% 10 Missing ⚠️
crates/state/src/style.rs 0.00% 6 Missing ⚠️
crates/native-core/src/attributes.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #924      +/-   ##
==========================================
- Coverage   75.99%   75.71%   -0.28%     
==========================================
  Files         207      208       +1     
  Lines       23775    23861      +86     
==========================================
  Hits        18067    18067              
- Misses       5708     5794      +86     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🔥 New feature or request
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants