Backed out changeset 08a097c4ea86 (bug 1255961) for build bustage CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Wed, 30 Mar 2016 10:20:58 -0700
changeset 291095 3b74da083e58b7464159789e20431979713842bd
parent 291094 39e3c3e2970e8a3f59d99349f54d81493d50b1f8
child 291096 bccb11375f2af838cda714d42fd8cef78f5c7bf1
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1255961
milestone48.0a1
backs out08a097c4ea862f80c537d784de3635e1dcbf0f70
Backed out changeset 08a097c4ea86 (bug 1255961) for build bustage CLOSED TREE MozReview-Commit-ID: 2oPAnEwBpit
gfx/layers/BufferTexture.cpp
--- a/gfx/layers/BufferTexture.cpp
+++ b/gfx/layers/BufferTexture.cpp
@@ -395,33 +395,30 @@ MemoryTextureData::Serialize(SurfaceDesc
   }
 
   uintptr_t ptr = reinterpret_cast<uintptr_t>(mBuffer);
   aOutDescriptor = SurfaceDescriptorBuffer(mDescriptor, MemoryOrShmem(ptr));
 
   return true;
 }
 
-static bool
-InitBuffer(uint8_t* buf, size_t bufSize,
-           gfx::SurfaceFormat aFormat, TextureAllocationFlags aAllocFlags,
-           bool aAlreadyZero)
+static bool InitBuffer(uint8_t* buf, size_t bufSize, gfx::SurfaceFormat aFormat, TextureAllocationFlags aAllocFlags)
 {
   if (!buf) {
     gfxDebug() << "BufferTextureData: Failed to allocate " << bufSize << " bytes";
     return false;
   }
 
   if ((aAllocFlags & ALLOC_CLEAR_BUFFER) ||
       (aAllocFlags & ALLOC_CLEAR_BUFFER_BLACK)) {
     if (aFormat == gfx::SurfaceFormat::B8G8R8X8) {
       // Even though BGRX was requested, XRGB_UINT32 is what is meant,
       // so use 0xFF000000 to put alpha in the right place.
       std::fill_n(reinterpret_cast<uint32_t*>(buf), bufSize / sizeof(uint32_t), 0xFF000000);
-    } else if (!aAlreadyZero) {
+    } else {
       memset(buf, 0, bufSize);
     }
   }
 
   if (aAllocFlags & ALLOC_CLEAR_BUFFER_WHITE) {
     memset(buf, 0xFF, bufSize);
   }
 
@@ -443,17 +440,17 @@ MemoryTextureData::Create(gfx::IntSize a
   }
 
   uint32_t bufSize = ImageDataSerializer::ComputeRGBBufferSize(aSize, aFormat);
   if (!bufSize) {
     return nullptr;
   }
 
   uint8_t* buf = new (fallible) uint8_t[bufSize];
-  if (!InitBuffer(buf, bufSize, aFormat, aAllocFlags, false)) {
+  if (!InitBuffer(buf, bufSize, aFormat, aAllocFlags)) {
     return nullptr;
   }
 
   auto fwd = aAllocator ? aAllocator->AsCompositableForwarder() : nullptr;
   bool hasIntermediateBuffer = fwd ? ComputeHasIntermediateBuffer(aFormat,
                                               fwd->GetCompositorBackendType())
                                    : true;
 
@@ -520,17 +517,17 @@ ShmemTextureData::Create(gfx::IntSize aS
   }
 
   mozilla::ipc::Shmem shm;
   if (!aAllocator->AsShmemAllocator()->AllocUnsafeShmem(bufSize, OptimalShmemType(), &shm)) {
     return nullptr;
   }
 
   uint8_t* buf = shm.get<uint8_t>();
-  if (!InitBuffer(buf, bufSize, aFormat, aAllocFlags, true)) {
+  if (!InitBuffer(buf, bufSize, aFormat, aAllocFlags)) {
     return nullptr;
   }
 
   auto fwd = aAllocator->AsCompositableForwarder();
   bool hasIntermediateBuffer = fwd ? ComputeHasIntermediateBuffer(aFormat,
                                               fwd->GetCompositorBackendType())
                                    : true;