Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(985)

Unified Diff: src/effects/SkRectShaderImageFilter.cpp

Issue 675013003: Trying to be consistent when members are allowed to be NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/effects/SkRectShaderImageFilter.cpp
diff --git a/src/effects/SkRectShaderImageFilter.cpp b/src/effects/SkRectShaderImageFilter.cpp
index fb34ed0007152f124ae557a5567aad4effa3bed5..f02961128a22abb2f71cbad173c0e00c049e1741 100644
--- a/src/effects/SkRectShaderImageFilter.cpp
+++ b/src/effects/SkRectShaderImageFilter.cpp
@@ -33,7 +33,7 @@ SkRectShaderImageFilter::SkRectShaderImageFilter(SkShader* s, const CropRect* cr
: INHERITED(0, NULL, cropRect, uniqueID)
, fShader(s) {
SkASSERT(s);
- s->ref();
+ SkSafeRef(s);
sugoi1 2014/10/29 15:26:12 This class' destructor calls SkSafeUnref(), so the
reed1 2014/10/29 15:43:39 How did we get called with a NULL. Is this guy onl
sugoi1 2014/10/29 18:21:00 Done.
}
#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
@@ -78,7 +78,7 @@ bool SkRectShaderImageFilter::onFilterImage(Proxy* proxy,
SkPaint paint;
SkMatrix matrix(ctx.ctm());
matrix.postTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top()));
- paint.setShader(SkShader::CreateLocalMatrixShader(fShader, matrix))->unref();
+ SkSafeUnref(paint.setShader(SkShader::CreateLocalMatrixShader(fShader, matrix)));
sugoi1 2014/10/29 15:26:12 If fShader can be NULL, then SkShader::CreateLocal
SkRect rect = SkRect::MakeWH(SkIntToScalar(bounds.width()), SkIntToScalar(bounds.height()));
canvas.drawRect(rect, paint);
« src/effects/SkColorFilterImageFilter.cpp ('K') | « src/effects/SkColorFilterImageFilter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698