Bug 1954858 - Avoid implicit integer conversions around GfxTexturesReporter::UpdateWasteAmount. r=gfx-reviewers,jgilbert,lsalzman

Differential Revision: https://phabricator.services.mozilla.com/D242065
This commit is contained in:
Mike Hommey
2025-03-25 20:49:20 +00:00
parent 40cb645dd8
commit 634678c84c

View File

@@ -41,7 +41,13 @@ class GfxTexturesReporter final : public nsIMemoryReporter {
// the value reported by this memory reporter.
static void UpdateAmount(MemoryUse action, size_t amount);
static void UpdateWasteAmount(size_t delta) { sTileWasteAmount += delta; }
static void UpdateWasteAmount(int32_t delta) {
if (delta >= 0) {
sTileWasteAmount += static_cast<size_t>(delta);
} else {
sTileWasteAmount -= static_cast<size_t>(-delta);
}
}
NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport,
nsISupports* aData, bool aAnonymize) override {