summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell Brenner <russellbrenner@google.com>2011-03-24 09:42:59 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-03-24 09:42:59 -0700
commit805496d361ae3a1be6eb7d05df7794390295a359 (patch)
tree10db98a96317e91a5523dd54b5e3282361360e05
parentda37bf0f7c9b233de04bf197dc4d3404e88b8bab (diff)
parentdd816e39169b0fd3390257c1b43fb96f9b87577b (diff)
downloadexternal_webkit-805496d361ae3a1be6eb7d05df7794390295a359.zip
external_webkit-805496d361ae3a1be6eb7d05df7794390295a359.tar.gz
external_webkit-805496d361ae3a1be6eb7d05df7794390295a359.tar.bz2
Merge "Add defensive code for crash in FontPlatformData"
-rw-r--r--WebCore/platform/graphics/android/FontPlatformDataAndroid.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/WebCore/platform/graphics/android/FontPlatformDataAndroid.cpp b/WebCore/platform/graphics/android/FontPlatformDataAndroid.cpp
index 352516b..337a94d 100644
--- a/WebCore/platform/graphics/android/FontPlatformDataAndroid.cpp
+++ b/WebCore/platform/graphics/android/FontPlatformDataAndroid.cpp
@@ -163,11 +163,15 @@ void FontPlatformData::setupPaint(SkPaint* paint) const
if (!(ts > 0))
ts = 12;
+ if (hashTableDeletedFontValue() == mTypeface)
+ paint->setTypeface(0);
+ else
+ paint->setTypeface(mTypeface);
+
paint->setAntiAlias(true);
paint->setSubpixelText(true);
paint->setHinting(SkPaint::kSlight_Hinting);
paint->setTextSize(SkFloatToScalar(ts));
- paint->setTypeface(mTypeface);
paint->setFakeBoldText(mFakeBold);
paint->setTextSkewX(mFakeItalic ? -SK_Scalar1/4 : 0);
#ifndef SUPPORT_COMPLEX_SCRIPTS
@@ -177,7 +181,10 @@ void FontPlatformData::setupPaint(SkPaint* paint) const
uint32_t FontPlatformData::uniqueID() const
{
- return mTypeface->uniqueID();
+ if (hashTableDeletedFontValue() == mTypeface)
+ return SkTypeface::UniqueID(0);
+ else
+ return SkTypeface::UniqueID(mTypeface);
}
bool FontPlatformData::operator==(const FontPlatformData& a) const
@@ -207,7 +214,10 @@ unsigned FontPlatformData::hash() const
bool FontPlatformData::isFixedPitch() const
{
- return mTypeface ? mTypeface->isFixedWidth() : false;
+ if (mTypeface && (mTypeface != hashTableDeletedFontValue()))
+ return mTypeface->isFixedWidth();
+ else
+ return false;
}
HB_FaceRec_* FontPlatformData::harfbuzzFace() const