diff options
author | Florin Malita <fmalita@chromium.org> | 2016-12-07 14:57:04 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-12-13 16:10:15 +0000 |
commit | aaa6d7718ed6dc5c463dd297591e975831bc0a1b (patch) | |
tree | e87ef54df970b10893c6963e35e6bb0cd3830aef | |
parent | 18b4f981aeda10ab403208538bc732f31b56a094 (diff) |
Delete SK_SUPPORT_LEGACY_GRADIENT_PREMUL-guarded code
The flag has been removed from Chromium.
R=reed@google.com,
TBR=
Change-Id: Ibccada2068d29b019660be46f5f5797331719a57
Reviewed-on: https://skia-review.googlesource.com/5648
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
-rw-r--r-- | src/effects/gradients/SkLinearGradient.cpp | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp index c40a8b4d9c..5994fd6d0c 100644 --- a/src/effects/gradients/SkLinearGradient.cpp +++ b/src/effects/gradients/SkLinearGradient.cpp @@ -532,39 +532,23 @@ find_backward(const SkLinearGradient::LinearGradientContext::Rec rec[], float ti template <bool apply_alpha> Sk4f pre_bias(const Sk4f& x, const Sk4f& bias) { -#ifdef SK_SUPPORT_LEGACY_GRADIENT_PREMUL - return x + bias; -#else return apply_alpha ? x : x + bias; -#endif } template <bool apply_alpha> Sk4f post_bias(const Sk4f& x, const Sk4f& bias) { -#ifdef SK_SUPPORT_LEGACY_GRADIENT_PREMUL - return x; -#else return apply_alpha ? x + bias : x; -#endif } template <bool apply_alpha> SkPMColor trunc_from_255(const Sk4f& x, const Sk4f& bias) { SkPMColor c; - -#ifdef SK_SUPPORT_LEGACY_GRADIENT_PREMUL - SkNx_cast<uint8_t>(x).store(&c); - if (apply_alpha) { - c = SkPreMultiplyARGB(SkGetPackedA32(c), SkGetPackedR32(c), - SkGetPackedG32(c), SkGetPackedB32(c)); - } -#else Sk4f c4f255 = x; if (apply_alpha) { const float scale = x[SkPM4f::A] * (1 / 255.f); c4f255 *= Sk4f(scale, scale, scale, 1); } SkNx_cast<uint8_t>(post_bias<apply_alpha>(c4f255, bias)).store(&c); -#endif + return c; } |