Skip to content

Remove hard-coded devicePixelRatio from paintImage #117477

Description

@goderbauer

paintImage currently hard-codes the device pixel ratio by reaching out to the window singleton:

// It's ok to use this instead of a MediaQuery because if this changes,
// whatever is aware of the MediaQuery will be repainting the image anyway.
displaySize: outputSize * PaintingBinding.instance.window.devicePixelRatio,

In a multi-viewed world, this will not work anymore because paintImage has no idea what view the image is getting painted on. This will need to be refactored to get the devicePixelRatio passed in.

Activity

  1. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Dec 21, 2022
  2. goderbauer commented on Dec 21, 2022

    @goderbauer
    MemberAuthor

    The device pixel ratio here is only used for the oversized image debug check within paintImage.

  3. self-assigned this
    on Jan 3, 2023
  4. added
    P1High-priority issues at the top of the work list
    on Jan 3, 2023
  5. github-actions commented on Mar 4, 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.

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

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: imagesLoading, displaying, rendering imagesframeworkflutter/packages/flutter repository. See also f: labels.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions