Index: src/gpu/effects/GrEdgeEffect.cpp |
=================================================================== |
--- src/gpu/effects/GrEdgeEffect.cpp (revision 8458) |
+++ src/gpu/effects/GrEdgeEffect.cpp (working copy) |
@@ -38,7 +38,7 @@ |
builder->fsCodeAppendf("\t\tedgeAlpha = max(1.0 - edgeAlpha, 0.0);\n"); |
break; |
case GrEdgeEffect::kQuad_EdgeType: |
- GrAssert(builder->ctxInfo().caps()->shaderDerivativeSupport()); |
+ SkAssertResult(builder->enableFeature(GrGLShaderBuilder::kStandardDerivatives_GLSLFeature)); |
builder->addVarying(kVec4f_GrSLType, "QuadEdge", &vsName, &fsName); |
// keep the derivative instructions outside the conditional |
@@ -56,12 +56,9 @@ |
fsName); |
builder->fsCodeAppendf("\t\t\tedgeAlpha = " |
"clamp(0.5 - edgeAlpha / length(gF), 0.0, 1.0);\n\t\t}\n"); |
- if (kES2_GrGLBinding == builder->ctxInfo().binding()) { |
- builder->fHeader.append("#extension GL_OES_standard_derivatives: enable\n"); |
- } |
break; |
case GrEdgeEffect::kHairQuad_EdgeType: |
- GrAssert(builder->ctxInfo().caps()->shaderDerivativeSupport()); |
+ SkAssertResult(builder->enableFeature(GrGLShaderBuilder::kStandardDerivatives_GLSLFeature)); |
builder->addVarying(kVec4f_GrSLType, "HairQuadEdge", &vsName, &fsName); |
builder->fsCodeAppendf("\t\tvec2 duvdx = dFdx(%s.xy);\n", fsName); |
@@ -73,9 +70,6 @@ |
fsName); |
builder->fsCodeAppend("\t\tedgeAlpha = sqrt(edgeAlpha*edgeAlpha / dot(gF, gF));\n"); |
builder->fsCodeAppend("\t\tedgeAlpha = max(1.0 - edgeAlpha, 0.0);\n"); |
- if (kES2_GrGLBinding == builder->ctxInfo().binding()) { |
- builder->fHeader.append("#extension GL_OES_standard_derivatives: enable\n"); |
- } |
break; |
}; |