From b1c77e47539167652bd124666b0663d1f9cf5ebb Mon Sep 17 00:00:00 2001 From: Mike Klein Date: Thu, 6 Sep 2018 15:23:29 -0400 Subject: [PATCH] clean up legacy flags Never needed to use them. Change-Id: I871e262386365c4fbb4de519277fa84d313387c9 Reviewed-on: https://skia-review.googlesource.com/152460 Reviewed-by: Brian Osman Commit-Queue: Mike Klein --- src/opts/SkRasterPipeline_opts.h | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/src/opts/SkRasterPipeline_opts.h b/src/opts/SkRasterPipeline_opts.h index 66b9549ce8..98c2c356bb 100644 --- a/src/opts/SkRasterPipeline_opts.h +++ b/src/opts/SkRasterPipeline_opts.h @@ -1446,26 +1446,15 @@ STAGE(byte_tables, const void* ctx) { // TODO: rename Tables SkJumper_ByteTable a = from_byte(gather(tables->a, to_unorm(a, 255))); } -#if defined(SK_LEGACY_EXTENDED_TRANSFER_FUNCTIONS) - SI F strip_sign(F x, U32* sign) { - (void)sign; - return x; - } - SI F apply_sign(F x, U32 sign) { - (void)sign; - return x; - } -#else - SI F strip_sign(F x, U32* sign) { - U32 bits = bit_cast(x); - *sign = bits & 0x80000000; - return bit_cast(bits ^ *sign); - } +SI F strip_sign(F x, U32* sign) { + U32 bits = bit_cast(x); + *sign = bits & 0x80000000; + return bit_cast(bits ^ *sign); +} - SI F apply_sign(F x, U32 sign) { - return bit_cast(sign | bit_cast(x)); - } -#endif +SI F apply_sign(F x, U32 sign) { + return bit_cast(sign | bit_cast(x)); +} STAGE(parametric, const SkJumper_ParametricTransferFunction* ctx) { auto fn = [&](F v) { @@ -1474,12 +1463,7 @@ STAGE(parametric, const SkJumper_ParametricTransferFunction* ctx) { F r = if_then_else(v <= ctx->D, mad(ctx->C, v, ctx->F) , approx_powf(mad(ctx->A, v, ctx->B), ctx->G) + ctx->E); -#if defined(SK_LEGACY_PARAMETRIC_CLAMP) - // Clamp to [0,1], with argument order mattering to handle NaN. - return apply_sign(min(max(r, 0), 1.0f), sign); -#else return apply_sign(r, sign); -#endif }; r = fn(r); g = fn(g);