зеркало из https://github.com/mozilla/gecko-dev.git
bug 745261 - check calls to SetupCairoFont for failure. r=jdaggett
This commit is contained in:
Родитель
7c5c0c3154
Коммит
3cd1485d61
|
@ -2786,12 +2786,13 @@ gfxGlyphExtents::GetTightGlyphExtentsAppUnits(gfxFont *aFont,
|
|||
return false;
|
||||
}
|
||||
|
||||
aFont->SetupCairoFont(aContext);
|
||||
if (aFont->SetupCairoFont(aContext)) {
|
||||
#ifdef DEBUG_TEXT_RUN_STORAGE_METRICS
|
||||
++gGlyphExtentsSetupLazyTight;
|
||||
++gGlyphExtentsSetupLazyTight;
|
||||
#endif
|
||||
aFont->SetupGlyphExtents(aContext, aGlyphID, true, this);
|
||||
entry = mTightGlyphExtents.GetEntry(aGlyphID);
|
||||
aFont->SetupGlyphExtents(aContext, aGlyphID, true, this);
|
||||
entry = mTightGlyphExtents.GetEntry(aGlyphID);
|
||||
}
|
||||
if (!entry) {
|
||||
NS_WARNING("Could not get glyph extents");
|
||||
return false;
|
||||
|
@ -5453,8 +5454,11 @@ gfxTextRun::FetchGlyphExtents(gfxContext *aRefContext)
|
|||
PRUint32 glyphIndex = glyphData->GetSimpleGlyph();
|
||||
if (!extents->IsGlyphKnown(glyphIndex)) {
|
||||
if (!fontIsSetup) {
|
||||
font->SetupCairoFont(aRefContext);
|
||||
fontIsSetup = true;
|
||||
if (!font->SetupCairoFont(aRefContext)) {
|
||||
NS_WARNING("failed to set up font for glyph extents");
|
||||
break;
|
||||
}
|
||||
fontIsSetup = true;
|
||||
}
|
||||
#ifdef DEBUG_TEXT_RUN_STORAGE_METRICS
|
||||
++gGlyphExtentsSetupEagerSimple;
|
||||
|
@ -5475,7 +5479,10 @@ gfxTextRun::FetchGlyphExtents(gfxContext *aRefContext)
|
|||
PRUint32 glyphIndex = details->mGlyphID;
|
||||
if (!extents->IsGlyphKnownWithTightExtents(glyphIndex)) {
|
||||
if (!fontIsSetup) {
|
||||
font->SetupCairoFont(aRefContext);
|
||||
if (!font->SetupCairoFont(aRefContext)) {
|
||||
NS_WARNING("failed to set up font for glyph extents");
|
||||
break;
|
||||
}
|
||||
fontIsSetup = true;
|
||||
}
|
||||
#ifdef DEBUG_TEXT_RUN_STORAGE_METRICS
|
||||
|
|
|
@ -160,7 +160,9 @@ gfxGraphiteShaper::ShapeWord(gfxContext *aContext,
|
|||
const PRUnichar *aText)
|
||||
{
|
||||
// some font back-ends require this in order to get proper hinted metrics
|
||||
mFont->SetupCairoFont(aContext);
|
||||
if (!mFont->SetupCairoFont(aContext)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
mCallbackData.mContext = aContext;
|
||||
|
||||
|
|
|
@ -855,7 +855,9 @@ gfxHarfBuzzShaper::ShapeWord(gfxContext *aContext,
|
|||
const PRUnichar *aText)
|
||||
{
|
||||
// some font back-ends require this in order to get proper hinted metrics
|
||||
mFont->SetupCairoFont(aContext);
|
||||
if (!mFont->SetupCairoFont(aContext)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!mHBFace) {
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче