fix ref() in CreateTypeface

fix comment in SkDraw.cpp



git-svn-id: http://skia.googlecode.com/svn/trunk@111 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@android.com 2009-03-05 20:43:42 +00:00
parent 54043a394e
commit fb12c3e6ba
2 changed files with 5 additions and 1 deletions

View File

@ -934,7 +934,7 @@ void SkDraw::drawBitmapAsMask(const SkBitmap& bitmap,
c.concat(*fMatrix);
// We can't call drawBitmap, or we'll infinitely recurse. Instead
// we mannually build a shader and draw that into our new mask
// we manually build a shader and draw that into our new mask
SkPaint tmpPaint;
tmpPaint.setFlags(paint.getFlags());
SkAutoBitmapShaderInstall install(bitmap, &tmpPaint);

View File

@ -564,6 +564,8 @@ SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace,
tf = find_best_face(gDefaultFamily, style);
}
// we ref(), since the symantic is to return a new instance
tf->ref();
return tf;
}
@ -576,6 +578,8 @@ bool SkFontHost::ValidFontID(uint32_t fontID)
SkStream* SkFontHost::OpenStream(uint32_t fontID)
{
SkAutoMutexAcquire ac(gFamilyMutex);
FamilyTypeface* tf = (FamilyTypeface*)find_from_uniqueID(fontID);
SkStream* stream = tf ? tf->openStream() : NULL;