Skip to content

Impeller: Strange issue with path fills #157885

Closed

Description

@lyceel

Using the new Impeller interop toolkit, and I've run into a fairly elusive issue that causes path fills to not be drawn when they should.

The issue seems to involve interactions between transforms, clip regions, and the DisplayListBuilder save stack. After adding lots of logging, I've reduced the issue down to a fairly simple example: https://gist.github.com/lyceel/de6d80caffb3c209d3dadbdfd10447de

With the code as it is, the path is not filled at all:

incorrect

If either the rounded rectangle's transform (Option 1 comment), or the unused clip (Option 2) are commented out, the path is filled properly with red:

correct

I recognize that the simple solution would be to remove the useless save/clip/restore block in the middle, but this is much more difficult to prevent in the real-world use case where this issue was discovered.

Activity

  1. added
    in triagePresently being triaged by the triage team
    engineflutter/engine related. See also e: labels.
    e: libimpellerThe standalone Impeller library with a single-header API.
    on Oct 31, 2024
  2. jason-simmons commented on Oct 31, 2024

    @jason-simmons
    Contributor

    This issue started with the switch to the experimental canvas.

    Possibly this is similar to the issue seen in #153504?

  3. chinmaygarde commented on Oct 31, 2024

    @chinmaygarde
    Contributor

    Thanks for the breadcrumb. I'll compare different backends and attempt a fix if thats the case.

  4. moved this from In Triage to In Progress in libImpelleron Oct 31, 2024
  5. self-assigned this
    on Oct 31, 2024
  6. jason-simmons commented on Oct 31, 2024

    @jason-simmons
    Contributor

    Converted the example to a DisplayListBuilder based test case:
    https://gist.github.com/jason-simmons/f9e450e3f8379a14a1de7381299e16c8

    Using this, the issue reproduces on the GLES back end but not Metal.

  7. chinmaygarde commented on Oct 31, 2024

    @chinmaygarde
    Contributor

    The intersect clip prep call seems to be doing some funky stuff to the depth buffer on OpenGL. The Metal backend comparison is
    Screenshot 2024-10-31 at 3 10 11 PM

  8. chinmaygarde commented on Nov 1, 2024

    @chinmaygarde
    Contributor

    This will be fixed in flutter-team-archive/engine#56310

  9. jonahwilliams commented on Nov 1, 2024

    @jonahwilliams
    Contributor
  10. moved this from In Progress to Done in libImpelleron Nov 1, 2024
  11. lyceel commented on Nov 1, 2024

    @lyceel
    Author

    Thanks for the quick turnaround!

  12. added
    r: fixedIssue is closed as already fixed in a newer version
    on Nov 4, 2024
  13. github-actions commented on Nov 18, 2024

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  14. locked as resolved and limited conversation to collaborators on Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

customer: googleVarious Google teamse: impellerImpeller rendering backend issues and features requestse: libimpellerThe standalone Impeller library with a single-header API.engineflutter/engine related. See also e: labels.r: fixedIssue is closed as already fixed in a newer versionteam-engineOwned by Engine team

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions