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

Unified Diff: src/animator/SkDrawColor.cpp

Issue 1135053002: stop calling SkScalarDiv (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix xpsdevice 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 | « src/animator/SkDisplayable.cpp ('k') | src/animator/SkScript.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/animator/SkDrawColor.cpp
diff --git a/src/animator/SkDrawColor.cpp b/src/animator/SkDrawColor.cpp
index eb57d9dad49ed041e0c748d2db95718786357955..d86a2e93e7261875418395b9811fe06840a6ed64 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)
« no previous file with comments | « src/animator/SkDisplayable.cpp ('k') | src/animator/SkScript.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698