Backed out changeset 6d9cf51a012a (bug 949360) because of mochitest-3 timeouts on a CLOSED TREE
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 12 Dec 2013 11:26:24 -0500
changeset 160146 7631ae46b853d21d23a050191c198e0304516291
parent 160145 30e13828609f08f780a2da933541919ebf3bc20f
child 160147 6f419c7c2873aa5b1b4819dd3774de7da06907ba
push id1672
push userkvijayan@mozilla.com
push dateThu, 12 Dec 2013 20:08:00 +0000
bugs949360
milestone29.0a1
backs out6d9cf51a012a74c503df861208f3188677a17673
Backed out changeset 6d9cf51a012a (bug 949360) because of mochitest-3 timeouts on a CLOSED TREE
gfx/layers/ImageContainer.cpp
gfx/layers/ipc/SharedPlanarYCbCrImage.cpp
--- a/gfx/layers/ImageContainer.cpp
+++ b/gfx/layers/ImageContainer.cpp
@@ -485,27 +485,24 @@ CopyPlane(uint8_t *aDst, const uint8_t *
 }
 
 void
 PlanarYCbCrImage::CopyData(const Data& aData)
 {
   mData = aData;
 
   // update buffer size
-  size_t size = mData.mCbCrStride * mData.mCbCrSize.height * 2 +
+  mBufferSize = mData.mCbCrStride * mData.mCbCrSize.height * 2 +
                 mData.mYStride * mData.mYSize.height;
 
   // get new buffer
-  mBuffer = AllocateBuffer(size);
+  mBuffer = AllocateBuffer(mBufferSize);
   if (!mBuffer)
     return;
 
-  // update buffer size
-  mBufferSize = size;
-
   mData.mYChannel = mBuffer;
   mData.mCbChannel = mData.mYChannel + mData.mYStride * mData.mYSize.height;
   mData.mCrChannel = mData.mCbChannel + mData.mCbCrStride * mData.mCbCrSize.height;
 
   CopyPlane(mData.mYChannel, aData.mYChannel,
             mData.mYSize, mData.mYStride, mData.mYSkip);
   CopyPlane(mData.mCbChannel, aData.mCbChannel,
             mData.mCbCrSize, mData.mCbCrStride, mData.mCbSkip);
@@ -534,22 +531,21 @@ PlanarYCbCrImage::SetDataNoCopy(const Da
 {
   mData = aData;
   mSize = aData.mPicSize;
 }
 
 uint8_t*
 PlanarYCbCrImage::AllocateAndGetNewBuffer(uint32_t aSize)
 {
+  // update buffer size
+  mBufferSize = aSize;
+
   // get new buffer
-  mBuffer = AllocateBuffer(aSize);
-  if (mBuffer) {
-    // update buffer size
-    mBufferSize = aSize;
-  }
+  mBuffer = AllocateBuffer(mBufferSize); 
   return mBuffer;
 }
 
 already_AddRefed<gfxASurface>
 PlanarYCbCrImage::GetAsSurface()
 {
   if (mSurface) {
     nsRefPtr<gfxASurface> result = mSurface.get();
--- a/gfx/layers/ipc/SharedPlanarYCbCrImage.cpp
+++ b/gfx/layers/ipc/SharedPlanarYCbCrImage.cpp
@@ -121,26 +121,24 @@ SharedPlanarYCbCrImage::SetData(const Pl
 
 // needs to be overriden because the parent class sets mBuffer which we
 // do not want to happen.
 uint8_t*
 SharedPlanarYCbCrImage::AllocateAndGetNewBuffer(uint32_t aSize)
 {
   NS_ABORT_IF_FALSE(!mTextureClient->IsAllocated(), "This image already has allocated data");
   size_t size = YCbCrImageDataSerializer::ComputeMinBufferSize(aSize);
-
-  // get new buffer _without_ setting mBuffer.
-  if (!mTextureClient->Allocate(size)) {
-    return nullptr;
-  }
-
   // update buffer size
   mBufferSize = size;
 
+  // get new buffer _without_ setting mBuffer.
+  bool status = mTextureClient->Allocate(mBufferSize);
+  MOZ_ASSERT(status);
   YCbCrImageDataSerializer serializer(mTextureClient->GetBuffer());
+
   return serializer.GetData();
 }
 
 void
 SharedPlanarYCbCrImage::SetDataNoCopy(const Data &aData)
 {
   mData = aData;
   mSize = aData.mPicSize;
@@ -245,29 +243,27 @@ DeprecatedSharedPlanarYCbCrImage::SetDat
 
 // needs to be overriden because the parent class sets mBuffer which we
 // do not want to happen.
 uint8_t*
 DeprecatedSharedPlanarYCbCrImage::AllocateAndGetNewBuffer(uint32_t aSize)
 {
   NS_ABORT_IF_FALSE(!mAllocated, "This image already has allocated data");
   size_t size = YCbCrImageDataSerializer::ComputeMinBufferSize(aSize);
-
-  // get new buffer _without_ setting mBuffer.
-  if (!AllocateBuffer(size)) {
-    return nullptr;
-  }
-
   // update buffer size
   mBufferSize = size;
 
+  // get new buffer _without_ setting mBuffer.
+  AllocateBuffer(mBufferSize);
   YCbCrImageDataSerializer serializer(mShmem.get<uint8_t>());
+
   return serializer.GetData();
 }
 
+
 void
 DeprecatedSharedPlanarYCbCrImage::SetDataNoCopy(const Data &aData)
 {
   mData = aData;
   mSize = aData.mPicSize;
   YCbCrImageDataSerializer serializer(mShmem.get<uint8_t>());
   serializer.InitializeBufferInfo(aData.mYSize,
                                   aData.mCbCrSize,