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

Side by Side Diff: src/animator/SkAnimateBase.cpp

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « src/animator/SkAnimateActive.cpp ('k') | src/animator/SkAnimateField.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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkAnimateBase.h" 10 #include "SkAnimateBase.h"
(...skipping 21 matching lines...) Expand all
32 SK_MEMBER(target, DynamicString), 32 SK_MEMBER(target, DynamicString),
33 SK_MEMBER(to, DynamicString), 33 SK_MEMBER(to, DynamicString),
34 SK_MEMBER_PROPERTY(values, DynamicString) 34 SK_MEMBER_PROPERTY(values, DynamicString)
35 }; 35 };
36 36
37 #endif 37 #endif
38 38
39 DEFINE_GET_MEMBER(SkAnimateBase); 39 DEFINE_GET_MEMBER(SkAnimateBase);
40 40
41 SkAnimateBase::SkAnimateBase() : begin(0), dur(1), repeat(SK_Scalar1), 41 SkAnimateBase::SkAnimateBase() : begin(0), dur(1), repeat(SK_Scalar1),
42 fApply(NULL), fFieldInfo(NULL), fFieldOffset(0), fStart((SkMSec) -1), fT arget(NULL), 42 fApply(nullptr), fFieldInfo(nullptr), fFieldOffset(0), fStart((SkMSec) - 1), fTarget(nullptr),
43 fChanged(0), fDelayed(0), fDynamic(0), fHasEndEvent(0), fHasValues(0), 43 fChanged(0), fDelayed(0), fDynamic(0), fHasEndEvent(0), fHasValues(0),
44 fMirror(0), fReset(0), fResetPending(0), fTargetIsScope(0) { 44 fMirror(0), fReset(0), fResetPending(0), fTargetIsScope(0) {
45 blend.setCount(1); 45 blend.setCount(1);
46 blend[0] = SK_Scalar1; 46 blend[0] = SK_Scalar1;
47 } 47 }
48 48
49 SkAnimateBase::~SkAnimateBase() { 49 SkAnimateBase::~SkAnimateBase() {
50 SkDisplayTypes type = fValues.getType(); 50 SkDisplayTypes type = fValues.getType();
51 if (type == SkType_String || type == SkType_DynamicString) { 51 if (type == SkType_String || type == SkType_DynamicString) {
52 SkASSERT(fValues.count() == 1); 52 SkASSERT(fValues.count() == 1);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 case SK_PROPERTY(mirror): 109 case SK_PROPERTY(mirror):
110 boolResult = fMirror; 110 boolResult = fMirror;
111 goto returnBool; 111 goto returnBool;
112 case SK_PROPERTY(reset): 112 case SK_PROPERTY(reset):
113 boolResult = fReset; 113 boolResult = fReset;
114 returnBool: 114 returnBool:
115 value->fOperand.fS32 = SkToBool(boolResult); 115 value->fOperand.fS32 = SkToBool(boolResult);
116 value->fType = SkType_Boolean; 116 value->fType = SkType_Boolean;
117 break; 117 break;
118 case SK_PROPERTY(step): 118 case SK_PROPERTY(step):
119 if (fApply == NULL) 119 if (fApply == nullptr)
120 return false; // !!! notify there's an error? 120 return false; // !!! notify there's an error?
121 fApply->getStep(value); 121 fApply->getStep(value);
122 break; 122 break;
123 case SK_PROPERTY(values): 123 case SK_PROPERTY(values):
124 value->fOperand.fString = (SkString*) &to; 124 value->fOperand.fString = (SkString*) &to;
125 value->fType = SkType_String; 125 value->fType = SkType_String;
126 break; 126 break;
127 default: 127 default:
128 SkASSERT(0); 128 SkASSERT(0);
129 return false; 129 return false;
(...skipping 11 matching lines...) Expand all
141 setTarget(maker); 141 setTarget(maker);
142 if (field.size()) { 142 if (field.size()) {
143 SkASSERT(fTarget); 143 SkASSERT(fTarget);
144 fFieldInfo = fTarget->getMember(field.c_str()); 144 fFieldInfo = fTarget->getMember(field.c_str());
145 field.reset(); 145 field.reset();
146 } 146 }
147 if (lval.size()) { 147 if (lval.size()) {
148 // lval must be of the form x[y] 148 // lval must be of the form x[y]
149 const char* lvalStr = lval.c_str(); 149 const char* lvalStr = lval.c_str();
150 const char* arrayEnd = strchr(lvalStr, '['); 150 const char* arrayEnd = strchr(lvalStr, '[');
151 if (arrayEnd == NULL) 151 if (arrayEnd == nullptr)
152 return; //should this return an error? 152 return; //should this return an error?
153 size_t arrayNameLen = arrayEnd - lvalStr; 153 size_t arrayNameLen = arrayEnd - lvalStr;
154 SkString arrayStr(lvalStr, arrayNameLen); 154 SkString arrayStr(lvalStr, arrayNameLen);
155 SkASSERT(fTarget); //this return an error? 155 SkASSERT(fTarget); //this return an error?
156 fFieldInfo = fTarget->getMember(arrayStr.c_str()); 156 fFieldInfo = fTarget->getMember(arrayStr.c_str());
157 SkString scriptStr(arrayEnd + 1, lval.size() - arrayNameLen - 2); 157 SkString scriptStr(arrayEnd + 1, lval.size() - arrayNameLen - 2);
158 SkAnimatorScript::EvaluateInt(maker, this, scriptStr.c_str(), &fFieldOff set); 158 SkAnimatorScript::EvaluateInt(maker, this, scriptStr.c_str(), &fFieldOff set);
159 } 159 }
160 } 160 }
161 161
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 return; 226 return;
227 } 227 }
228 if (fApply && fApply->getMode() != SkApply::kMode_create) 228 if (fApply && fApply->getMode() != SkApply::kMode_create)
229 target.reset(); 229 target.reset();
230 } 230 }
231 } 231 }
232 232
233 bool SkAnimateBase::targetNeedsInitialization() const { 233 bool SkAnimateBase::targetNeedsInitialization() const {
234 return false; 234 return false;
235 } 235 }
OLDNEW
« no previous file with comments | « src/animator/SkAnimateActive.cpp ('k') | src/animator/SkAnimateField.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698