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 471923 81601f1ab8799a121d82d5b560888aa7296fc776
parent 471922 aaba7b12e27b5a6c51cc6972a061f17a426865a6
child 471924 7a50e32d708acd69e5fc41dbc3eb6815d93cfbde
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1448703
milestone61.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 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