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

Unified Diff: src/effects/SkLightingImageFilter.cpp

Issue 1417123002: Move GrGLShaderVar to GrGLSL (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix gyp Created 5 years, 2 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 | « src/effects/SkBlurMaskFilter.cpp ('k') | src/effects/SkPerlinNoiseShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkLightingImageFilter.cpp
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index bac83e537dc9ce9c8292743234ea036d56e18ad8..1dca0fcab4e03681e2d11008d9c83b60079bb5c8 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -1658,14 +1658,14 @@ void GrGLLightingEffect::emitCode(EmitArgs& args) {
fLight->emitLightColorUniform(args.fBuilder);
SkString lightFunc;
this->emitLightFunc(args.fBuilder, &lightFunc);
- static const GrGLShaderVar gSobelArgs[] = {
- GrGLShaderVar("a", kFloat_GrSLType),
- GrGLShaderVar("b", kFloat_GrSLType),
- GrGLShaderVar("c", kFloat_GrSLType),
- GrGLShaderVar("d", kFloat_GrSLType),
- GrGLShaderVar("e", kFloat_GrSLType),
- GrGLShaderVar("f", kFloat_GrSLType),
- GrGLShaderVar("scale", kFloat_GrSLType),
+ static const GrGLSLShaderVar gSobelArgs[] = {
+ GrGLSLShaderVar("a", kFloat_GrSLType),
+ GrGLSLShaderVar("b", kFloat_GrSLType),
+ GrGLSLShaderVar("c", kFloat_GrSLType),
+ GrGLSLShaderVar("d", kFloat_GrSLType),
+ GrGLSLShaderVar("e", kFloat_GrSLType),
+ GrGLSLShaderVar("f", kFloat_GrSLType),
+ GrGLSLShaderVar("scale", kFloat_GrSLType),
};
SkString sobelFuncName;
GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
@@ -1677,10 +1677,10 @@ void GrGLLightingEffect::emitCode(EmitArgs& args) {
gSobelArgs,
"\treturn (-a + b - 2.0 * c + 2.0 * d -e + f) * scale;\n",
&sobelFuncName);
- static const GrGLShaderVar gPointToNormalArgs[] = {
- GrGLShaderVar("x", kFloat_GrSLType),
- GrGLShaderVar("y", kFloat_GrSLType),
- GrGLShaderVar("scale", kFloat_GrSLType),
+ static const GrGLSLShaderVar gPointToNormalArgs[] = {
+ GrGLSLShaderVar("x", kFloat_GrSLType),
+ GrGLSLShaderVar("y", kFloat_GrSLType),
+ GrGLSLShaderVar("scale", kFloat_GrSLType),
};
SkString pointToNormalName;
fsBuilder->emitFunction(kVec3f_GrSLType,
@@ -1690,9 +1690,9 @@ void GrGLLightingEffect::emitCode(EmitArgs& args) {
"\treturn normalize(vec3(-x * scale, -y * scale, 1));\n",
&pointToNormalName);
- static const GrGLShaderVar gInteriorNormalArgs[] = {
- GrGLShaderVar("m", kFloat_GrSLType, 9),
- GrGLShaderVar("surfaceScale", kFloat_GrSLType),
+ static const GrGLSLShaderVar gInteriorNormalArgs[] = {
+ GrGLSLShaderVar("m", kFloat_GrSLType, 9),
+ GrGLSLShaderVar("surfaceScale", kFloat_GrSLType),
};
SkString normalBody = emitNormalFunc(fBoundaryMode,
pointToNormalName.c_str(),
@@ -1767,10 +1767,10 @@ void GrGLDiffuseLightingEffect::emitLightFunc(GrGLFPBuilder* builder, SkString*
kFloat_GrSLType, kDefault_GrSLPrecision,
"KD", &kd);
- static const GrGLShaderVar gLightArgs[] = {
- GrGLShaderVar("normal", kVec3f_GrSLType),
- GrGLShaderVar("surfaceToLight", kVec3f_GrSLType),
- GrGLShaderVar("lightColor", kVec3f_GrSLType)
+ static const GrGLSLShaderVar gLightArgs[] = {
+ GrGLSLShaderVar("normal", kVec3f_GrSLType),
+ GrGLSLShaderVar("surfaceToLight", kVec3f_GrSLType),
+ GrGLSLShaderVar("lightColor", kVec3f_GrSLType)
};
SkString lightBody;
lightBody.appendf("\tfloat colorScale = %s * dot(normal, surfaceToLight);\n", kd);
@@ -1855,10 +1855,10 @@ void GrGLSpecularLightingEffect::emitLightFunc(GrGLFPBuilder* builder, SkString*
"Shininess",
&shininess);
- static const GrGLShaderVar gLightArgs[] = {
- GrGLShaderVar("normal", kVec3f_GrSLType),
- GrGLShaderVar("surfaceToLight", kVec3f_GrSLType),
- GrGLShaderVar("lightColor", kVec3f_GrSLType)
+ static const GrGLSLShaderVar gLightArgs[] = {
+ GrGLSLShaderVar("normal", kVec3f_GrSLType),
+ GrGLSLShaderVar("surfaceToLight", kVec3f_GrSLType),
+ GrGLSLShaderVar("lightColor", kVec3f_GrSLType)
};
SkString lightBody;
lightBody.appendf("\tvec3 halfDir = vec3(normalize(surfaceToLight + vec3(0, 0, 1)));\n");
@@ -1987,8 +1987,8 @@ void GrGLSpotLight::emitLightColor(GrGLFPBuilder* builder,
fSUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
kVec3f_GrSLType, kDefault_GrSLPrecision, "S", &s);
- static const GrGLShaderVar gLightColorArgs[] = {
- GrGLShaderVar("surfaceToLight", kVec3f_GrSLType)
+ static const GrGLSLShaderVar gLightColorArgs[] = {
+ GrGLSLShaderVar("surfaceToLight", kVec3f_GrSLType)
};
SkString lightColorBody;
lightColorBody.appendf("\tfloat cosAngle = -dot(surfaceToLight, %s);\n", s);
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | src/effects/SkPerlinNoiseShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698