Bug 1256678 - Re-add nightly-only crash if ScaledFontWin::GetFontFileData fails to find a matching TrueType collection font - r=jfkthame
authorEdwin Flores <edwin@mozilla.com>
Fri, 22 Apr 2016 13:23:25 +0100
changeset 332414 4307f2ac86811069f1ca9fa21b0200fcae3f4fe2
parent 332413 ed251ff578cd53fe8a862a487aa7b7bd422c9dfb
child 332415 b9ac34e99e3048648c839de22de82f97eb4ce3a7
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame
bugs1256678
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1256678 - Re-add nightly-only crash if ScaledFontWin::GetFontFileData fails to find a matching TrueType collection font - r=jfkthame
gfx/2d/Logging.h
gfx/2d/ScaledFontWin.cpp
--- a/gfx/2d/Logging.h
+++ b/gfx/2d/Logging.h
@@ -128,16 +128,17 @@ enum class LogReason : int {
   SourceSurfaceIncompatible,
   GlyphAllocFailedCairo,
   GlyphAllocFailedCG,
   InvalidRect,
   CannotDraw3D, // 20
   IncompatibleBasicTexturedEffect,
   InvalidFont,
   PAllocTextureBackendMismatch,
+  GetFontFileDataFailed,
   MessageChannelCloseFailure,
   TextureAliveAfterShutdown,
   InvalidContext,
   InvalidCommandList,
   // End
   MustBeLessThanThis = 101,
 };
 
--- a/gfx/2d/ScaledFontWin.cpp
+++ b/gfx/2d/ScaledFontWin.cpp
@@ -62,16 +62,18 @@ ScaledFontWin::GetFontFileData(FontFileD
       return false;
     }
 
     // We cast here because for VS2015 char16_t != wchar_t, even though they are
     // both 16 bit.
     if (!sfntData->GetIndexForU16Name(
           reinterpret_cast<char16_t*>(mLogFont.lfFaceName), &index, LF_FACESIZE - 1)) {
       gfxWarning() << "Failed to get index for face name.";
+      gfxDevCrash(LogReason::GetFontFileDataFailed) <<
+        "Failed to get index for face name |" << mLogFont.lfFaceName << "|.";
       return false;
     }
   }
 
   aDataCallback(fontData.get(), tableSize, index, mSize, aBaton);
   return true;
 }