Skip to content

Fix for custom shaders inside an Opacity widget might be too aggressive in some situations #159862

@flar

Description

@flar

flutter/engine#56936 fixed a bug where use of custom shaders might ignore the opacity modulation of an Opacity widget.

Theoretically it might also disable an optimization for group opacity in some rare circumstances in parts of scenes in close proximity to code that uses a custom shader. No functional bug will result but we will lose an opportunity to maintain the performance advantage of group opacity optimizations in these uncommon situations.

The problem is that we mark a DisplayList layer as incompatible with group opacity when it has any rendering operations that were drawn while a RuntimeEffect color source or image filter was in play even if the indicated rendering operation does not use those rendering attributes. The test for RuntimeEffects in the DisplayListBuilder needs to check the attribute usage of each rendering operation as it makes the determination of whether or not it will break the group opacity peephole optimization rules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectengineflutter/engine related. See also e: labels.team-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions