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

Unified Diff: src/core/SkLocalMatrixShader.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
« no previous file with comments | « no previous file | src/effects/SkColorFilterImageFilter.cpp » ('j') | src/effects/SkColorFilterImageFilter.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkLocalMatrixShader.cpp
diff --git a/src/core/SkLocalMatrixShader.cpp b/src/core/SkLocalMatrixShader.cpp
index 62840dd3af63e51a7c5b269fe645488492fd2b43..199628e85b7f17c845288bd8794f94b3f73de5b4 100644
--- a/src/core/SkLocalMatrixShader.cpp
+++ b/src/core/SkLocalMatrixShader.cpp
@@ -60,8 +60,8 @@ void SkLocalMatrixShader::toString(SkString* str) const {
#endif
SkShader* SkShader::CreateLocalMatrixShader(SkShader* proxy, const SkMatrix& localMatrix) {
- if (localMatrix.isIdentity()) {
- return SkRef(proxy);
+ if (localMatrix.isIdentity() || !proxy) {
sugoi1 2014/10/29 15:26:12 proxy may be NULL (see SkRectShaderImageFilter)
reed1 2014/10/29 15:43:38 Would this be even clearer as: if (NULL == proxy)
sugoi1 2014/10/29 18:21:00 Done.
+ return SkSafeRef(proxy);
}
const SkMatrix* lm = &localMatrix;
« no previous file with comments | « no previous file | src/effects/SkColorFilterImageFilter.cpp » ('j') | src/effects/SkColorFilterImageFilter.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698