Skip to content

Raster cache hints on PaintingContext should assert that _currentLayer is not null #92722

Description

@dnfield

_currentLayer gets set when you first access the canvas.

If it's null, the hint will silently not get set.

Alternatively, we should just _startRecording when the hint(s) are set.

Activity

  1. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    P2Important issues not at the top of the work list
    on Oct 29, 2021
  2. FXschwartz commented on Nov 13, 2021

    @FXschwartz

    @dnfield Hey dnfield! I'd like to take this one if you're cool with that.

    I see _currentLayer gets asserted inside of get canvas and get _isRecording. Are you wanting to additionally add _currentLayer as a parameter to PaintingContext and assert it there?

    Or are you wanting to assert _currentLayer inside of _startRecording() ?

    Let me know if I'm way off base with what I'm assuming you want to be done.

  3. dnfield commented on Nov 13, 2021

    @dnfield
    ContributorAuthor

    I think for now we should assert that the canvas has been accessed before setting these flags.

  4. FXschwartz commented on Nov 14, 2021

    @FXschwartz

    Which flags are you talking about being set?

    Are you talking about here in object.dart?
    code

  5. dnfield commented on Nov 14, 2021

    @dnfield
    ContributorAuthor

    The setIsComplex and will change flags

  6. FXschwartz commented on Nov 14, 2021

    @FXschwartz

    Ahh ok, so we need to assert that _currentLayer is not null before setting .isCopmlexHint and .willChangeHint?

    Like this?
    code

  7. dnfield commented on Nov 14, 2021

    @dnfield
    ContributorAuthor

    Yes, although at that point we should be able to use a ! instead of ?.

    There's still a larger problem here though - setting these hints only affects the current layer being painted, and will get lost if additional layers get appended :\

  8. self-assigned this
    on Jul 11, 2023
  9. github-actions commented on Aug 3, 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.

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

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listframeworkflutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework teamwaiting for PR to land (fixed)A fix is in flight

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions