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 286977 79c6b8d014d2ab5f2378d9f6eee10abb0cd5e1c1
parent 286938 5010f1531d258d5eacb4ca21774b9ed8a2388bb2
child 286978 bf7681b1567ebd37913844e068fcb530e7683d9f
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [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,