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

Unified Diff: tests/PMFloatTest.cpp

Issue 1032243002: SkPMFloat::trunc() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove isValid assert in _none trunc() 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
« no previous file with comments | « 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..309cd60f4ac8537dfec35624b3004312a4821251 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, -0.9f);
+ REPORTER_ASSERT(r, SkPreMultiplyColor(0xFFCC9900) == pmf.trunc());
+
// Test clamping.
SkPMFloat clamped(SkPMFloat(510.0f, 153.0f, 1.0f, -0.2f).clamped());
REPORTER_ASSERT(r, SkScalarNearlyEqual(255.0f, clamped.a()));
« no previous file with comments | « src/opts/SkPMFloat_none.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698