Backed out changeset 6d81ec591658 (bug 1167356) for bustage.
authorRyan VanderMeulen <ryanvm@gmail.com>
Fri, 19 Jun 2015 11:31:28 -0400
changeset 201233 dba95c67db3236c4485a3fbd5ea1600646d5a005
parent 201232 6d81ec591658eeac64f6bc090b7cc04b4d4283e7
child 201234 3290ae4fe9f3b46e55db675be02c4142169cdf43
push id291
push userryanvm@gmail.com
push dateFri, 19 Jun 2015 15:32:37 +0000
treeherdermozilla-esr31@3290ae4fe9f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1167356
milestone31.7.0
backs out6d81ec591658eeac64f6bc090b7cc04b4d4283e7
Backed out changeset 6d81ec591658 (bug 1167356) for bustage.
gfx/2d/SourceSurfaceD2D1.cpp
gfx/gl/GLScreenBuffer.cpp
gfx/gl/SharedSurfaceGL.cpp
gfx/layers/YCbCrImageDataSerializer.cpp
gfx/layers/opengl/CompositorOGL.cpp
gfx/thebes/gfxPlatform.cpp
widget/gtk/nsImageToPixbuf.cpp
--- a/gfx/2d/SourceSurfaceD2D1.cpp
+++ b/gfx/2d/SourceSurfaceD2D1.cpp
@@ -151,20 +151,17 @@ DataSourceSurfaceD2D1::Map(MapType aMapT
   D2D1_MAP_OPTIONS options;
   if (aMapType == MapType::READ) {
     options = D2D1_MAP_OPTIONS_READ;
   } else {
     MOZ_CRASH("No support for Write maps on D2D1 DataSourceSurfaces yet!");
   }
 
   D2D1_MAPPED_RECT map;
-  if (FAILED(mBitmap->Map(D2D1_MAP_OPTIONS_READ, &map))) {
-    gfxCriticalError() << "Failed to map bitmap.";
-    return false;
-  }
+  mBitmap->Map(D2D1_MAP_OPTIONS_READ, &map);
   aMappedSurface->mData = map.bits;
   aMappedSurface->mStride = map.pitch;
 
   mIsMapped = true;
   return true;
 }
 
 void
@@ -187,17 +184,14 @@ DataSourceSurfaceD2D1::Stride()
 void
 DataSourceSurfaceD2D1::EnsureMapped()
 {
   // Do not use GetData() after having used Map!
   MOZ_ASSERT(!mIsMapped);
   if (mMapped) {
     return;
   }
-  if (FAILED(mBitmap->Map(D2D1_MAP_OPTIONS_READ, &mMap))) {
-    gfxCriticalError() << "Failed to map bitmap.";
-    return;
-  }
+  mBitmap->Map(D2D1_MAP_OPTIONS_READ, &mMap);
   mMapped = true;
 }
 
 }
 }
--- a/gfx/gl/GLScreenBuffer.cpp
+++ b/gfx/gl/GLScreenBuffer.cpp
@@ -478,20 +478,17 @@ GLScreenBuffer::CreateRead(SharedSurface
     return ReadBuffer::Create(gl, caps, formats, surf);
 }
 
 void
 GLScreenBuffer::Readback(SharedSurface_GL* src, DataSourceSurface* dest)
 {
   MOZ_ASSERT(src && dest);
   DataSourceSurface::MappedSurface ms;
-  if (!dest->Map(DataSourceSurface::MapType::READ, &ms)) {
-    NS_ERROR("Failed to map surface for reading.");
-    return;
-  }
+  dest->Map(DataSourceSurface::MapType::READ, &ms);
   nsRefPtr<gfxImageSurface> wrappedDest =
     new gfxImageSurface(ms.mData,
                         ThebesIntSize(dest->GetSize()),
                         ms.mStride,
                         SurfaceFormatToImageFormat(dest->GetFormat()));
   DeprecatedReadback(src, wrappedDest);
   dest->Unmap();
 }
--- a/gfx/gl/SharedSurfaceGL.cpp
+++ b/gfx/gl/SharedSurfaceGL.cpp
@@ -321,20 +321,17 @@ SharedSurface_Basic::~SharedSurface_Basi
 void
 SharedSurface_Basic::Fence()
 {
     mGL->MakeCurrent();
 
     ScopedBindFramebuffer autoFB(mGL, mFB);
 
     DataSourceSurface::MappedSurface map;
-    if (!mData->Map(DataSourceSurface::MapType::WRITE, &map)) {
-      NS_ERROR("Failed to map surface for writing.");
-      return;
-    }
+    mData->Map(DataSourceSurface::MapType::WRITE, &map);
     nsRefPtr<gfxImageSurface> wrappedData =
       new gfxImageSurface(map.mData,
                           ThebesIntSize(mData->GetSize()),
                           map.mStride,
                           SurfaceFormatToImageFormat(mData->GetFormat()));
     ReadPixelsIntoImageSurface(mGL, wrappedData);
     mData->Unmap();
 }
