diff --git a/gfx/gl/GfxTexturesReporter.cpp b/gfx/gl/GfxTexturesReporter.cpp index 35c4fb8d0393..c2f3056cbff8 100644 --- a/gfx/gl/GfxTexturesReporter.cpp +++ b/gfx/gl/GfxTexturesReporter.cpp @@ -16,6 +16,7 @@ using namespace mozilla::gl; NS_IMPL_ISUPPORTS(GfxTexturesReporter, nsIMemoryReporter) Atomic GfxTexturesReporter::sAmount(0); +Atomic GfxTexturesReporter::sPeakAmount(0); Atomic GfxTexturesReporter::sTileWasteAmount(0); /* static */ void @@ -26,6 +27,9 @@ GfxTexturesReporter::UpdateAmount(MemoryUse action, size_t amount) sAmount -= amount; } else { sAmount += amount; + if (sAmount > sPeakAmount) { + sPeakAmount = sAmount; + } } #ifdef MOZ_CRASHREPORTER diff --git a/gfx/gl/GfxTexturesReporter.h b/gfx/gl/GfxTexturesReporter.h index 7553853f144e..e4f7bbe13986 100644 --- a/gfx/gl/GfxTexturesReporter.h +++ b/gfx/gl/GfxTexturesReporter.h @@ -53,13 +53,18 @@ public: MOZ_COLLECT_REPORT("gfx-tiles-waste", KIND_OTHER, UNITS_BYTES, int64_t(sTileWasteAmount), "Memory lost due to tiles extending past content boundaries"); - return MOZ_COLLECT_REPORT( + MOZ_COLLECT_REPORT( "gfx-textures", KIND_OTHER, UNITS_BYTES, int64_t(sAmount), "Memory used for storing GL textures."); + MOZ_COLLECT_REPORT( + "gfx-textures-peak", KIND_OTHER, UNITS_BYTES, int64_t(sPeakAmount), + "Peak memory used for storing GL textures."); + return NS_OK; } private: static Atomic sAmount; + static Atomic sPeakAmount; // Count the amount of memory lost to tile waste static Atomic sTileWasteAmount; };