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>
This commit is contained in:
Florin Malita 2016-12-07 14:57:04 -05:00 committed by Skia Commit-Bot
parent 18b4f981ae
commit aaa6d7718e

View File

@ -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;
}