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

Unified Diff: samplecode/SampleApp.cpp

Issue 1135693003: Revert of 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkScalar.h ('k') | samplecode/SampleStringArt.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleApp.cpp
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 82d42fdfc45d94ed7d80ec52729ef578f41ad98a..04b1cb02589ceca9c802f20021707ceb731e06cc 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -1320,18 +1320,18 @@
static const SkScalar gAnimPeriod = 10 * SK_Scalar1;
static const SkScalar gAnimMag = SK_Scalar1 / 1000;
SkScalar t = SkScalarMod(secs, gAnimPeriod);
- if (SkScalarFloorToInt(SkScalarDiv(secs, gAnimPeriod)) & 0x1) {
+ if (SkScalarFloorToInt(secs / gAnimPeriod) & 0x1) {
t = gAnimPeriod - t;
}
t = 2 * t - gAnimPeriod;
- t = SkScalarMul(SkScalarDiv(t, gAnimPeriod), gAnimMag);
+ t *= gAnimMag / gAnimPeriod;
SkMatrix m;
m.reset();
#if 1
m.setPerspY(t);
#else
m.setPerspY(SK_Scalar1 / 1000);
- m.setSkewX(SkScalarDiv(8, 25));
+ m.setSkewX(8.0f / 25);
m.dump();
#endif
canvas->concat(m);
« no previous file with comments | « include/core/SkScalar.h ('k') | samplecode/SampleStringArt.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698