aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkLightingImageFilter.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-30 19:11:34 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-30 19:11:34 +0000
commit868a8e7fc83e9ac6ee1418e75b84a0595605626c (patch)
tree6099dee09e40beed726e2f6d300485935b73cbb2 /src/effects/SkLightingImageFilter.cpp
parent7426743837051f43dbc1209775b391b917c69c54 (diff)
Recommit r5350 with fix for image failures (which affected GLs that don't support ARB_texture_swizzle).
git-svn-id: http://skia.googlecode.com/svn/trunk@5353 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects/SkLightingImageFilter.cpp')
-rw-r--r--src/effects/SkLightingImageFilter.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index 408e7021ff..8eb28bb3c5 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -1160,7 +1160,7 @@ void GrGLLightingEffect::emitFS(GrGLShaderBuilder* builder,
SkString texCoords;
texCoords.appendf("coord + vec2(%d, %d) * %s", dx, dy, imgInc);
code->appendf("\t\tm[%d] = ", index++);
- builder->emitTextureLookup(samplerName, texCoords.c_str());
+ builder->appendTextureLookup(code, samplerName, texCoords.c_str());
code->appendf(".a;\n");
}
}
@@ -1168,11 +1168,12 @@ void GrGLLightingEffect::emitFS(GrGLShaderBuilder* builder,
SkString arg;
arg.appendf("%s * m[4]", surfScale);
fLight->emitSurfaceToLight(builder, code, arg.c_str());
- code->appendf(";\n");
+ code->append(";\n");
code->appendf("\t\t%s = %s(%s(m, %s), surfaceToLight, ",
outputColor, lightFunc.c_str(), interiorNormalName.c_str(), surfScale);
fLight->emitLightColor(builder, "surfaceToLight");
- code->appendf(")%s;\n", builder->fModulate.c_str());
+ code->append(");\n");
+ GrGLSLMulVarBy4f(code, 2, outputColor, inputColor);
}
GrGLProgramStage::StageKey GrGLLightingEffect::GenKey(const GrCustomStage& s,