Bug 1034370 - Make sure we release the SkImageFilter in DrawTargetSkia::DrawSurfaceWithShadow. r=gw280
authorMatt Woodrow <mwoodrow@mozilla.com>
Wed, 29 Jul 2015 16:35:55 -0400
changeset 255289 a0e8bdab52184d94352850d7d65212abe7b65adf
parent 255288 da2876c5f5acbc86183aaa64e1b11f6c0a6b6cc5
child 255290 223bbff210ab4e0c0bb8f6e3c081fe0fbe261189
push id62998
push usermwoodrow@mozilla.com
push dateWed, 29 Jul 2015 21:50:14 +0000
treeherdermozilla-inbound@6444888e596c [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,