Skip to content

vello_common: compute the transparency hint in ImageSource::from_peniko_image_data#1760

Queued
tronical wants to merge 1 commit into
linebender:mainfrom
slint-ui:simon/opaque-images
Queued

vello_common: compute the transparency hint in ImageSource::from_peniko_image_data#1760
tronical wants to merge 1 commit into
linebender:mainfrom
slint-ui:simon/opaque-images

Conversation

@tronical

Copy link
Copy Markdown

The conversion built the Pixmap via from_parts(), which conservatively marks every image as possibly transparent. As a result, images supplied as peniko::ImageData never hit the FillHint::OpaqueImage fast path in the coarse rasterizer (skipping per-pixel blending and occluding commands underneath), even when they are fully opaque.

The conversion already visits every pixel to premultiply, so track whether any alpha value is not 255 in the same loop and construct the Pixmap with from_parts_with_opacity().

This PR was done with assistance of Claude Code.

…ko_image_data

The conversion built the Pixmap via from_parts(), which conservatively
marks every image as possibly transparent. As a result, images supplied
as peniko::ImageData never hit the FillHint::OpaqueImage fast path in
the coarse rasterizer (skipping per-pixel blending and occluding
commands underneath), even when they are fully opaque.

The conversion already visits every pixel to premultiply, so track
whether any alpha value is not 255 in the same loop and construct the
Pixmap with from_parts_with_opacity().

@LaurenzV LaurenzV left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@LaurenzV
LaurenzV added this pull request to the merge queue Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants