Backed out changeset bb80c2b08bc0 (bug 1076695) for being the likely cause of the ASAN reftest permafail
authorWes Kocher <wkocher@mozilla.com>
Tue, 07 Oct 2014 17:30:54 -0700
changeset 209249 f622aedd4348c7b0cff5f166859eee571b010b79
parent 209248 81eafec98b48dad1ae75659cdc3235bf7e5c8be0
child 209250 0564e5f5037c1f948f8760f9cfa87cc99d4a63a1
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
bugs1076695
milestone35.0a1
backs outbb80c2b08bc0de837f72d39e6574015d897abeac
Backed out changeset bb80c2b08bc0 (bug 1076695) for being the likely cause of the ASAN reftest permafail
gfx/2d/FilterNodeSoftware.cpp
--- a/gfx/2d/FilterNodeSoftware.cpp
+++ b/gfx/2d/FilterNodeSoftware.cpp
@@ -1151,51 +1151,41 @@ FilterNodeTransformSoftware::SourceRectF
 }
 
 TemporaryRef<DataSourceSurface>
 FilterNodeTransformSoftware::Render(const IntRect& aRect)
 {
   IntRect srcRect = SourceRectForOutputRect(aRect);
 
   RefPtr<DataSourceSurface> input =
-    GetInputDataSourceSurface(IN_TRANSFORM_IN, srcRect);
+    GetInputDataSourceSurface(IN_TRANSFORM_IN, srcRect, NEED_COLOR_CHANNELS);
 
   if (!input) {
     return nullptr;
   }
 
   Matrix transform = Matrix::Translation(srcRect.x, srcRect.y) * mMatrix *
                      Matrix::Translation(-aRect.x, -aRect.y);
   if (transform.IsIdentity() && srcRect.Size() == aRect.Size()) {
     return input.forget();
   }
 
-  RefPtr<DataSourceSurface> surf =
-    Factory::CreateDataSourceSurface(aRect.Size(), input->GetFormat());
-
-  DataSourceSurface::MappedSurface mapping;
-  surf->Map(DataSourceSurface::MapType::WRITE, &mapping);
-
   RefPtr<DrawTarget> dt =
-    Factory::CreateDrawTargetForData(BackendType::CAIRO,
-                                     mapping.mData,
-                                     surf->GetSize(),
-                                     mapping.mStride,
-                                     surf->GetFormat());
+    Factory::CreateDrawTarget(BackendType::CAIRO, aRect.Size(), input->GetFormat());
   if (!dt) {
     return nullptr;
   }
 
   Rect r(0, 0, srcRect.width, srcRect.height);
   dt->SetTransform(transform);
   dt->DrawSurface(input, r, r, DrawSurfaceOptions(mFilter));
 
-  dt->Flush();
-  surf->Unmap();
-  return surf.forget();
+  RefPtr<SourceSurface> result = dt->Snapshot();
+  RefPtr<DataSourceSurface> resultData = result->GetDataSurface();
+  return resultData.forget();
 }
 
 void
 FilterNodeTransformSoftware::RequestFromInputsForRect(const IntRect &aRect)
 {
   RequestInputRect(IN_TRANSFORM_IN, SourceRectForOutputRect(aRect));
 }