mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Skia is changing SkFontMgr and SkFontStyleSet methods to consistently return sk_sp<SkTypeface> and sk_sp<SkFontStyleSet> instead of SkTypeface* and SkFontStyleSet*. The pointers returned always needed to be SkSafeUnref'ed but with sk_sp this ownership is now explicit. Flutter subclasses both SkFontMgr and SkFontStyleSet and overrides affected methods. Normally Skia would roll out this change behind a build flag which would first be set in Flutter (to hold out the change), Skia then rolled into Flutter, then the build flag removed from Flutter (along with updating the subclasses). However, this is made quite difficult and slow because of the need to also be compatible with Flutter in other repositories at the same time. Instead, this change updates the subclasses to infer the correct return types in a way that will work both with and without the Skia change. After the Skia change is landed and rolled into Flutter the subclasses will be re-simplified to match the new method signatures. [0] https://skia-review.googlesource.com/c/skia/+/659856