Fix lighting filters on Windows, and re-enable the GPU path.
Review URL: http://codereview.appspot.com/6354094/
git-svn-id: http://skia.googlecode.com/svn/trunk@4557 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index ed64489..acfc73b 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -599,7 +599,7 @@
SkScalar cosInnerConeAngle() const { return fCosInnerConeAngle; }
SkScalar cosOuterConeAngle() const { return fCosOuterConeAngle; }
SkScalar coneScale() const { return fConeScale; }
- SkPoint3 s() const { return fS; }
+ const SkPoint3& s() const { return fS; }
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkSpotLight)
@@ -776,15 +776,11 @@
}
bool SkDiffuseLightingImageFilter::asNewCustomStage(GrCustomStage** stage) const {
-#if 0
if (stage) {
SkScalar scale = SkScalarMul(surfaceScale(), SkIntToScalar(255));
*stage = new GrDiffuseLightingEffect(light(), scale, kd());
}
return true;
-#else
- return false;
-#endif
}
///////////////////////////////////////////////////////////////////////////////
@@ -843,15 +839,11 @@
}
bool SkSpecularLightingImageFilter::asNewCustomStage(GrCustomStage** stage) const {
-#if 0
if (stage) {
SkScalar scale = SkScalarMul(surfaceScale(), SkIntToScalar(255));
*stage = new GrSpecularLightingEffect(light(), scale, ks(), shininess());
}
return true;
-#else
- return false;
-#endif
}
///////////////////////////////////////////////////////////////////////////////
@@ -1310,8 +1302,6 @@
GetUniformLocation(programID, fCosInnerConeAngleVar->getName().c_str()));
GR_GL_CALL_RET(gl, fCosOuterConeAngleLocation,
GetUniformLocation(programID, fCosOuterConeAngleVar->getName().c_str()));
- GR_GL_CALL_RET(gl, fCosOuterConeAngleLocation,
- GetUniformLocation(programID, fCosOuterConeAngleVar->getName().c_str()));
GR_GL_CALL_RET(gl, fConeScaleLocation,
GetUniformLocation(programID, fConeScaleVar->getName().c_str()));
GR_GL_CALL_RET(gl, fSLocation,