diff options
author | Ethan Nicholas <ethannicholas@google.com> | 2016-11-22 09:31:35 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-11-22 15:04:03 +0000 |
commit | 1fc83b131afa7c29e971dd3ccc7906006bde6c09 (patch) | |
tree | 513d839ca00f54665205935bef4b6a1667c06b38 /src/gpu/effects | |
parent | 3605ace7ddaf0b576bf6df1c7a550ab4f44d22a8 (diff) |
removed appendPrecisionModifier
skslc always provides support for precision modifiers (ignoring them if
unsupported on the target platform), so the Skia appendPrecisionModifier
function was redundant.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5117
Change-Id: I4bcbd47ef8d1f4f1b055086d4c9050254584b48c
Reviewed-on: https://skia-review.googlesource.com/5117
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/gpu/effects')
-rw-r--r-- | src/gpu/effects/GrDistanceFieldGeoProc.cpp | 17 | ||||
-rw-r--r-- | src/gpu/effects/GrTextureDomain.cpp | 6 |
2 files changed, 8 insertions, 15 deletions
diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.cpp b/src/gpu/effects/GrDistanceFieldGeoProc.cpp index d5476d495c..b77a8f438b 100644 --- a/src/gpu/effects/GrDistanceFieldGeoProc.cpp +++ b/src/gpu/effects/GrDistanceFieldGeoProc.cpp @@ -96,8 +96,7 @@ public: dfTexEffect.inTextureCoords()->fName); // Use highp to work around aliasing issues - fragBuilder->appendPrecisionModifier(kHigh_GrSLPrecision); - fragBuilder->codeAppendf("vec2 uv = %s;\n", uv.fsIn()); + fragBuilder->codeAppendf("highp vec2 uv = %s;\n", uv.fsIn()); fragBuilder->codeAppend("\tfloat texColor = "); fragBuilder->appendTextureLookup(args.fTexSamplers[0], @@ -350,8 +349,7 @@ public: "TextureSize", &textureSizeUniName); // Use highp to work around aliasing issues - fragBuilder->appendPrecisionModifier(kHigh_GrSLPrecision); - fragBuilder->codeAppendf("vec2 uv = %s;", v.fsIn()); + fragBuilder->codeAppendf("highp vec2 uv = %s;", v.fsIn()); fragBuilder->codeAppend("float texColor = "); fragBuilder->appendTextureLookup(args.fTexSamplers[0], @@ -361,8 +359,7 @@ public: fragBuilder->codeAppend("float distance = " SK_DistanceFieldMultiplier "*(texColor - " SK_DistanceFieldThreshold ");"); - fragBuilder->appendPrecisionModifier(kHigh_GrSLPrecision); - fragBuilder->codeAppendf("vec2 st = uv*%s;", textureSizeUniName); + fragBuilder->codeAppendf("highp vec2 st = uv*%s;", textureSizeUniName); fragBuilder->codeAppend("float afwidth;"); bool isUniformScale = (dfTexEffect.getFlags() & kUniformScale_DistanceFieldEffectMask) == kUniformScale_DistanceFieldEffectMask; @@ -608,15 +605,13 @@ public: // create LCD offset adjusted by inverse of transform // Use highp to work around aliasing issues - fragBuilder->appendPrecisionModifier(kHigh_GrSLPrecision); - fragBuilder->codeAppendf("vec2 uv = %s;\n", uv.fsIn()); - fragBuilder->appendPrecisionModifier(kHigh_GrSLPrecision); + fragBuilder->codeAppendf("highp vec2 uv = %s;\n", uv.fsIn()); SkScalar lcdDelta = 1.0f / (3.0f * atlas->width()); if (dfTexEffect.getFlags() & kBGR_DistanceFieldEffectFlag) { - fragBuilder->codeAppendf("float delta = -%.*f;\n", SK_FLT_DECIMAL_DIG, lcdDelta); + fragBuilder->codeAppendf("highp float delta = -%.*f;\n", SK_FLT_DECIMAL_DIG, lcdDelta); } else { - fragBuilder->codeAppendf("float delta = %.*f;\n", SK_FLT_DECIMAL_DIG, lcdDelta); + fragBuilder->codeAppendf("highp float delta = %.*f;\n", SK_FLT_DECIMAL_DIG, lcdDelta); } if (isUniformScale) { #ifdef SK_VULKAN diff --git a/src/gpu/effects/GrTextureDomain.cpp b/src/gpu/effects/GrTextureDomain.cpp index 6ee5758081..f22d09675b 100644 --- a/src/gpu/effects/GrTextureDomain.cpp +++ b/src/gpu/effects/GrTextureDomain.cpp @@ -103,10 +103,8 @@ void GrTextureDomain::GLDomain::sampleTexture(GrGLSLShaderBuilder* builder, inCoords.c_str()); builder->codeAppend(";"); - builder->appendPrecisionModifier(kHigh_GrSLPrecision); - builder->codeAppendf("float x = (%s).x;", inCoords.c_str()); - builder->appendPrecisionModifier(kHigh_GrSLPrecision); - builder->codeAppendf("float y = (%s).y;", inCoords.c_str()); + builder->codeAppendf("highp float x = (%s).x;", inCoords.c_str()); + builder->codeAppendf("highp float y = (%s).y;", inCoords.c_str()); builder->codeAppendf("x = abs(2.0*(x - %s.x)/(%s.z - %s.x) - 1.0);", domain, domain, domain); |