Remove unused transform parameter of ctfont_create_exact_copy

All instances were using this function with a nullptr transform
parameter. Remove the parameter and pass nullptr to CoreText call
instead.

Change-Id: Ic3b4d97a800758a45f1d771cbf9230e255775821
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248936
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
This commit is contained in:
Dominik Röttsches 2019-10-16 16:00:16 +03:00 committed by Skia Commit-Bot
parent d7689d434c
commit 8c1cb1c3f2

View File

@ -997,8 +997,7 @@ private:
// It is not possible to use descriptors with CTFontCreateWithFontDescriptor, since that does not
// work with non-system fonts. As a result, create the strike specific CTFonts from the underlying
// CGFont.
static SkUniqueCFRef<CTFontRef> ctfont_create_exact_copy(CTFontRef baseFont, CGFloat textSize,
const CGAffineTransform* transform)
static SkUniqueCFRef<CTFontRef> ctfont_create_exact_copy(CTFontRef baseFont, CGFloat textSize)
{
SkUniqueCFRef<CGFontRef> baseCGFont(CTFontCopyGraphicsFont(baseFont, nullptr));
@ -1011,7 +1010,7 @@ static SkUniqueCFRef<CTFontRef> ctfont_create_exact_copy(CTFontRef baseFont, CGF
// as other uses of CTFontCreateWithGraphicsFont which is that such CTFonts should not escape
// the scaler context, since they aren't 'normal'.
return SkUniqueCFRef<CTFontRef>(
CTFontCreateWithGraphicsFont(baseCGFont.get(), textSize, transform, nullptr));
CTFontCreateWithGraphicsFont(baseCGFont.get(), textSize, nullptr, nullptr));
}
SkScalerContext_Mac::SkScalerContext_Mac(sk_sp<SkTypeface_Mac> typeface,
@ -1044,7 +1043,7 @@ SkScalerContext_Mac::SkScalerContext_Mac(sk_sp<SkTypeface_Mac> typeface,
// The transform contains everything except the requested text size.
// Some properties, like 'trak', are based on the text size (before applying the matrix).
CGFloat textSize = ScalarToCG(scale.y());
fCTFont = ctfont_create_exact_copy(ctFont, textSize, nullptr);
fCTFont = ctfont_create_exact_copy(ctFont, textSize);
fCGFont.reset(CTFontCopyGraphicsFont(fCTFont.get(), nullptr));
}
@ -1720,7 +1719,7 @@ static void CFStringToSkString(CFStringRef src, SkString* dst) {
void SkTypeface_Mac::getGlyphToUnicodeMap(SkUnichar* dstArray) const {
SkUniqueCFRef<CTFontRef> ctFont =
ctfont_create_exact_copy(fFontRef.get(), CTFontGetUnitsPerEm(fFontRef.get()), nullptr);
ctfont_create_exact_copy(fFontRef.get(), CTFontGetUnitsPerEm(fFontRef.get()));
CFIndex glyphCount = CTFontGetGlyphCount(ctFont.get());
populate_glyph_to_unicode(ctFont.get(), glyphCount, dstArray);
}
@ -1728,7 +1727,7 @@ void SkTypeface_Mac::getGlyphToUnicodeMap(SkUnichar* dstArray) const {
std::unique_ptr<SkAdvancedTypefaceMetrics> SkTypeface_Mac::onGetAdvancedMetrics() const {
SkUniqueCFRef<CTFontRef> ctFont =
ctfont_create_exact_copy(fFontRef.get(), CTFontGetUnitsPerEm(fFontRef.get()), nullptr);
ctfont_create_exact_copy(fFontRef.get(), CTFontGetUnitsPerEm(fFontRef.get()));
std::unique_ptr<SkAdvancedTypefaceMetrics> info(new SkAdvancedTypefaceMetrics);