| 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 "SkScript.h" | 10 #include "SkScript.h" |
| (...skipping 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1380 operand2.fS32 = operand1.fS32 / operand2.fS32; | 1380 operand2.fS32 = operand1.fS32 / operand2.fS32; |
| 1381 if (original * operand2.fS32 == operand1.fS32) | 1381 if (original * operand2.fS32 == operand1.fS32) |
| 1382 break; // integer divide was good enough | 1382 break; // integer divide was good enough |
| 1383 operand2.fS32 = original; | 1383 operand2.fS32 = original; |
| 1384 type2 = kScalar; | 1384 type2 = kScalar; |
| 1385 } | 1385 } |
| 1386 case kDivideScalar: | 1386 case kDivideScalar: |
| 1387 if (operand2.fScalar == 0) | 1387 if (operand2.fScalar == 0) |
| 1388 operand2.fScalar = operand1.fScalar == 0 ? SK_ScalarNaN : operan
d1.fScalar > 0 ? SK_ScalarMax : -SK_ScalarMax; | 1388 operand2.fScalar = operand1.fScalar == 0 ? SK_ScalarNaN : operan
d1.fScalar > 0 ? SK_ScalarMax : -SK_ScalarMax; |
| 1389 else | 1389 else |
| 1390 operand2.fScalar = operand1.fScalar / operand2.fScalar; | 1390 operand2.fScalar = SkScalarDiv(operand1.fScalar, operand2.fScala
r); |
| 1391 break; | 1391 break; |
| 1392 case kEqualInt: | 1392 case kEqualInt: |
| 1393 operand2.fS32 = operand1.fS32 == operand2.fS32; | 1393 operand2.fS32 = operand1.fS32 == operand2.fS32; |
| 1394 break; | 1394 break; |
| 1395 case kEqualScalar: | 1395 case kEqualScalar: |
| 1396 operand2.fS32 = operand1.fScalar == operand2.fScalar; | 1396 operand2.fS32 = operand1.fScalar == operand2.fScalar; |
| 1397 type2 = kInt; | 1397 type2 = kInt; |
| 1398 break; | 1398 break; |
| 1399 case kEqualString: | 1399 case kEqualString: |
| 1400 operand2.fS32 = *operand1.fString == *operand2.fString; | 1400 operand2.fS32 = *operand1.fString == *operand2.fString; |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1881 break; | 1881 break; |
| 1882 case SkType_String: | 1882 case SkType_String: |
| 1883 SkASSERT(strcmp(value.fOperand.fString->c_str(), scriptTests[ind
ex].fStringAnswer) == 0); | 1883 SkASSERT(strcmp(value.fOperand.fString->c_str(), scriptTests[ind
ex].fStringAnswer) == 0); |
| 1884 break; | 1884 break; |
| 1885 default: | 1885 default: |
| 1886 SkASSERT(0); | 1886 SkASSERT(0); |
| 1887 } | 1887 } |
| 1888 } | 1888 } |
| 1889 } | 1889 } |
| 1890 #endif | 1890 #endif |
| OLD | NEW |