OLD | NEW |
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 "SkAnimateSet.h" | 10 #include "SkAnimateSet.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 if (dur != 1) { | 41 if (dur != 1) { |
42 SkDebugf("dur=\"%g\" ", dur * 0.001); | 42 SkDebugf("dur=\"%g\" ", dur * 0.001); |
43 } | 43 } |
44 //don't want double />\n's | 44 //don't want double />\n's |
45 SkDebugf("/>\n"); | 45 SkDebugf("/>\n"); |
46 | 46 |
47 } | 47 } |
48 #endif | 48 #endif |
49 | 49 |
50 void SkSet::refresh(SkAnimateMaker& maker) { | 50 void SkSet::refresh(SkAnimateMaker& maker) { |
51 fFieldInfo->setValue(maker, &fValues, 0, fFieldInfo->fCount, NULL, | 51 fFieldInfo->setValue(maker, &fValues, 0, fFieldInfo->fCount, nullptr, |
52 fFieldInfo->getType(), to); | 52 fFieldInfo->getType(), to); |
53 } | 53 } |
54 | 54 |
55 void SkSet::onEndElement(SkAnimateMaker& maker) { | 55 void SkSet::onEndElement(SkAnimateMaker& maker) { |
56 if (resolveCommon(maker) == false) | 56 if (resolveCommon(maker) == false) |
57 return; | 57 return; |
58 if (fFieldInfo == NULL) { | 58 if (fFieldInfo == nullptr) { |
59 maker.setErrorCode(SkDisplayXMLParserError::kFieldNotInTarget); | 59 maker.setErrorCode(SkDisplayXMLParserError::kFieldNotInTarget); |
60 return; | 60 return; |
61 } | 61 } |
62 fReset = dur != 1; | 62 fReset = dur != 1; |
63 SkDisplayTypes outType = fFieldInfo->getType(); | 63 SkDisplayTypes outType = fFieldInfo->getType(); |
64 int comps = outType == SkType_String || outType == SkType_DynamicString ? 1
: | 64 int comps = outType == SkType_String || outType == SkType_DynamicString ? 1
: |
65 (int)fFieldInfo->getSize((const SkDisplayable*) fTarget) / sizeof(int); | 65 (int)fFieldInfo->getSize((const SkDisplayable*) fTarget) / sizeof(int); |
66 if (fValues.getType() == SkType_Unknown) { | 66 if (fValues.getType() == SkType_Unknown) { |
67 fValues.setType(outType); | 67 fValues.setType(outType); |
68 fValues.setCount(comps); | 68 fValues.setCount(comps); |
69 if (outType == SkType_String || outType == SkType_DynamicString) | 69 if (outType == SkType_String || outType == SkType_DynamicString) |
70 fValues[0].fString = new SkString; | 70 fValues[0].fString = new SkString; |
71 else | 71 else |
72 memset(fValues.begin(), 0, fValues.count() * sizeof(fValues.begin()[
0])); | 72 memset(fValues.begin(), 0, fValues.count() * sizeof(fValues.begin()[
0])); |
73 } else { | 73 } else { |
74 SkASSERT(fValues.getType() == outType); | 74 SkASSERT(fValues.getType() == outType); |
75 if (fFieldInfo->fType == SkType_Array) | 75 if (fFieldInfo->fType == SkType_Array) |
76 comps = fValues.count(); | 76 comps = fValues.count(); |
77 else { | 77 else { |
78 SkASSERT(fValues.count() == comps); | 78 SkASSERT(fValues.count() == comps); |
79 } | 79 } |
80 } | 80 } |
81 if (formula.size() > 0) { | 81 if (formula.size() > 0) { |
82 comps = 1; | 82 comps = 1; |
83 outType = SkType_MSec; | 83 outType = SkType_MSec; |
84 } | 84 } |
85 fFieldInfo->setValue(maker, &fValues, fFieldOffset, comps, this, outType, fo
rmula.size() > 0 ? formula : to); | 85 fFieldInfo->setValue(maker, &fValues, fFieldOffset, comps, this, outType, fo
rmula.size() > 0 ? formula : to); |
86 fComponents = fValues.count(); | 86 fComponents = fValues.count(); |
87 } | 87 } |
OLD | NEW |