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

Unified Diff: src/effects/SkColorFilterImageFilter.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: Fixed comments 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/SkColorFilterImageFilter.cpp
diff --git a/src/effects/SkColorFilterImageFilter.cpp b/src/effects/SkColorFilterImageFilter.cpp
index 2a8df5c672109a4aee428e9801af6c305c0c89d4..b9afbf06404f69a1b797fbcbd2ce9eac5734b343 100755
--- a/src/effects/SkColorFilterImageFilter.cpp
+++ b/src/effects/SkColorFilterImageFilter.cpp
@@ -60,6 +60,9 @@ bool matrix_needs_clamping(SkScalar matrix[20]) {
SkColorFilterImageFilter* SkColorFilterImageFilter::Create(SkColorFilter* cf,
SkImageFilter* input, const CropRect* cropRect, uint32_t uniqueID) {
SkASSERT(cf);
+ if (NULL == cf) {
+ return NULL;
+ }
SkScalar colorMatrix[20], inputMatrix[20];
SkColorFilter* inputColorFilter;
if (input && cf->asColorMatrix(colorMatrix)
@@ -141,7 +144,7 @@ bool SkColorFilterImageFilter::asColorFilter(SkColorFilter** filter) const {
if (!cropRectIsSet()) {
if (filter) {
*filter = fColorFilter;
- fColorFilter->ref();
+ SkSafeRef(fColorFilter);
reed1 2014/10/29 18:27:08 When can this ever be NULL?
sugoi1 2014/10/29 18:30:58 I was just trying to be consistent with constructo
}
return true;
}

Powered by Google App Engine
This is Rietveld 408576698