Skip to content

Canvas shadow BlendMode is not respected during scrolling #49928

@matthew-carroll

Description

@matthew-carroll

I have a CustomPainter that paints 2 Shadows with 2 different BlendModes. The initial render looks fine, but the moment that a scrolling action takes place, e.g., PageView swiping or Drawer swiping, the BlendMode is ignored and results in an ugly rendering artifact.

Here is a screenshot of an initial shadow render:
Screen Shot 2020-01-31 at 9 46 24 PM

Here is a screenshot of the same shadow the moment that I begin to scroll a PageView:
Screen Shot 2020-01-31 at 9 46 31 PM

I reproduced the above bug on an iPhone simulator, and a physical iPhone 7. The glitch looks even worse on a physical device (the above screenshots are from the simulator).

And here is a minimal repro project:
https://github.com/matthew-carroll/flutter_bug_repro_49928

I left a note in the source code of that project that explains that the problem only occurs when I paint a shadow twice. I also explain in there why I do that.

Flutter Doctor:

Flutter (Channel master, v1.13.6-pre.23, on Mac OS X 10.14.6 18G95, locale en-US)
    • Flutter version 1.13.6-pre.23 at ---
    • Framework revision 6e72facad1 (5 weeks ago), 2019-12-24 10:54:04 -0800
    • Engine revision 33813929e3
    • Dart version 2.8.0 (build 2.8.0-dev.0.0 886615d0f9)

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: renderingUI glitches reported at the engine/skia or impeller rendering levelengineflutter/engine related. See also e: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions