| 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 "SkDisplayMath.h" | 10 #include "SkDisplayMath.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 SK_MEMBER_FUNCTION(tan, Float) | 124 SK_MEMBER_FUNCTION(tan, Float) |
| 125 }; | 125 }; |
| 126 | 126 |
| 127 #endif | 127 #endif |
| 128 | 128 |
| 129 DEFINE_GET_MEMBER(SkDisplayMath); | 129 DEFINE_GET_MEMBER(SkDisplayMath); |
| 130 | 130 |
| 131 void SkDisplayMath::executeFunction(SkDisplayable* target, int index, | 131 void SkDisplayMath::executeFunction(SkDisplayable* target, int index, |
| 132 SkTDArray<SkScriptValue>& parameters, SkDisplayTypes type, | 132 SkTDArray<SkScriptValue>& parameters, SkDisplayTypes type, |
| 133 SkScriptValue* scriptValue) { | 133 SkScriptValue* scriptValue) { |
| 134 if (scriptValue == NULL) | 134 if (scriptValue == nullptr) |
| 135 return; | 135 return; |
| 136 SkASSERT(target == this); | 136 SkASSERT(target == this); |
| 137 SkScriptValue* array = parameters.begin(); | 137 SkScriptValue* array = parameters.begin(); |
| 138 SkScriptValue* end = parameters.end(); | 138 SkScriptValue* end = parameters.end(); |
| 139 SkScalar input = parameters[0].fOperand.fScalar; | 139 SkScalar input = parameters[0].fOperand.fScalar; |
| 140 SkScalar scalarResult; | 140 SkScalar scalarResult; |
| 141 switch (index) { | 141 switch (index) { |
| 142 case SK_FUNCTION(abs): | 142 case SK_FUNCTION(abs): |
| 143 scalarResult = SkScalarAbs(input); | 143 scalarResult = SkScalarAbs(input); |
| 144 break; | 144 break; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 | 220 |
| 221 bool SkDisplayMath::getProperty(int index, SkScriptValue* value) const { | 221 bool SkDisplayMath::getProperty(int index, SkScriptValue* value) const { |
| 222 if ((unsigned)index < SK_ARRAY_COUNT(gConstants)) { | 222 if ((unsigned)index < SK_ARRAY_COUNT(gConstants)) { |
| 223 value->fOperand.fScalar = gConstants[index]; | 223 value->fOperand.fScalar = gConstants[index]; |
| 224 value->fType = SkType_Float; | 224 value->fType = SkType_Float; |
| 225 return true; | 225 return true; |
| 226 } | 226 } |
| 227 SkASSERT(0); | 227 SkASSERT(0); |
| 228 return false; | 228 return false; |
| 229 } | 229 } |
| OLD | NEW |