aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-03-05 20:43:42 +0000
committerGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-03-05 20:43:42 +0000
commitfb12c3e6ba84f95dc15fbaddc239dede0ba1d60e (patch)
tree902bc000f728399a1fef7df02081714fd0d06b98 /src
parent54043a394ef4479eff187b0defa8c2dea041612c (diff)
fix ref() in CreateTypeface
fix comment in SkDraw.cpp git-svn-id: http://skia.googlecode.com/svn/trunk@111 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r--src/core/SkDraw.cpp2
-rw-r--r--src/ports/SkFontHost_android.cpp4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index 323438b859..1d3263f73e 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -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);
diff --git a/src/ports/SkFontHost_android.cpp b/src/ports/SkFontHost_android.cpp
index 21ed0b709b..67c78fb87a 100644
--- a/src/ports/SkFontHost_android.cpp
+++ b/src/ports/SkFontHost_android.cpp
@@ -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;