Open HinTak opened 7 months ago
@pavpanchekha the above snippet (duplicated from inline comments) will go into the m124 release note when it gets written. For now, this snipplet is the only "migration" guide. If you could contribute some test code (to go into the pytest "tests" directory), preferably using images from skia's resources/images directory (most of our current tests are written that way, using test files from skia/resources/), that would be useful.
Just to clarify—the old FilterQuality
options will no longer be supported, and users should migrate to SamplingOptions
?
What kind of tests would be useful? Actually checking that images have been resized with various quality levels? Or just checking that drawing an image with a given sampling quality is possible?
Yes: https://github.com/HinTak/skia-python/blob/m124-public/relnotes/README.m124.md
For now I have only added those which had m87 equivalent, and check that the 6 are valid: https://github.com/HinTak/skia-python/blob/m124-public/tests/test_samplingoptions.py
Some actually non-trivial tests closer to how users might use them would be nice.
Just a nit—in your migration instructions above you wrote SkFilterOptions
and SkMipmapMode
a few times, it's not supposed to have the Sk
prefix.
Yes, I realised the extra sk afterwards - https://github.com/kyamagu/skia-python/pull/236/commits/7f6e2bb9d23caaa43304f091cea56e97cd3ff51c - the readme is copied from the tests/tests_samplingoptions.py and should work literally (after adding some "skia." prefix, or doing from skia import *
[Not recommended, as there might be collisions/shadowing]).
Cc @pavpanchekha
Pull #236 now includes the complete SamplingOptions code from pull #181, plus a little extra/update. The last of the emulation of the previous FilterQuality is:
So it turns out that the 4 filterquality settings is equivalent to 5 of the 2×3x2 =12 SamplingOptions combo (one extra, because one of them depending on whether it is rendering through CPU or GPU), and we might as well add the whole thing.
Please test the build artefact when it finishes building.
Still missing are some test code, and possibly docstring documentation too.