[canvaskit] Normalize color matrix translation values#32990
[canvaskit] Normalize color matrix translation values#32990harryterkelsen merged 1 commit intoflutter:mainfrom
Conversation
| /// See [https://api.flutter.dev/flutter/dart-ui/ColorFilter/ColorFilter.matrix.html]. | ||
| Float32List get _normalizedMatrix { | ||
| assert(matrix.length == 20, 'Color Matrix must have 20 entries.'); | ||
| final Float32List result = Float32List(20); |
There was a problem hiding this comment.
This seems to be used as temporary storage. We could probably use CanvasKit.Malloc to avoid reallocating this matrix every time.
There was a problem hiding this comment.
This should only be called once (or once per resurrection if we don't have a finalizer registry)
|
Gold has detected about 1 new digest(s) on patchset 1. |
|
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. |

Flutter specifies that the values in the translation column of the color matrix are given in unnormalized 0..255 space. CanvasKit expects the translation values to be normalized. This change normalizes the color matrix. See https://api.flutter.dev/flutter/dart-ui/ColorFilter/ColorFilter.matrix.html
Fixes flutter/flutter#85707
Pre-launch Checklist
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.