Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Impeller] dont apply opacity peephole to runtime effect. #56621

Closed

Conversation

jonahwilliams
Copy link
Member

Fixes flutter/flutter#158500

Runtime effect cannot accept opacity.

!paint.mask_blur_descriptor.has_value() &&
paint.image_filter == nullptr && paint.color_filter == nullptr;
}
static bool CanApplyOpacityPeephole(const Paint& paint);
Copy link
Contributor

Choose a reason for hiding this comment

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

SaveLayer operations ignore the color source. If this is having an impact then something must be going wrong in how we handle SaveLayers.

if (paint.blend_mode != BlendMode::kSourceOver) {
return false;
}
if (paint.invert_colors || paint.mask_blur_descriptor.has_value() ||
Copy link
Contributor

@flar flar Nov 15, 2024

Choose a reason for hiding this comment

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

Also, SaveLayer shouldn't apply mask blur either.

Only alpha of the color, IF, CF and blend.

Copy link
Member Author

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

oh right. hmm, I thought I understood what was happening, but I think I'm wrong.

@flar
Copy link
Contributor

flar commented Dec 4, 2024

I think the error here is that this test is looking for the attributes on the SaveLayer, but it really should be concerned about the attributes on the content. (Note that this may work accidentally in cases where an RT ColorSource or ImageFilter was installed by a previous rendering op, but the SaveLayer call did not clear that attribute because it wasn't planning to use it.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Impeller] : Opacity widget not working on a CustomPaint with a shader on iOS
2 participants