зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1247405 - Track peak texture memory usage r=nical
This commit is contained in:
Родитель
38f9c3827b
Коммит
ad3d8bc008
|
@ -16,6 +16,7 @@ using namespace mozilla::gl;
|
|||
NS_IMPL_ISUPPORTS(GfxTexturesReporter, nsIMemoryReporter)
|
||||
|
||||
Atomic<size_t> GfxTexturesReporter::sAmount(0);
|
||||
Atomic<size_t> GfxTexturesReporter::sPeakAmount(0);
|
||||
Atomic<size_t> 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
|
||||
|
|
|
@ -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<size_t> sAmount;
|
||||
static Atomic<size_t> sPeakAmount;
|
||||
// Count the amount of memory lost to tile waste
|
||||
static Atomic<size_t> sTileWasteAmount;
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче