Bug 1034370 - Make sure we release the SkImageFilter in DrawTargetSkia::DrawSurfaceWithShadow. r=gw280
☠☠ backed out by d45d53f73998 ☠ ☠
authorMatt Woodrow <mwoodrow@mozilla.com>
Wed, 29 Jul 2015 16:35:55 -0400
changeset 255272 79c6b8d014d2ab5f2378d9f6eee10abb0cd5e1c1
parent 255271 5010f1531d258d5eacb4ca21774b9ed8a2388bb2
child 255273 bf7681b1567ebd37913844e068fcb530e7683d9f
push id62993
push usermwoodrow@mozilla.com
push dateWed, 29 Jul 2015 20:37:34 +0000
treeherdermozilla-inbound@e2a6160242e5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgw280
bugs1034370
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1034370 - Make sure we release the SkImageFilter in DrawTargetSkia::DrawSurfaceWithShadow. r=gw280
gfx/2d/DrawTargetSkia.cpp
--- a/gfx/2d/DrawTargetSkia.cpp
+++ b/gfx/2d/DrawTargetSkia.cpp
@@ -425,21 +425,21 @@ DrawTargetSkia::DrawSurfaceWithShadow(So
 
   mCanvas->save();
   mCanvas->resetMatrix();
 
   TempBitmap bitmap = GetBitmapForSurface(aSurface);
 
   SkPaint paint;
 
-  SkImageFilter* filter = SkDropShadowImageFilter::Create(aOffset.x, aOffset.y,
-                                                          aSigma, aSigma,
-                                                          ColorToSkColor(aColor, 1.0));
+  SkAutoTUnref<SkImageFilter> filter(SkDropShadowImageFilter::Create(aOffset.x, aOffset.y,
+                                                                     aSigma, aSigma,
+                                                                     ColorToSkColor(aColor, 1.0)));
 
-  paint.setImageFilter(filter);
+  paint.setImageFilter(filter.get());
   paint.setXfermodeMode(GfxOpToSkiaOp(aOperator));
 
   mCanvas->drawBitmap(bitmap.mBitmap, aDest.x, aDest.y, &paint);
   mCanvas->restore();
 }
 
 void
 DrawTargetSkia::FillRect(const Rect &aRect,