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

Side by Side 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: Fixed nits Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/effects/SkColorFilterImageFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkLocalMatrixShader.h" 8 #include "SkLocalMatrixShader.h"
9 9
10 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING 10 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 fProxyShader->toString(str); 54 fProxyShader->toString(str);
55 55
56 this->INHERITED::toString(str); 56 this->INHERITED::toString(str);
57 57
58 str->append(")"); 58 str->append(")");
59 } 59 }
60 #endif 60 #endif
61 61
62 SkShader* SkShader::CreateLocalMatrixShader(SkShader* proxy, const SkMatrix& loc alMatrix) { 62 SkShader* SkShader::CreateLocalMatrixShader(SkShader* proxy, const SkMatrix& loc alMatrix) {
63 if (NULL == proxy) {
64 return NULL;
65 }
66
63 if (localMatrix.isIdentity()) { 67 if (localMatrix.isIdentity()) {
64 return SkRef(proxy); 68 return SkRef(proxy);
65 } 69 }
66 70
67 const SkMatrix* lm = &localMatrix; 71 const SkMatrix* lm = &localMatrix;
68 72
69 SkMatrix otherLocalMatrix; 73 SkMatrix otherLocalMatrix;
70 SkAutoTUnref<SkShader> otherProxy(proxy->refAsALocalMatrixShader(&otherLocal Matrix)); 74 SkAutoTUnref<SkShader> otherProxy(proxy->refAsALocalMatrixShader(&otherLocal Matrix));
71 if (otherProxy.get()) { 75 if (otherProxy.get()) {
72 otherLocalMatrix.preConcat(localMatrix); 76 otherLocalMatrix.preConcat(localMatrix);
73 lm = &otherLocalMatrix; 77 lm = &otherLocalMatrix;
74 proxy = otherProxy.get(); 78 proxy = otherProxy.get();
75 } 79 }
76 80
77 return SkNEW_ARGS(SkLocalMatrixShader, (proxy, *lm)); 81 return SkNEW_ARGS(SkLocalMatrixShader, (proxy, *lm));
78 } 82 }
OLDNEW
« no previous file with comments | « no previous file | src/effects/SkColorFilterImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698