Bug 756601 - Record memory usage for gfxQuartzSurface. r=jrmuizel

This commit is contained in:
Matt Woodrow 2013-05-10 09:02:49 +12:00
parent 99faba83a1
commit cea9782bd9

View File

@ -34,6 +34,9 @@ gfxQuartzSurface::gfxQuartzSurface(const gfxSize& desiredSize, gfxImageFormat fo
CGContextRetain(mCGContext);
Init(surf);
if (mSurfaceValid) {
RecordMemoryUsed(mSize.height * 4 + sizeof(gfxQuartzSurface));
}
}
gfxQuartzSurface::gfxQuartzSurface(CGContextRef context,
@ -56,6 +59,9 @@ gfxQuartzSurface::gfxQuartzSurface(CGContextRef context,
CGContextRetain(mCGContext);
Init(surf);
if (mSurfaceValid) {
RecordMemoryUsed(mSize.height * 4 + sizeof(gfxQuartzSurface));
}
}
gfxQuartzSurface::gfxQuartzSurface(CGContextRef context,
@ -76,6 +82,9 @@ gfxQuartzSurface::gfxQuartzSurface(CGContextRef context,
CGContextRetain(mCGContext);
Init(surf);
if (mSurfaceValid) {
RecordMemoryUsed(mSize.height * 4 + sizeof(gfxQuartzSurface));
}
}
gfxQuartzSurface::gfxQuartzSurface(cairo_surface_t *csurf,
@ -111,6 +120,9 @@ gfxQuartzSurface::gfxQuartzSurface(unsigned char *data,
CGContextRetain(mCGContext);
Init(surf);
if (mSurfaceValid) {
RecordMemoryUsed(mSize.height * stride + sizeof(gfxQuartzSurface));
}
}
already_AddRefed<gfxASurface>