Bug 1448703 - follow-up - disambiguate unknown font from cleared all. r=me
☠☠ backed out by 7a50e32d708a ☠ ☠
authorLee Salzman <lsalzman@mozilla.com>
Thu, 26 Apr 2018 11:38:09 -0400
changeset 460786 81601f1ab8799a121d82d5b560888aa7296fc776
parent 460785 aaba7b12e27b5a6c51cc6972a061f17a426865a6
child 460787 7a50e32d708acd69e5fc41dbc3eb6815d93cfbde
push id165
push userfmarier@mozilla.com
push dateMon, 30 Apr 2018 23:50:51 +0000
reviewersme
bugs1448703
milestone61.0a1
Bug 1448703 - follow-up - disambiguate unknown font from cleared all. r=me
gfx/webrender_bindings/Moz2DImageRenderer.cpp
--- a/gfx/webrender_bindings/Moz2DImageRenderer.cpp
+++ b/gfx/webrender_bindings/Moz2DImageRenderer.cpp
@@ -84,33 +84,33 @@ static struct FontDeleteLog {
   }
 
   // Store namespace clears as font id 0, since this will never be allocated.
   void Add(WrIdNamespace aNamespace) {
     AddEntry(AsUint64(WrFontKey { aNamespace, 0 }));
   }
 
   void AddAll() {
-    AddEntry(0);
+    AddEntry(~0);
   }
 
   // Find a matching entry in the log, searching backwards starting at the newest
   // entry and finishing with the oldest entry. Returns a brief description of why
   // the font was deleted, if known.
   const char* Find(WrFontKey aKey) {
     uint64_t keyEntry = AsUint64(aKey);
     uint64_t namespaceEntry = AsUint64(WrFontKey { aKey.mNamespace, 0 });
     size_t offset = mNextEntry;
     do {
       offset = (offset + MAX_ENTRIES - 1) % MAX_ENTRIES;
       if (mEntries[offset] == keyEntry) {
         return "deleted font";
       } else if (mEntries[offset] == namespaceEntry) {
         return "cleared namespace";
-      } else if (!mEntries[offset]) {
+      } else if (mEntries[offset] == ~0) {
         return "cleared all";
       }
     } while (offset != mNextEntry);
     return "unknown font";
   }
 } sFontDeleteLog;
 
 void