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

Unified Diff: tests/PMFloatTest.cpp

Issue 1032243002: SkPMFloat::trunc() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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
« src/core/SkPMFloat.h ('K') | « src/opts/SkPMFloat_none.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PMFloatTest.cpp
diff --git a/tests/PMFloatTest.cpp b/tests/PMFloatTest.cpp
index 0f0d853c2b840d8abacd74e2a6da6edc1b4adf4b..885708766a7498b4a632bef847d02342b3ac54b6 100644
--- a/tests/PMFloatTest.cpp
+++ b/tests/PMFloatTest.cpp
@@ -22,6 +22,9 @@ DEF_TEST(SkPMFloat, r) {
pmf = SkPMFloat(254.5f, 203.5f, 153.1f, 50.8f);
REPORTER_ASSERT(r, c == pmf.get());
+ pmf = SkPMFloat(255.9f, 204.01f, 153.0f, 51.5f);
+ REPORTER_ASSERT(r, c == pmf.trunc());
+
// Test clamping.
SkPMFloat clamped(SkPMFloat(510.0f, 153.0f, 1.0f, -0.2f).clamped());
REPORTER_ASSERT(r, SkScalarNearlyEqual(255.0f, clamped.a()));
« src/core/SkPMFloat.h ('K') | « src/opts/SkPMFloat_none.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698