| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 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 #include "SkScriptRuntime.h" | 8 #include "SkScriptRuntime.h" |
| 9 #include "SkScript2.h" | 9 #include "SkScript2.h" |
| 10 #include "SkMath.h" | 10 #include "SkMath.h" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 if (SkParse::FindS32(operand[0].fString->c_str(), &operand[0].fS32)
== NULL) | 203 if (SkParse::FindS32(operand[0].fString->c_str(), &operand[0].fS32)
== NULL) |
| 204 return false; | 204 return false; |
| 205 break; | 205 break; |
| 206 case SkScriptEngine2::kStringToScalar: | 206 case SkScriptEngine2::kStringToScalar: |
| 207 case SkScriptEngine2::kStringToScalar2: | 207 case SkScriptEngine2::kStringToScalar2: |
| 208 if (SkParse::FindScalar(operand[0].fString->c_str(), | 208 if (SkParse::FindScalar(operand[0].fString->c_str(), |
| 209 &operand[op - SkScriptEngine2::kStringToScalar].fScalar) ==
NULL) | 209 &operand[op - SkScriptEngine2::kStringToScalar].fScalar) ==
NULL) |
| 210 return false; | 210 return false; |
| 211 break; | 211 break; |
| 212 case SkScriptEngine2::kScalarToInt: | 212 case SkScriptEngine2::kScalarToInt: |
| 213 operand[0].fS32 = SkScalarFloor(operand[0].fScalar); | 213 operand[0].fS32 = SkScalarFloorToInt(operand[0].fScalar); |
| 214 break; | 214 break; |
| 215 // arithmetic ops | 215 // arithmetic ops |
| 216 case SkScriptEngine2::kAddInt: | 216 case SkScriptEngine2::kAddInt: |
| 217 operand[0].fS32 += operand[1].fS32; | 217 operand[0].fS32 += operand[1].fS32; |
| 218 break; | 218 break; |
| 219 case SkScriptEngine2::kAddScalar: | 219 case SkScriptEngine2::kAddScalar: |
| 220 operand[0].fScalar += operand[1].fScalar; | 220 operand[0].fScalar += operand[1].fScalar; |
| 221 break; | 221 break; |
| 222 case SkScriptEngine2::kAddString: | 222 case SkScriptEngine2::kAddString: |
| 223 // if (fTrackString.find(operand[1].fString) < 0) { | 223 // if (fTrackString.find(operand[1].fString) < 0) { |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 int index = fTrackArray.find(array); | 342 int index = fTrackArray.find(array); |
| 343 SkASSERT(index >= 0); | 343 SkASSERT(index >= 0); |
| 344 fTrackArray.begin()[index] = NULL; | 344 fTrackArray.begin()[index] = NULL; |
| 345 } | 345 } |
| 346 | 346 |
| 347 void SkScriptRuntime::untrack(SkString* string) { | 347 void SkScriptRuntime::untrack(SkString* string) { |
| 348 int index = fTrackString.find(string); | 348 int index = fTrackString.find(string); |
| 349 SkASSERT(index >= 0); | 349 SkASSERT(index >= 0); |
| 350 fTrackString.begin()[index] = NULL; | 350 fTrackString.begin()[index] = NULL; |
| 351 } | 351 } |
| OLD | NEW |