Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(323)

Unified Diff: src/gpu/effects/GrEdgeEffect.cpp

Issue 12668019: Make GrGLShaderBuilder responsible for enabling GLSL extensions (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: sync to TOT Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/gl/GrGLProgram.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
};
« no previous file with comments | « no previous file | src/gpu/gl/GrGLProgram.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698