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

Unified Diff: src/effects/gradients/SkClampRange.cpp

Issue 824063004: Remove SK_SUPPORT_LEGACY_GRADIENT_PRECISION (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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/effects/gradients/SkClampRange.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/SkClampRange.cpp
diff --git a/src/effects/gradients/SkClampRange.cpp b/src/effects/gradients/SkClampRange.cpp
index 6f46923704be418980efb022e24713a7e2ec2e6d..4f8611281a30607376eb63b227f2809120d2e553 100644
--- a/src/effects/gradients/SkClampRange.cpp
+++ b/src/effects/gradients/SkClampRange.cpp
@@ -29,12 +29,6 @@ static int chop(int64_t x0, SkGradFixed edge, int64_t x1, int64_t dx, int count)
return (int)n;
}
-#ifdef SK_SUPPORT_LEGACY_GRADIENT_PRECISION
-static bool overflows_gradfixed(int64_t x) {
- return x < -SK_FixedMax || x > SK_FixedMax;
-}
-#endif
-
void SkClampRange::initFor1(SkGradFixed fx) {
fCount0 = fCount1 = fCount2 = 0;
if (fx <= 0) {
@@ -88,44 +82,6 @@ void SkClampRange::init(SkGradFixed fx0, SkGradFixed dx0, int count, int v0, int
// now make ex be 1 past the last computed value
ex += dx;
-#ifdef SK_SUPPORT_LEGACY_GRADIENT_PRECISION
- // now check for over/under flow
- if (overflows_gradfixed(ex)) {
- int originalCount = count;
- int64_t ccount;
- bool swap = dx < 0;
- if (swap) {
- dx = -dx;
- fx = -fx;
- }
-
- int shift = 0;
- if (sizeof(SkGradFixed) == 8) {
- shift = 16;
- }
-
- ccount = ((SK_FixedMax << shift) - fx + dx - 1) / dx;
- if (swap) {
- dx = -dx;
- fx = -fx;
- }
- SkASSERT(ccount > 0 && ccount <= SK_FixedMax);
-
- count = (int)ccount;
- if (0 == count) {
- this->initFor1(fx0);
- if (dx > 0) {
- fCount2 += originalCount - 1;
- } else {
- fCount0 += originalCount - 1;
- }
- return;
- }
- extraCount = originalCount - count;
- ex = fx + dx * count;
- }
-#endif
-
bool doSwap = dx < 0;
if (doSwap) {
« no previous file with comments | « src/effects/gradients/SkClampRange.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698