Bug 877034 - Initialize MemoryImage to 0 to match the behaviour of Shmem. r=nical
authorMatt Woodrow <mwoodrow@mozilla.com>
Thu, 30 May 2013 14:44:08 +1200
changeset 140514 4b7ae86b186e61d0a61e44a5b94dfcf837f61617
parent 140513 f6df6e1faf8758a4ab312d77cc01ad06c999c644
child 140515 f9c1d3eb3ce633367dbde13dc1af1cc15f9d1ff3
push id3911
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 20:17:26 +0000
treeherdermozilla-aurora@7e26ca8db92b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs877034
milestone24.0a1
Bug 877034 - Initialize MemoryImage to 0 to match the behaviour of Shmem. r=nical
gfx/layers/ipc/ISurfaceAllocator.cpp
--- a/gfx/layers/ipc/ISurfaceAllocator.cpp
+++ b/gfx/layers/ipc/ISurfaceAllocator.cpp
@@ -86,16 +86,17 @@ ISurfaceAllocator::AllocSurfaceDescripto
     return true;
   }
 
   if (XRE_GetProcessType() == GeckoProcessType_Default) {
     gfxImageFormat format =
       gfxPlatform::GetPlatform()->OptimalFormatForContent(aContent);
     int32_t stride = gfxASurface::FormatStrideForWidth(format, aSize.width);
     uint8_t *data = new uint8_t[stride * aSize.height];
+    memset(data, 0, stride * aSize.height);
 
     *aBuffer = MemoryImage((uintptr_t)data, aSize, stride, format);
     return true;
   }
 
   nsRefPtr<gfxSharedImageSurface> buffer;
   if (!AllocSharedImageSurface(aSize, aContent,
                                getter_AddRefs(buffer))) {