-
-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure we use only frozen Skia APIs #1144
Comments
Not sure, I'll check with the Skia team.
They do sometimes make breaking changes. Did the Skia Python module already update and break out app? It seems to work locally. |
It's a little tricky. The Skia-Python module has not put out a new "official" release in a while, but the last "official" release doesn't work with Python 3.12 so I've been installing their "beta" releases and those track API changes, including the breaking ones. |
The SamplingOptions change is the first item in the release note: https://github.com/kyamagu/skia-python/blob/main/relnotes/README.m116.md#general-overview-of-changes-between-m87-and-m116 |
SkFilterQuality was removed June 2021, a bit under 3 years ago, in m94 : google/skia@aebe248 Anyway, the migration guide from FilterQuality to SamplingOptions is in: You'll need the upcoming skia-python m124 kyamagu/skia-python#236 to migrate FilterQuality related python code. |
To be pedantic, it is actually 4 settings - high, medium, low and none. None is even lower than low, as far as I see, but it is the default (instead of medium, which one might assume is the case). |
Hi @HinTak, apologies for the long delay—the semester just ended so it's been hectic. I'm working on getting |
I can confirm that, on m124, our browser test suite passes without issue. However, actually running the browser doesn't work due to (maybe?) kyamagu/skia-python#241, because all the text disappears due to the font metrics all returning zero: |
@pavpanchekha yes, you are on mac os? I tried "Times" and it doesn't work either (reset the push after the failed try). If you can see what incantation that gives a usable font on mac os, that would be nice. |
Ok, I found the issue: HinTak/skia-python#1 With this fix, I can successfully run the browser and it looks bit-for-bit identical to 87.5: I'm going to test images with |
@pavpanchekha brilliant! That code is a bit confusing - how could it returns 5 zeros instead of none... I'll add that to the m124 pile now. |
Closing this since we have now pinned the Skia version. |
Skia seems to somewhat-regularly change its API. In theory, some classes are annotated
SK_API
, which indicates that they are frozen, while others are not frozen. We should ideally use only frozen APIs. That said, even "frozen" APIs can change; for example,SkPaint::getBlendMode
was replaced withSkPaint::getBlendMode_or
recently.Still, perhaps we can assume that the
SK_API
classes and methods will not change much, and thatskia-python
can maybe paper over changes if they do (as they did withgetBlendMode_or
). Then the question is: what else do we need to avoid using? I did an exhaustive audit of our source code and here's what I got:Definitely needs changing:
FilterQuality
, namely its use inPaint
, its use indrawImageRect
, and then the actual values of that enum, were all removed way back, like in m90 or something.Maybe will change in the future:
BlendMode
is a public enum but isn'tSK_API
. (I'm not even sure if enums can beSK_API
but in any caseBlendMode
seems to have the same status asFilterQuality
.) The fact thatgetBlendMode
changed doesn't make me feel better—looks like Skia is moving toward a newBlender
abstraction.The text was updated successfully, but these errors were encountered: