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

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 nits 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
« no previous file with comments | « src/core/SkLocalMatrixShader.cpp ('k') | src/effects/SkRectShaderImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkColorFilterImageFilter.cpp
diff --git a/src/effects/SkColorFilterImageFilter.cpp b/src/effects/SkColorFilterImageFilter.cpp
index 2a8df5c672109a4aee428e9801af6c305c0c89d4..806dd5dd010b7758b49a108d87185af77066adff 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)
@@ -78,9 +81,7 @@ SkColorFilterImageFilter* SkColorFilterImageFilter::Create(SkColorFilter* cf,
SkColorFilterImageFilter::SkColorFilterImageFilter(SkColorFilter* cf,
SkImageFilter* input, const CropRect* cropRect, uint32_t uniqueID)
- : INHERITED(1, &input, cropRect, uniqueID), fColorFilter(cf) {
- SkASSERT(cf);
- SkSafeRef(cf);
+ : INHERITED(1, &input, cropRect, uniqueID), fColorFilter(SkRef(cf)) {
}
#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
@@ -102,7 +103,7 @@ void SkColorFilterImageFilter::flatten(SkWriteBuffer& buffer) const {
}
SkColorFilterImageFilter::~SkColorFilterImageFilter() {
- SkSafeUnref(fColorFilter);
+ fColorFilter->unref();
}
bool SkColorFilterImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source,
« no previous file with comments | « src/core/SkLocalMatrixShader.cpp ('k') | src/effects/SkRectShaderImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698