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

Unified Diff: include/core/SkScalar.h

Issue 1090003002: Add SkTPin. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Use &. Created 5 years, 8 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 | « no previous file | include/core/SkTypes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkScalar.h
diff --git a/include/core/SkScalar.h b/include/core/SkScalar.h
index fae23eb23a6c9a9b7862c215a41fb9f5ec4841d7..443454a2efc4805d6d3a738175e29abc210d5f61 100644
--- a/include/core/SkScalar.h
+++ b/include/core/SkScalar.h
@@ -175,9 +175,7 @@ static inline SkScalar SkScalarClampMax(SkScalar x, SkScalar max) {
}
static inline SkScalar SkScalarPin(SkScalar x, SkScalar min, SkScalar max) {
- x = SkTMin(x, max);
- x = SkTMax(x, min);
- return x;
+ return SkTPin(x, min, max);
}
SkScalar SkScalarSinCos(SkScalar radians, SkScalar* cosValue);
« no previous file with comments | « no previous file | include/core/SkTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698