--- a/gfx/layers/YCbCrImageDataSerializer.cpp
+++ b/gfx/layers/YCbCrImageDataSerializer.cpp
@@ -273,19 +273,17 @@ YCbCrImageDataSerializer::CopyData(const
 
 TemporaryRef<DataSourceSurface>
 YCbCrImageDataDeserializer::ToDataSourceSurface()
 {
   RefPtr<DataSourceSurface> result =
     Factory::CreateDataSourceSurface(GetYSize(), gfx::SurfaceFormat::B8G8R8X8);
 
   DataSourceSurface::MappedSurface map;
-  if (NS_WARN_IF(!result->Map(DataSourceSurface::MapType::WRITE, &map))) {
-    return nullptr;
-  }
+  result->Map(DataSourceSurface::MapType::WRITE, &map);
 
   gfx::ConvertYCbCrToRGB32(GetYData(), GetCbData(), GetCrData(),
                            map.mData,
                            0, 0, //pic x and y
                            GetYSize().width, GetYSize().height,
                            GetYStride(), GetCbCrStride(),
                            map.mStride,
                            gfx::YV12);
--- a/gfx/layers/opengl/CompositorOGL.cpp
+++ b/gfx/layers/opengl/CompositorOGL.cpp
@@ -1341,21 +1341,17 @@ CompositorOGL::CopyToTarget(DrawTarget *
     // to GL_COLOR_ATTACHMENT0 attachment point.
     mGLContext->fReadBuffer(LOCAL_GL_BACK);
   }
 
   RefPtr<DataSourceSurface> source =
         Factory::CreateDataSourceSurface(rect.Size(), gfx::SurfaceFormat::B8G8R8A8);
 
   DataSourceSurface::MappedSurface map;
-  if (!source->Map(DataSourceSurface::MapType::WRITE, &map)) {
-    NS_ERROR("Failed to map surface for writing!");
-    return;
-  }
-
+  source->Map(DataSourceSurface::MapType::WRITE, &map);
   // XXX we should do this properly one day without using the gfxImageSurface
   nsRefPtr<gfxImageSurface> surf =
     new gfxImageSurface(map.mData,
                         gfxIntSize(width, height),
                         map.mStride,
                         gfxImageFormat::ARGB32);
   ReadPixelsIntoImageSurface(mGLContext, surf);
   source->Unmap();
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -657,20 +657,18 @@ CopySurface(gfxASurface* aSurface)
   RefPtr<DataSourceSurface> data =
     Factory::CreateDataSourceSurface(ToIntSize(size),
                                      ImageFormatToSurfaceFormat(format));
   if (!data) {
     return nullptr;
   }
 
   DataSourceSurface::MappedSurface map;
-  if (!data->Map(DataSourceSurface::WRITE, &map)) {
-    NS_ERROR("Failed to map surface for reading!");
-    return nullptr;
-  }
+  DebugOnly<bool> result = data->Map(DataSourceSurface::WRITE, &map);
+  MOZ_ASSERT(result, "Should always succeed mapping raw data surfaces!");
 
   nsRefPtr<gfxImageSurface> image = new gfxImageSurface(map.mData, size, map.mStride, format);
   nsRefPtr<gfxContext> ctx = new gfxContext(image);
 
   ctx->SetSource(aSurface);
   ctx->SetOperator(gfxContext::OPERATOR_SOURCE);
   ctx->Paint();
 
--- a/widget/gtk/nsImageToPixbuf.cpp
+++ b/widget/gtk/nsImageToPixbuf.cpp
@@ -70,19 +70,17 @@ nsImageToPixbuf::SourceSurfaceToPixbuf(S
     if (!pixbuf)
         return nullptr;
 
     uint32_t destStride = gdk_pixbuf_get_rowstride (pixbuf);
     guchar* destPixels = gdk_pixbuf_get_pixels (pixbuf);
 
     RefPtr<DataSourceSurface> dataSurface = aSurface->GetDataSurface();
     DataSourceSurface::MappedSurface map;
-    if (!dataSurface->Map(DataSourceSurface::MapType::READ, &map))
-        return nullptr;
-
+    dataSurface->Map(DataSourceSurface::MapType::READ, &map);
     uint8_t* srcData = map.mData;
     int32_t srcStride = map.mStride;
 
     SurfaceFormat format = dataSurface->GetFormat();
 
     for (int32_t row = 0; row < aHeight; ++row) {
         for (int32_t col = 0; col < aWidth; ++col) {
             guchar* destPixel = destPixels + row * destStride + 4 * col;