-
Notifications
You must be signed in to change notification settings - Fork 6k
Web ImageFilter.matrix support #25982
Web ImageFilter.matrix support #25982
Conversation
b720007 to
b0242d3
Compare
|
Thanks @flar , will review shortly. |
|
Thanks @ferhatb , builds have been problematic for a while so I was just recently able to rebase this and get it past the build issues (hopefully, knocking on wood). |
yjbanov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| _CkMatrixImageFilter({ required this.matrix, required this.filterQuality }) : super._(); | ||
|
|
||
| Float64List matrix; | ||
| ui.FilterQuality filterQuality; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these be final?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, probably very minor performance wins, but if this object is opaque the values can be converted using toSkMatrixFromFloat64 and toSkFilterQuality in the constructor initializer, so when the image filter is reused we don't need to re-convert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first I was worried that this would change the toString() representation, but then I realized I could convert back for stringifying, so I went with this method.
Also, I wasn't copying the matrix so that was a problem waiting to happen. By converting the matrix to an Sk form, we have a defensive copy implicitly (although the stringify precision will suffer slightly, but that is arguably being honest about the precision that web maintains for these values...).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the end I made them final, but didn't store them as converted values in case that disrupts the processing of the == operator which is key to consistency of tree changes as values change.
b0242d3 to
025a3e3
Compare
|
I implemented suggestions from @yjbanov and rebased. I had to make some adjustments for the recent changes by @hterkelsen for the way the libraries are packaged. Hopefully I complied with the new design directions. |
* 98068f1 fuchsia: Only send different ViewProperties (flutter/engine#26170) * 5e487ba Roll Skia from c1f641104531 to 469531234936 (4 revisions) (flutter/engine#26197) * 4cab492 Add image generator registry (flutter/engine#25987) * c753c24 Roll Fuchsia Linux SDK from l6XmTSLnt... to AUWVgDkx6... (flutter/engine#26201) * 75a7812 Reland outputs a json version of the package manifest. (flutter/engine#26163) * b5dc598 Roll Skia from 469531234936 to 5b38536d76ae (7 revisions) (flutter/engine#26202) * fb91366 [icu] Upgrade ICU to 69.1, the same commit used by Chromimum latest (flutter/engine#26200) * 62e0951 Prepare to move --delete-tostring-package-uri option to Dart SDK (flutter/engine#26196) * 156c2be Web ImageFilter.matrix support (flutter/engine#25982) * c30de25 Roll Skia from 5b38536d76ae to 2fed9f62d29a (7 revisions) (flutter/engine#26206) * 7ef42f1 Roll Fuchsia Mac SDK from KmSY84b_E... to 7WNQRHsHN... (flutter/engine#26207) * 8bba964 Add more diagrams for deferred components docs, fix alignment of existing one (flutter/engine#26209) * 391e22d Roll Dart SDK from 67be110b5ba8 to 510f26486328 (3 revisions) (flutter/engine#26212) * fa62ce0 Roll Skia from 2fed9f62d29a to e8cd0a54041e (2 revisions) (flutter/engine#26213) * 2029cba Roll Skia from e8cd0a54041e to 3d854bade6de (4 revisions) (flutter/engine#26216) * 9cd3c64 Roll Fuchsia Linux SDK from AUWVgDkx6... to boele8geO... (flutter/engine#26217) * 6ceab15 Roll Dart SDK from 510f26486328 to 13e329e614f2 (1 revision) (flutter/engine#26218) * f90698a Roll Fuchsia Mac SDK from 7WNQRHsHN... to F5TX4MaEg... (flutter/engine#26220) * b9d03fe Roll Skia from 3d854bade6de to 66125eac158d (1 revision) (flutter/engine#26221) * 849ce7e Roll Dart SDK from 13e329e614f2 to 2eea032403e2 (1 revision) (flutter/engine#26222) * ca89d69 Roll Skia from 66125eac158d to 5696bcd0f7f8 (1 revision) (flutter/engine#26223) * db7a3dc fuchsia: Fix occlusion_hint handling (flutter/engine#26208) * b875d99 Roll Skia from 5696bcd0f7f8 to bdfd77616177 (5 revisions) (flutter/engine#26224) * b67caca Roll Skia from bdfd77616177 to fb8d20befa8f (1 revision) (flutter/engine#26225) * 2398dea Revert Dart SDK to 67be110b5ba8fc84af5e7136389e52a13ccbc9d5 (flutter/engine#26232)

Includes a new golden test.
The only thing that doesn't work is using an ImageFilter.matrix in a BackdropFilter on the HTML renderer. I don't know of a way to apply a transform to the background.
What does work:
Previously all of those would throw an exception.
Fixes flutter/flutter#45213