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

Unified Diff: tests/ClampRangeTest.cpp

Issue 811753003: Enable new gradients + suppress gms for now (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update ignore tests Created 6 years 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/effects/gradients/SkClampRange.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ClampRangeTest.cpp
diff --git a/tests/ClampRangeTest.cpp b/tests/ClampRangeTest.cpp
index bf7c95fa57effd7b10eea1be24c64a1f18a74aac..ccce8c5bf3bc0286793b422275dd29207e7d2909 100644
--- a/tests/ClampRangeTest.cpp
+++ b/tests/ClampRangeTest.cpp
@@ -21,9 +21,9 @@ static const int kV0 = -42, kV1 = -53, kRamp = -64;
static void check_value(int64_t bigfx, int expected) {
if (bigfx < 0) {
R_ASSERT(expected == kV0);
- } else if (bigfx > 0xFFFF) {
+ } else if (bigfx > kFracMax_SkGradFixed) {
R_ASSERT(expected == kV1);
- } else if (bigfx == 0xFFFF) {
+ } else if (bigfx == kFracMax_SkGradFixed) {
// Either one is fine (and we do see both).
R_ASSERT(expected == kV1 || expected == kRamp);
} else {
@@ -32,7 +32,7 @@ static void check_value(int64_t bigfx, int expected) {
}
static void slow_check(const SkClampRange& range,
- const SkFixed fx, SkFixed dx, int count) {
+ const SkGradFixed fx, SkGradFixed dx, int count) {
SkASSERT(range.fCount0 + range.fCount1 + range.fCount2 == count);
// If dx is large, fx will overflow if updated naively. So we use more bits.
@@ -56,9 +56,12 @@ static void slow_check(const SkClampRange& range,
static void test_range(SkFixed fx, SkFixed dx, int count) {
+ const SkGradFixed gfx = SkFixedToGradFixed(fx);
+ const SkGradFixed gdx = SkFixedToGradFixed(dx);
+
SkClampRange range;
- range.init(fx, dx, count, kV0, kV1);
- slow_check(range, fx, dx, count);
+ range.init(gfx, gdx, count, kV0, kV1);
+ slow_check(range, gfx, gdx, count);
}
#define ff(x) SkIntToFixed(x)
« no previous file with comments | « src/effects/gradients/SkClampRange.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698