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

Side by Side Diff: src/animator/SkScript.cpp

Issue 1138263002: Revert of stop calling SkScalarDiv (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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/SkDrawColor.cpp ('k') | src/animator/SkScriptRuntime.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 "SkScript.h" 10 #include "SkScript.h"
(...skipping 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « src/animator/SkDrawColor.cpp ('k') | src/animator/SkScriptRuntime.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698