aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/shaders
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2017-06-19 15:40:45 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-19 20:06:03 +0000
commit15200bd8b35e8948e0ab9d07ec2a594a55feabcd (patch)
tree55b445f8bf4c480087f0151d80070a6a5a92d59a /src/shaders
parentae7bb04f4c63cee7ae2a3a0e3d81362ae041226a (diff)
Remove SK_SUPPORT_LEGACY_GRADIENT_ALPHATRUNC dead code
The guard is no longer used in Chrome. (https://chromium-review.googlesource.com/c/539715) Change-Id: Ib78527a11002a2992af71adce4ed4b8261ed8ead Reviewed-on: https://skia-review.googlesource.com/20281 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@google.com>
Diffstat (limited to 'src/shaders')
-rw-r--r--src/shaders/gradients/SkLinearGradient.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/shaders/gradients/SkLinearGradient.cpp b/src/shaders/gradients/SkLinearGradient.cpp
index e8a68f6f9e..d6875ce691 100644
--- a/src/shaders/gradients/SkLinearGradient.cpp
+++ b/src/shaders/gradients/SkLinearGradient.cpp
@@ -560,9 +560,6 @@ template <bool apply_alpha> SkPMColor trunc_from_255(const Sk4f& x, const Sk4f&
SkPMColor c;
Sk4f c4f255 = x;
if (apply_alpha) {
-#ifdef SK_SUPPORT_LEGACY_GRADIENT_ALPHATRUNC
- static constexpr float alphaScale = 1;
-#else
// Due to use of multiplication by the 1/255 reciprocal instead of division by 255,
// non-integer alpha values very close to their ceiling can push the color values
// above the alpha value, which will become an invalid premultiplied color. So nudge
@@ -572,7 +569,7 @@ template <bool apply_alpha> SkPMColor trunc_from_255(const Sk4f& x, const Sk4f&
// scaled by the alpha value, we need to scale the epsilon by 255 to get a safe
// upper bound on the error.
static constexpr float alphaScale = 1 + 255*std::numeric_limits<float>::epsilon();
-#endif
+
const float scale = x[SkPM4f::A] * (1 / 255.f);
c4f255 *= Sk4f(scale, scale, scale, alphaScale);
}