Remove last uses of SkTypeface::style() in Skia.
The Lua typeface.getStyle now returns SkFontStyle. Dumping a glyph cache entry is now more accurate. SkTypeface::MakeFromTypeface now does a more accurate check. Change-Id: I6150636c8c674353bd0eed4d95aa0794d3919c39 Reviewed-on: https://skia-review.googlesource.com/32200 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
This commit is contained in:
parent
5a625e08f0
commit
26308e1757
@ -389,8 +389,10 @@ void SkGlyphCache::dump() const {
|
||||
face->getFamilyName(&name);
|
||||
|
||||
SkString msg;
|
||||
msg.printf("cache typeface:%x %25s:%d size:%2g [%g %g %g %g] lum:%02X devG:%d pntG:%d cntr:%d glyphs:%3d",
|
||||
face->uniqueID(), name.c_str(), face->style(), rec.fTextSize,
|
||||
SkFontStyle style = face->fontStyle();
|
||||
msg.printf("cache typeface:%x %25s:(%d,%d,%d) size:%2g [%g %g %g %g] lum:%02X devG:%d pntG:%d cntr:%d glyphs:%3d",
|
||||
face->uniqueID(), name.c_str(), style.weight(), style.width(), style.slant(),
|
||||
rec.fTextSize,
|
||||
matrix[SkMatrix::kMScaleX], matrix[SkMatrix::kMSkewX],
|
||||
matrix[SkMatrix::kMSkewY], matrix[SkMatrix::kMScaleY],
|
||||
rec.fLumBits & 0xFF, rec.fDeviceGamma, rec.fPaintGamma, rec.fContrast,
|
||||
|
@ -143,7 +143,7 @@ sk_sp<SkTypeface> SkTypeface::MakeFromTypeface(SkTypeface* family, Style s) {
|
||||
return SkTypeface::MakeDefault(s);
|
||||
}
|
||||
|
||||
if (family->style() == s) {
|
||||
if (family->fontStyle() == SkFontStyle::FromOldStyle(s)) {
|
||||
return sk_ref_sp(family);
|
||||
}
|
||||
|
||||
|
@ -1802,7 +1802,7 @@ static int ltypeface_getFamilyName(lua_State* L) {
|
||||
}
|
||||
|
||||
static int ltypeface_getStyle(lua_State* L) {
|
||||
lua_pushnumber(L, (double)get_ref<SkTypeface>(L, 1)->style());
|
||||
push_obj(L, get_ref<SkTypeface>(L, 1)->fontStyle());
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user