short-circuit if the requested typeface matches what we've been given.
git-svn-id: http://skia.googlecode.com/svn/trunk@7954 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
b12dc38964
commit
4969044d0b
@ -67,6 +67,10 @@ SkTypeface* SkTypeface::CreateFromName(const char name[], Style style) {
|
||||
}
|
||||
|
||||
SkTypeface* SkTypeface::CreateFromTypeface(const SkTypeface* family, Style s) {
|
||||
if (family && family->style() == s) {
|
||||
family->ref();
|
||||
return const_cast<SkTypeface*>(family);
|
||||
}
|
||||
return SkFontHost::CreateTypeface(family, NULL, s);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user