Repository navigation
More layer types should implement OffsetLayer #101990
Description
Activity
- addedframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.engineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.c: performanceRelates to speed or footprint issues (see "perf:" labels)Relates to speed or footprint issues (see "perf:" labels)P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter project
on Apr 15, 2022 Maybe we should also consider loosening this constraint too. For example, the
ImageFilterLayercan't accept an offset directly, but it can include it in the matrix transform. As long as the offset can be consumed there shouldn't be a problemAs long as the offset can be consumed there shouldn't be a problem
But from more research, its just way easier if we can set the offset directly. Then we let the framework do it and we can skip conditionally passing the offset into updateCompositedLayer
Reacted by Michael GoderbauerIf ImageFitlererLayer wants to work with a transform we could just have the Offset be a getter that reports the translate of the matrix and a setter that update the translate, right?
I tried that and it didn't quite work because the filters are opaque. Also TBH it was a huge pain trying to make the repaint boundary code generic beyond OffsetLayer - since the framework wants to manage the offset itself
This improved the performance of the animated image filtered benchmark: https://flutter-flutter-perf.skia.org/e/?queries=test%3Danimated_complex_image_filtered_perf__e2e_summary&selected=commit%3D32354%26name%3D%252Carch%253Dintel%252Cbranch%253Dmaster%252Cconfig%253Ddefault%252Cdevice_type%253DMoto_G__4_%252Cdevice_version%253Dnone%252Chost_type%253Dlinux%252Csub_result%253Daverage_frame_rasterizer_time_millis%252Ctest%253Danimated_complex_image_filtered_perf__e2e_summary%252C
Note that this is raster and build, so these improvements still apply to impeller as well
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 -vand a minimal reproduction of the issue.- locked as resolved and limited conversation to collaborators
on Apr 28, 2023
In the investigation of #101941 / #101952 I've found that we'll be limited in how many addition layer / render object types we can support as repaint boundaries. It is expected that a repaint boundaries layer can accept an offset, but so far only
OffsetLayer,TransformLayer, andOpacityLayermeet that criteria.If its feasible, we should consider making more layer types support accepting an offset so we can expand the support.