Skip to content

⚡ Render eligible frame drop shadows without filter surfaces - #11260

Open
superalex wants to merge 8 commits into
developfrom
superalex-frame-shadow-happy-path
Open

⚡ Render eligible frame drop shadows without filter surfaces#11260
superalex wants to merge 8 commits into
developfrom
superalex-frame-shadow-happy-path

Conversation

@superalex

@superalex superalex commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

What

  • Large clipped frames with drop shadows were expensive to pan/zoom because each shadow went through filter surfaces, per-child silhouettes, and a full-surface blur saveLayer.
  • Eligible frames now render the drop shadow from container geometry only, with a tightly bounded blur layer.

Why

  • Frame drop shadows at high zoom were dominated by Gaussian blur over the whole DropShadows surface plus descendant silhouette work that does not change the visible result when children stay inside a filled, axis-aligned frame.
  • Clipped frames already hide overflow, so walking every descendant extrect on each tile was extra CPU for the common case.

How

  • Fast path: filled, axis-aligned frames without layer/background blur use render_frame_container_drop_shadow (rrect + blur saveLayer on DropShadows) instead of filter surfaces and child silhouettes.
  • Blur bounds: the blur saveLayer uses compute_fast_bounds so Skia does not allocate the offscreen layer to the full surface clip.
  • Clipped frames: skip the descendant extrect walk; still reject the fast path when a descendant has its own drop shadow.
  • Overflow frames: still require descendants to be contained in the frame selrect.
  • Strokes: the fast path shadows fill geometry only, so outer/center strokes can look slightly narrower than the slow path; those frames stay eligible for performance.

@penpot-triage penpot-triage Bot added the needs triage Issues that need to be reviewed by the product team label Aug 18, 2026
@penpot-triage penpot-triage Bot added this to Main Aug 18, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in Main Aug 18, 2026
@superalex superalex added IOP render Tasks related to the new render initiative no qa QA team does not need to be involved no changelog Auxiliar label for mark issues that should not appear on the changelog (automatic generation) no issue required Indicates that the PR dos not needs an issue WG performance and removed needs triage Issues that need to be reviewed by the product team labels Aug 18, 2026
@superalex superalex added this to the 2.19.0 milestone Aug 18, 2026
@superalex
superalex marked this pull request as draft August 18, 2026 06:34
@superalex
superalex force-pushed the superalex-frame-shadow-happy-path branch 5 times, most recently from b25d85d to 8fde76f Compare August 18, 2026 06:55
@superalex
superalex marked this pull request as ready for review August 18, 2026 06:55
@superalex
superalex force-pushed the superalex-frame-shadow-happy-path branch from 8fde76f to 2331f98 Compare August 18, 2026 07:04
@elenatorro elenatorro self-assigned this Aug 18, 2026
@superalex
superalex force-pushed the superalex-frame-shadow-happy-path branch 4 times, most recently from be1ce2b to d0f084a Compare August 19, 2026 07:46
@belen-albeza
belen-albeza marked this pull request as draft August 19, 2026 08:20
@superalex
superalex force-pushed the superalex-frame-shadow-happy-path branch from d0f084a to 88ba49c Compare August 19, 2026 08:38
@superalex
superalex marked this pull request as ready for review August 19, 2026 08:45
@superalex
superalex force-pushed the superalex-frame-shadow-happy-path branch from 88ba49c to a8cf55d Compare August 19, 2026 10:10
Add a direct container-geometry path for frames with fill whose
descendants stay inside the frame bounds. This skips the filter
surface and per-child silhouette passes, drawing the frame shape on
DropShadows with a blur saveLayer instead. Tighten the blur saveLayer
to compute_fast_bounds so Skia does not allocate the full surface.
When clip_content is true, clipped frames only need a lightweight
check for nested drop shadows before using the direct container path.
Overflow frames still walk descendant extrects for containment.

Document that visible strokes can make the fast-path shadow slightly
narrower than the slow path; we keep those frames eligible for speed.
HQ tiles are 512px and the atlas stays at 4096² (64 full-size
slots). Browser zoom plus a forced ?dpr= can need more visible
tiles than that, and a framebuffer larger than the GPU allows.

Pack interest tiles into smaller atlas cells, blit at 512 then
scale, and inset Linear samples so seams do not bleed. Clamp the
canvas backing store and DPR together, wrap Skia at the real
drawingBuffer size, and wait one frame after DPR changes so CSS
client size and overlays stay aligned.
During view gestures, fast mode renders tiles without shadows or blur.
Writing those tiles into the doc/tile atlas left shadowless patches when
render_from_cache overlayed them on the scaled preview. Keep the last HQ
atlas tiles until the post-gesture full-quality render completes.
@superalex
superalex force-pushed the superalex-frame-shadow-happy-path branch from fa06518 to f882836 Compare August 19, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

IOP render Tasks related to the new render initiative no changelog Auxiliar label for mark issues that should not appear on the changelog (automatic generation) no issue required Indicates that the PR dos not needs an issue no qa QA team does not need to be involved WG performance

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants