Skip to content

[Cupertino] ListWheelViewport opacity optimizations. #124703

Closed

Description

@jonahwilliams

Currently the cupertino picker will wrap built items in opacity as they scroll offscreen. When applied to text, this can be quite inefficient as we need to create additional offscreen surfaces to perform the opacity op. While the engine (both Skia and Impeller) does have a form of opacity optimization, its generally hard to apply to text.

Instead, I believe the cupertino picker's item builder callback should expose the current opacity. This would allow the caller to determine if they wanted to apply an opacity saveLayer or to directly apply the opacity to the paint color of the items. For text this would usually be correct and lead to substantially better performance.

#124658
#121476

Activity

  1. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    c: performanceRelates to speed or footprint issues (see "perf:" labels)
    on Apr 12, 2023
  2. jonahwilliams commented on Apr 12, 2023

    @jonahwilliams
    ContributorAuthor

    It looks like this configuration goes all the way down to the ListWheelViewport, so unfortunately it looks like quite an intrusive change.

  3. jonahwilliams commented on Apr 12, 2023

    @jonahwilliams
    ContributorAuthor

    Another way to fix this would be to render all offscreen items with a single opacity layer instead of per-item

  4. jonahwilliams commented on Apr 12, 2023

    @jonahwilliams
    ContributorAuthor

    I have a working prototype that lifts up the opacity.

  5. changed the title [-][cupertino] CupertinoPicker component should allow items to apply opacity directly[/-] [+][Cupertino] ListWheelViewport opacity optimizations.[/+] on Apr 12, 2023
  6. github-actions commented on Apr 29, 2023

    @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.

  7. locked as resolved and limited conversation to collaborators on Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: performanceRelates to speed or footprint issues (see "perf:" labels)frameworkflutter/packages/flutter repository. See also f: labels.p: cupertino_uicupertino_ui package in flutter/packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions