зеркало из https://github.com/mozilla/gecko-dev.git
Bug 587856 - Part 2: Report D2D surface VRAM usage through memory reporter. r=jrmuizel
This commit is contained in:
Родитель
859fbab273
Коммит
62c762bc00
|
@ -107,6 +107,35 @@ public:
|
|||
};
|
||||
|
||||
NS_IMPL_ISUPPORTS1(D2DCacheReporter, nsIMemoryReporter)
|
||||
|
||||
class D2DVRAMReporter :
|
||||
public nsIMemoryReporter
|
||||
{
|
||||
public:
|
||||
D2DVRAMReporter()
|
||||
{ }
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD GetPath(char **memoryPath) {
|
||||
*memoryPath = strdup("gfx/d2d/surfacevram");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHOD GetDescription(char **desc) {
|
||||
*desc = strdup("Video memory used by D2D surfaces");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHOD GetMemoryUsed(PRInt64 *memoryUsed) {
|
||||
*memoryUsed = cairo_d2d_get_surface_vram_usage(
|
||||
gfxWindowsPlatform::GetPlatform()->GetD2DDevice()
|
||||
);
|
||||
return NS_OK;
|
||||
}
|
||||
};
|
||||
|
||||
NS_IMPL_ISUPPORTS1(D2DVRAMReporter, nsIMemoryReporter)
|
||||
#endif
|
||||
|
||||
#ifdef WINCE
|
||||
|
@ -189,6 +218,7 @@ gfxWindowsPlatform::gfxWindowsPlatform()
|
|||
|
||||
#ifdef CAIRO_HAS_D2D_SURFACE
|
||||
NS_RegisterMemoryReporter(new D2DCacheReporter());
|
||||
NS_RegisterMemoryReporter(new D2DVRAMReporter());
|
||||
mD2DDevice = NULL;
|
||||
|
||||
if (isVistaOrHigher) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче