Bug 915940. Only report memory allocated from gfxWindowsSurfaces if it is actually allocated. r=jrmuizel
authorNicholas Cameron <ncameron@mozilla.com>
Wed, 25 Sep 2013 14:14:39 +1200
changeset 148613 072594314b133232aad433abf8744ab379efb496
parent 148612 2ebbcdeeab08a40ef1475ac18a8dea44790bcd6c
child 148614 a87ff44842e633e4df9709d51db963e54a0a4c08
push id25349
push userryanvm@gmail.com
push dateWed, 25 Sep 2013 18:52:12 +0000
treeherdermozilla-central@39f30376058c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs915940
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 915940. Only report memory allocated from gfxWindowsSurfaces if it is actually allocated. r=jrmuizel
gfx/thebes/gfxWindowsSurface.cpp
--- a/gfx/thebes/gfxWindowsSurface.cpp
+++ b/gfx/thebes/gfxWindowsSurface.cpp
@@ -55,22 +55,22 @@ gfxWindowsSurface::gfxWindowsSurface(con
     if (!CheckSurfaceSize(size))
         MakeInvalid(size);
 
     cairo_surface_t *surf = cairo_win32_surface_create_with_dib((cairo_format_t)imageFormat,
                                                                 size.width, size.height);
 
     Init(surf);
 
-    RecordMemoryUsed(size.width * size.height * 4 + sizeof(gfxWindowsSurface));
-
-    if (CairoStatus() == 0)
+    if (CairoStatus() == CAIRO_STATUS_SUCCESS) {
         mDC = cairo_win32_surface_get_dc(CairoSurface());
-    else
+        RecordMemoryUsed(size.width * size.height * 4 + sizeof(gfxWindowsSurface));
+    } else {
         mDC = nullptr;
+    }
 }
 
 gfxWindowsSurface::gfxWindowsSurface(HDC dc, const gfxIntSize& realSize, gfxImageFormat imageFormat) :
     mOwnsDC(false), mForPrinting(false), mWnd(nullptr)
 {
     gfxIntSize size(realSize);
     if (!CheckSurfaceSize(size))
         MakeInvalid(size);