Bug 1256678 - Backout diagnostic patch rev 39c895b67af2 - r=me
authorEdwin Flores <eflores@mozilla.com>
Fri, 22 Apr 2016 13:23:25 +0100
changeset 332411 7600273fa9a96bfb1a6c30a95bd0951f696081c6
parent 332410 4280881aae807f48d82d2cdce810220b68a7c3ff
child 332412 0a64b841be88b591fc8c86b99e4fbc01cd5fc22d
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)
reviewersme
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 - Backout diagnostic patch rev 39c895b67af2 - r=me
gfx/2d/DrawTargetRecording.cpp
gfx/2d/Logging.h
gfx/2d/SFNTData.cpp
gfx/2d/ScaledFontWin.cpp
--- a/gfx/2d/DrawTargetRecording.cpp
+++ b/gfx/2d/DrawTargetRecording.cpp
@@ -384,20 +384,16 @@ void
 DrawTargetRecording::FillGlyphs(ScaledFont *aFont,
                                 const GlyphBuffer &aBuffer,
                                 const Pattern &aPattern,
                                 const DrawOptions &aOptions,
                                 const GlyphRenderingOptions *aRenderingOptions)
 {
   EnsurePatternDependenciesStored(aPattern);
 
-  if (aFont->GetType() != FontType::DWRITE && aFont->GetType() != FontType::GDI) {
-    gfxDevCrash(LogReason::GetFontFileDataFailed) << "Unexpected ScaledFont type " << (int)aFont->GetType();
-  }
-
   if (!aFont->GetUserData(reinterpret_cast<UserDataKey*>(mRecorder.get()))) {
   // TODO support font in b2g recordings
 #ifndef MOZ_WIDGET_GONK
     RecordedFontData fontData(aFont);
     RecordedFontDetails fontDetails;
     if (fontData.GetFontDetails(fontDetails)) {
       if (!mRecorder->HasStoredFontData(fontDetails.fontDataKey)) {
         mRecorder->RecordEvent(fontData);
--- a/gfx/2d/Logging.h
+++ b/gfx/2d/Logging.h
@@ -128,17 +128,16 @@ enum class LogReason : int {
   SourceSurfaceIncompatible,
   GlyphAllocFailedCairo,
   GlyphAllocFailedCG,
   InvalidRect,
   CannotDraw3D, // 20
   IncompatibleBasicTexturedEffect,
   InvalidFont,
   PAllocTextureBackendMismatch,
-  GetFontFileDataFailed,
   MessageChannelCloseFailure,
   TextureAliveAfterShutdown,
   InvalidContext,
   InvalidCommandList,
   // End
   MustBeLessThanThis = 101,
 };
 
--- a/gfx/2d/SFNTData.cpp
+++ b/gfx/2d/SFNTData.cpp
@@ -111,46 +111,44 @@ private:
 /* static */
 UniquePtr<SFNTData>
 SFNTData::Create(const uint8_t *aFontData, uint32_t aDataLength)
 {
   MOZ_ASSERT(aFontData);
 
   // Check to see if this is a font collection.
   if (aDataLength < sizeof(TTCHeader)) {
-    gfxDevCrash(LogReason::GetFontFileDataFailed) << "Font data too short: length = " << aDataLength;
+    gfxWarning() << "Font data too short.";
     return nullptr;
   }
 
   const TTCHeader *ttcHeader = reinterpret_cast<const TTCHeader*>(aFontData);
   if (ttcHeader->ttcTag == TRUETYPE_TAG('t', 't', 'c', 'f')) {
     uint32_t numFonts = ttcHeader->numFonts;
     if (aDataLength < sizeof(TTCHeader) + (numFonts * sizeof(BigEndianUint32))) {
-      gfxDevCrash(LogReason::GetFontFileDataFailed) << "Font data too short to contain full TTC Header: numFonts = " << numFonts << "; length = " << aDataLength;
+      gfxWarning() << "Font data too short to contain full TTC Header.";
       return nullptr;
     }
 
     UniquePtr<SFNTData> sfntData(new SFNTData);
     const BigEndianUint32* offset =
       reinterpret_cast<const BigEndianUint32*>(aFontData + sizeof(TTCHeader));
     const BigEndianUint32* endOfOffsets = offset + numFonts;
     while (offset != endOfOffsets) {
       if (!sfntData->AddFont(aFontData, aDataLength, *offset)) {
-        gfxDevCrash(LogReason::GetFontFileDataFailed) << "Failed to add font data from TTC";
         return nullptr;
       }
       ++offset;
     }
 
     return Move(sfntData);
   }
 
   UniquePtr<SFNTData> sfntData(new SFNTData);
   if (!sfntData->AddFont(aFontData, aDataLength, 0)) {
-    gfxDevCrash(LogReason::GetFontFileDataFailed) << "Failed to add single font data";
     return nullptr;
   }
 
   return Move(sfntData);
 }
 
 /* static */
 uint64_t
@@ -220,25 +218,25 @@ SFNTData::GetIndexForU16Name(const mozil
 }
 
 bool
 SFNTData::AddFont(const uint8_t *aFontData, uint32_t aDataLength,
                   uint32_t aOffset)
 {
   uint32_t remainingLength = aDataLength - aOffset;
   if (remainingLength < sizeof(OffsetTable)) {
-    gfxCriticalError() << "Font data too short to contain OffsetTable: offset = " << aOffset << "; length = " << aDataLength;
+    gfxWarning() << "Font data too short to contain OffsetTable " << aOffset;
     return false;
   }
 
   const OffsetTable *offsetTable =
     reinterpret_cast<const OffsetTable*>(aFontData + aOffset);
   if (remainingLength <
       sizeof(OffsetTable) + (offsetTable->numTables * sizeof(TableDirEntry))) {
-    gfxCriticalError() << "Font data too short to contain tables. numTables = " << offsetTable->numTables << "; offset = " << aOffset << "; length = " << aDataLength;
+    gfxWarning() << "Font data too short to contain tables.";
     return false;
   }
 
   return mFonts.append(new Font(offsetTable, aFontData, aDataLength));
 }
 
 } // gfx
 } // mozilla
--- a/gfx/2d/ScaledFontWin.cpp
+++ b/gfx/2d/ScaledFontWin.cpp
@@ -35,45 +35,43 @@ ScaledFontWin::GetFontFileData(FontFileD
   // Check for a font collection first.
   uint32_t table = 0x66637474; // 'ttcf'
   uint32_t tableSize = ::GetFontData(dc.GetDC(), table, 0, nullptr, 0);
   if (tableSize == GDI_ERROR) {
     // Try as if just a single font.
     table = 0;
     tableSize = ::GetFontData(dc.GetDC(), table, 0, nullptr, 0);
     if (tableSize == GDI_ERROR) {
-      gfxDevCrash(LogReason::GetFontFileDataFailed) << "Failed to get font data from GDI";
       return false;
     }
   }
 
   UniquePtr<uint8_t[]> fontData(new uint8_t[tableSize]);
 
   uint32_t sizeGot =
     ::GetFontData(dc.GetDC(), table, 0, fontData.get(), tableSize);
   if (sizeGot != tableSize) {
-    gfxDevCrash(LogReason::GetFontFileDataFailed) << "GDI did not return enough data for font: wanted " << tableSize << ", got " << sizeGot;
     return false;
   }
 
   // If it's a font collection then attempt to get the index.
   uint32_t index = 0;
   if (table != 0) {
     UniquePtr<SFNTData> sfntData = SFNTData::Create(fontData.get(),
                                                     tableSize);
     if (!sfntData) {
-      gfxDevCrash(LogReason::GetFontFileDataFailed) << "Failed to create SFNTData for GetFontFileData.";
+      gfxWarning() << "Failed to create SFNTData for GetFontFileData.";
       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)) {
-      gfxDevCrash(LogReason::GetFontFileDataFailed) << "Failed to get index for face name.";
+      gfxWarning() << "Failed to get index for face name.";
       return false;
     }
   }
 
   aDataCallback(fontData.get(), tableSize, index, mSize, aBaton);
   return true;
 }