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

Unified Diff: tests/PMFloatTest.cpp

Issue 1055123002: New names for SkPMFloat methods. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: one more 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 309cd60f4ac8537dfec35624b3004312a4821251..1c53081571232c3e6f0413964d9cd5a2964a9d14 100644
--- a/tests/PMFloatTest.cpp
+++ b/tests/PMFloatTest.cpp
@@ -16,17 +16,17 @@ DEF_TEST(SkPMFloat, r) {
REPORTER_ASSERT(r, SkScalarNearlyEqual(204.0f, pmf.r()));
REPORTER_ASSERT(r, SkScalarNearlyEqual(153.0f, pmf.g()));
REPORTER_ASSERT(r, SkScalarNearlyEqual( 51.0f, pmf.b()));
- REPORTER_ASSERT(r, c == pmf.get());
+ REPORTER_ASSERT(r, c == pmf.round());
// Test rounding.
pmf = SkPMFloat(254.5f, 203.5f, 153.1f, 50.8f);
- REPORTER_ASSERT(r, c == pmf.get());
+ REPORTER_ASSERT(r, c == pmf.round());
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());
+ SkPMFloat clamped(SkPMFloat(510.0f, 153.0f, 1.0f, -0.2f).roundClamp());
REPORTER_ASSERT(r, SkScalarNearlyEqual(255.0f, clamped.a()));
REPORTER_ASSERT(r, SkScalarNearlyEqual(153.0f, clamped.r()));
REPORTER_ASSERT(r, SkScalarNearlyEqual( 1.0f, clamped.g()));
@@ -46,12 +46,12 @@ DEF_TEST(SkPMFloat, r) {
SkPMFloat::From4PMColors(colors, floats+0, floats+1, floats+2, floats+3);
SkPMColor back[4];
- SkPMFloat::To4PMColors(floats[0], floats[1], floats[2], floats[3], back);
+ SkPMFloat::RoundTo4PMColors(floats[0], floats[1], floats[2], floats[3], back);
for (int i = 0; i < 4; i++) {
REPORTER_ASSERT(r, back[i] == colors[i]);
}
- SkPMFloat::ClampTo4PMColors(floats[0], floats[1], floats[2], floats[3], back);
+ SkPMFloat::RoundClampTo4PMColors(floats[0], floats[1], floats[2], floats[3], back);
for (int i = 0; i < 4; i++) {
REPORTER_ASSERT(r, back[i] == colors[i]);
}
« 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