aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/animator
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-05-12 09:47:22 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-05-12 09:47:22 -0700
commit67d71c898249a7af3523b16c6a69895a63bfae0a (patch)
tree718e9b0eb395ffd67ec0e1bcf3074f0289f89600 /src/animator
parent7da2e55ccbad4868a455c1c9f23e5f63bd99e916 (diff)
stop calling SkScalarDiv
BUG=skia: TBR= Review URL: https://codereview.chromium.org/1135053002
Diffstat (limited to 'src/animator')
-rw-r--r--src/animator/SkAnimateBase.cpp2
-rw-r--r--src/animator/SkAnimateField.cpp2
-rw-r--r--src/animator/SkAnimateSet.cpp2
-rw-r--r--src/animator/SkAnimatorScript.cpp2
-rw-r--r--src/animator/SkAnimatorScript2.cpp2
-rw-r--r--src/animator/SkDisplayPost.cpp2
-rw-r--r--src/animator/SkDisplayable.cpp2
-rw-r--r--src/animator/SkDrawColor.cpp4
-rw-r--r--src/animator/SkScript.cpp2
-rw-r--r--src/animator/SkScriptRuntime.cpp2
10 files changed, 11 insertions, 11 deletions
diff --git a/src/animator/SkAnimateBase.cpp b/src/animator/SkAnimateBase.cpp
index 3515ed5cb3..82f777ef39 100644
--- a/src/animator/SkAnimateBase.cpp
+++ b/src/animator/SkAnimateBase.cpp
@@ -91,7 +91,7 @@ void SkAnimateBase::dump(SkAnimateMaker* maker) {
SkDebugf("to=\"%s\" ", to.c_str());
}
if (begin != 0) {
- SkDebugf("begin=\"%g\" ", SkScalarToFloat(SkScalarDiv(begin,1000)));
+ SkDebugf("begin=\"%g\" ", begin * 0.001);
}
}
#endif
diff --git a/src/animator/SkAnimateField.cpp b/src/animator/SkAnimateField.cpp
index 7aebb78288..c6676e5be7 100644
--- a/src/animator/SkAnimateField.cpp
+++ b/src/animator/SkAnimateField.cpp
@@ -41,7 +41,7 @@ void SkAnimate::dump(SkAnimateMaker* maker) {
SkDebugf("mirror=\"true\" ");
if (fReset)
SkDebugf("reset=\"true\" ");
- SkDebugf("dur=\"%g\" ", SkScalarToFloat(SkScalarDiv(dur,1000)));
+ SkDebugf("dur=\"%g\" ", dur * 0.001);
if (repeat != SK_Scalar1)
SkDebugf("repeat=\"%g\" ", SkScalarToFloat(repeat));
//if (fHasValues)
diff --git a/src/animator/SkAnimateSet.cpp b/src/animator/SkAnimateSet.cpp
index d146118e89..ec06a9e666 100644
--- a/src/animator/SkAnimateSet.cpp
+++ b/src/animator/SkAnimateSet.cpp
@@ -39,7 +39,7 @@ SkSet::SkSet() {
void SkSet::dump(SkAnimateMaker* maker) {
INHERITED::dump(maker);
if (dur != 1) {
- SkDebugf("dur=\"%g\" ", SkScalarToFloat(SkScalarDiv(dur,1000)));
+ SkDebugf("dur=\"%g\" ", dur * 0.001);
}
//don't want double />\n's
SkDebugf("/>\n");
diff --git a/src/animator/SkAnimatorScript.cpp b/src/animator/SkAnimatorScript.cpp
index df2e5637a2..f4ea51890f 100644
--- a/src/animator/SkAnimatorScript.cpp
+++ b/src/animator/SkAnimatorScript.cpp
@@ -235,7 +235,7 @@ bool SkAnimatorScript::EvalMemberCommon(SkScriptEngine* engine, const SkMemberIn
if (info->fType != SkType_MemberProperty && info->fType != SkType_MemberFunction)
value->fOperand.fS32 = *(int32_t*) info->memberData(displayable); // OK for SkScalar too
if (type == SkType_MSec) {
- value->fOperand.fScalar = SkScalarDiv((SkScalar) value->fOperand.fS32, 1000); // dividing two ints is the same as dividing two scalars
+ value->fOperand.fScalar = value->fOperand.fS32 * 0.001f;
type = SkType_Float;
}
break;
diff --git a/src/animator/SkAnimatorScript2.cpp b/src/animator/SkAnimatorScript2.cpp
index 80ae0c6aa8..28912fb6d0 100644
--- a/src/animator/SkAnimatorScript2.cpp
+++ b/src/animator/SkAnimatorScript2.cpp
@@ -412,7 +412,7 @@ bool SkAnimatorScript2::evalMemberCommon(const SkMemberInfo* info,
if (info->fType != SkType_MemberProperty && info->fType != SkType_MemberFunction)
value->fS32 = *(int32_t*) info->memberData(displayable); // OK for SkScalar too
if (type == SkType_MSec) {
- value->fScalar = SkScalarDiv((SkScalar) value->fS32, 1000); // dividing two ints is the same as dividing two scalars
+ value->fScalar = value->fS32 * 0.001f;
type = SkType_Float;
}
break;
diff --git a/src/animator/SkDisplayPost.cpp b/src/animator/SkDisplayPost.cpp
index cc45b216ba..0fd4a06753 100644
--- a/src/animator/SkDisplayPost.cpp
+++ b/src/animator/SkDisplayPost.cpp
@@ -76,7 +76,7 @@ void SkPost::dump(SkAnimateMaker* maker) {
delete eventType;
if (delay > 0) {
- SkDebugf("delay=\"%g\" ", SkScalarToFloat(SkScalarDiv(delay, 1000)));
+ SkDebugf("delay=\"%g\" ", delay * 0.001);
}
// if (initialized == false)
// SkDebugf("(uninitialized) ");
diff --git a/src/animator/SkDisplayable.cpp b/src/animator/SkDisplayable.cpp
index aff3aaefc6..52532fedcd 100644
--- a/src/animator/SkDisplayable.cpp
+++ b/src/animator/SkDisplayable.cpp
@@ -377,7 +377,7 @@ void SkDisplayable::dumpValues(const SkMemberInfo* info, SkDisplayTypes type, Sk
break;
case SkType_MSec:
if (op.fS32 != blankOp.fS32) {
- SkDebugf(" %s=\"%g\" ", info->fName, SkScalarToFloat(SkScalarDiv(op.fS32, 1000)));
+ SkDebugf(" %s=\"%g\" ", info->fName, op.fS32 * 0.001);
}
default:
SkDebugf("");
diff --git a/src/animator/SkDrawColor.cpp b/src/animator/SkDrawColor.cpp
index eb57d9dad4..d86a2e93e7 100644
--- a/src/animator/SkDrawColor.cpp
+++ b/src/animator/SkDrawColor.cpp
@@ -30,14 +30,14 @@ static SkScalar RGB_to_HSV(SkColor color, HSV_Choice choice) {
if (choice == kGetValue)
return value/255;
SkScalar delta = value - min;
- SkScalar saturation = value == 0 ? 0 : SkScalarDiv(delta, value);
+ SkScalar saturation = value == 0 ? 0 : delta / value;
if (choice == kGetSaturation)
return saturation;
SkScalar hue;
if (saturation == 0)
hue = 0;
else {
- SkScalar part60 = SkScalarDiv(60 * SK_Scalar1, delta);
+ SkScalar part60 = 60 / delta;
if (red == value) {
hue = SkScalarMul(green - blue, part60);
if (hue < 0)
diff --git a/src/animator/SkScript.cpp b/src/animator/SkScript.cpp
index 1d04d1b276..c430695705 100644
--- a/src/animator/SkScript.cpp
+++ b/src/animator/SkScript.cpp
@@ -1387,7 +1387,7 @@ bool SkScriptEngine::processOp() {
if (operand2.fScalar == 0)
operand2.fScalar = operand1.fScalar == 0 ? SK_ScalarNaN : operand1.fScalar > 0 ? SK_ScalarMax : -SK_ScalarMax;
else
- operand2.fScalar = SkScalarDiv(operand1.fScalar, operand2.fScalar);
+ operand2.fScalar = operand1.fScalar / operand2.fScalar;
break;
case kEqualInt:
operand2.fS32 = operand1.fS32 == operand2.fS32;
diff --git a/src/animator/SkScriptRuntime.cpp b/src/animator/SkScriptRuntime.cpp
index 78d9d5c208..07bd4c9c2f 100644
--- a/src/animator/SkScriptRuntime.cpp
+++ b/src/animator/SkScriptRuntime.cpp
@@ -249,7 +249,7 @@ bool SkScriptRuntime::executeTokens(unsigned char* opCode) {
operand[0].fScalar = operand[0].fScalar == 0 ? SK_ScalarNaN :
operand[0].fScalar > 0 ? SK_ScalarMax : -SK_ScalarMax;
else
- operand[0].fScalar = SkScalarDiv(operand[0].fScalar, operand[1].fScalar);
+ operand[0].fScalar = operand[0].fScalar / operand[1].fScalar;
break;
case SkScriptEngine2::kEqualInt:
operand[0].fS32 = operand[0].fS32 == operand[1].fS32;