Use nextafter rather than std::nextafter, it's more widely available

Bug: skia:
Change-Id: Idffe99cde348af83ae4290614c44767fffe36609
Reviewed-on: https://skia-review.googlesource.com/19120
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This commit is contained in:
Mostyn Bramley-Moore 2017-06-08 22:32:47 +02:00 committed by Skia Commit-Bot
parent eb4f186779
commit c0110ff1c2

View File

@ -1906,14 +1906,8 @@ void GrGLGpu::clear(const GrFixedClip& clip, GrColor color, GrRenderTarget* targ
if (this->glCaps().clearToBoundaryValuesIsBroken() &&
(1 == r || 0 == r) && (1 == g || 0 == g) && (1 == b || 0 == b) && (1 == a || 0 == a)) {
#ifdef SK_BUILD_FOR_ANDROID
// Android doesn't have std::nextafter but has nextafter.
static const GrGLfloat safeAlpha1 = nextafter(1.f, 2.f);
static const GrGLfloat safeAlpha0 = nextafter(0.f, -1.f);
#else
static const GrGLfloat safeAlpha1 = std::nextafter(1.f, 2.f);
static const GrGLfloat safeAlpha0 = std::nextafter(0.f, -1.f);
#endif
a = (1 == a) ? safeAlpha1 : safeAlpha0;
}
GL_CALL(ClearColor(r, g, b, a));