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

Side by Side Diff: src/animator/SkAnimateField.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/SkAnimateBase.cpp ('k') | src/animator/SkAnimateMaker.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 "SkAnimate.h" 10 #include "SkAnimate.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 SkDebugf("%g", SkScalarToFloat(blend[i])); 56 SkDebugf("%g", SkScalarToFloat(blend[i]));
57 } 57 }
58 SkDebugf("]\" "); 58 SkDebugf("]\" ");
59 } 59 }
60 SkDebugf("/>\n");//i assume that if it IS, we will do it separately 60 SkDebugf("/>\n");//i assume that if it IS, we will do it separately
61 } 61 }
62 } 62 }
63 #endif 63 #endif
64 64
65 bool SkAnimate::resolveCommon(SkAnimateMaker& maker) { 65 bool SkAnimate::resolveCommon(SkAnimateMaker& maker) {
66 if (fTarget == NULL) // if NULL, recall onEndElement after apply closes and sets target to scope 66 if (fTarget == nullptr) // if nullptr, recall onEndElement after apply close s and sets target to scope
67 return false; 67 return false;
68 INHERITED::onEndElement(maker); 68 INHERITED::onEndElement(maker);
69 return maker.hasError() == false; 69 return maker.hasError() == false;
70 } 70 }
71 71
72 void SkAnimate::onEndElement(SkAnimateMaker& maker) { 72 void SkAnimate::onEndElement(SkAnimateMaker& maker) {
73 bool resolved = resolveCommon(maker); 73 bool resolved = resolveCommon(maker);
74 if (resolved && fFieldInfo == NULL) { 74 if (resolved && fFieldInfo == nullptr) {
75 maker.setErrorNoun(field); 75 maker.setErrorNoun(field);
76 maker.setErrorCode(SkDisplayXMLParserError::kFieldNotInTarget); 76 maker.setErrorCode(SkDisplayXMLParserError::kFieldNotInTarget);
77 } 77 }
78 if (resolved == false || fFieldInfo == NULL) 78 if (resolved == false || fFieldInfo == nullptr)
79 return; 79 return;
80 SkDisplayTypes outType = fFieldInfo->getType(); 80 SkDisplayTypes outType = fFieldInfo->getType();
81 if (fHasValues) { 81 if (fHasValues) {
82 SkASSERT(to.size() > 0); 82 SkASSERT(to.size() > 0);
83 fFieldInfo->setValue(maker, &fValues, 0, 0, NULL, outType, to); 83 fFieldInfo->setValue(maker, &fValues, 0, 0, nullptr, outType, to);
84 SkASSERT(0); 84 SkASSERT(0);
85 // !!! this needs to set fComponents 85 // !!! this needs to set fComponents
86 return; 86 return;
87 } 87 }
88 fComponents = fFieldInfo->getCount(); 88 fComponents = fFieldInfo->getCount();
89 if (fFieldInfo->fType == SkType_Array) { 89 if (fFieldInfo->fType == SkType_Array) {
90 SkTypedArray* array = (SkTypedArray*) fFieldInfo->memberData(fTarget); 90 SkTypedArray* array = (SkTypedArray*) fFieldInfo->memberData(fTarget);
91 int count = array->count(); 91 int count = array->count();
92 if (count > 0) 92 if (count > 0)
93 fComponents = count; 93 fComponents = count;
94 } 94 }
95 if (outType == SkType_ARGB) { 95 if (outType == SkType_ARGB) {
96 fComponents <<= 2; // four color components 96 fComponents <<= 2; // four color components
97 outType = SkType_Float; 97 outType = SkType_Float;
98 } 98 }
99 fValues.setType(outType); 99 fValues.setType(outType);
100 if (formula.size() > 0){ 100 if (formula.size() > 0){
101 fComponents = 1; 101 fComponents = 1;
102 from.set("0"); 102 from.set("0");
103 to.set("dur"); 103 to.set("dur");
104 outType = SkType_MSec; 104 outType = SkType_MSec;
105 } 105 }
106 int max = fComponents * 2; 106 int max = fComponents * 2;
107 fValues.setCount(max); 107 fValues.setCount(max);
108 memset(fValues.begin(), 0, max * sizeof(fValues.begin()[0])); 108 memset(fValues.begin(), 0, max * sizeof(fValues.begin()[0]));
109 fFieldInfo->setValue(maker, &fValues, fFieldOffset, max, this, outType, from ); 109 fFieldInfo->setValue(maker, &fValues, fFieldOffset, max, this, outType, from );
110 fFieldInfo->setValue(maker, &fValues, fComponents + fFieldOffset, max, this, outType, to); 110 fFieldInfo->setValue(maker, &fValues, fComponents + fFieldOffset, max, this, outType, to);
111 } 111 }
OLDNEW
« no previous file with comments | « src/animator/SkAnimateBase.cpp ('k') | src/animator/SkAnimateMaker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698