Bug 1639563 - add some warnings when fonts fail to sanitize. r=jrmuizel
authorLee Salzman <lsalzman@mozilla.com>
Sat, 23 May 2020 17:47:32 +0000
changeset 2913073 fc9af2e86dbd94431d70152af2e4552127c1bb3a
parent 2913072 ddf302b8b8a92d2e4da9c8889621c04860c146b0
child 2913074 7aa26615adf97c056e3b8ebe491e0c66569732af
push id542231
push userbclary@mozilla.com
push dateSun, 24 May 2020 06:08:15 +0000
treeherdertry@5bd349510b42 [default view] [failures only]
reviewersjrmuizel
bugs1639563
milestone78.0a1
Bug 1639563 - add some warnings when fonts fail to sanitize. r=jrmuizel Differential Revision: https://phabricator.services.mozilla.com/D76604
gfx/layers/wr/WebRenderBridgeParent.cpp
--- a/gfx/layers/wr/WebRenderBridgeParent.cpp
+++ b/gfx/layers/wr/WebRenderBridgeParent.cpp
@@ -455,21 +455,24 @@ static bool ReadRawFont(const OpAddRawFo
   if (ptr.isNothing()) {
     return false;
   }
   Range<uint8_t>& source = ptr.ref();
   // Attempt to sanitize the font before passing it along for updating
   size_t lengthHint = gfxOTSContext::GuessSanitizedFontSize(
       source.begin().get(), source.length());
   if (!lengthHint) {
+    gfxCriticalNote << "Could not determine font type for sanitizing font "
+                    << aOp.key().mHandle;
     return false;
   }
   gfxOTSExpandingMemoryStream<WROTSAlloc> output(lengthHint);
   gfxOTSContext otsContext;
   if (!otsContext.Process(&output, source.begin().get(), source.length())) {
+    gfxCriticalNote << "Failed sanitizing font " << aOp.key().mHandle;
     return false;
   }
   wr::Vec<uint8_t> bytes = output.forget();
   aUpdates.AddRawFont(aOp.key(), bytes, aOp.fontIndex());
   return true;
 }
 
 bool WebRenderBridgeParent::UpdateResources(