diff options
author | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-07-11 16:44:49 +0000 |
---|---|---|
committer | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-07-11 16:44:49 +0000 |
commit | 0ec1eab8776639c503b79fcc8384f6172cceddb0 (patch) | |
tree | b85576ae39ecb3d805e6c76684ba3aaaf2a1458e /src/effects | |
parent | 6730cbb80a2366c1333f48b7cd0397daed337a8b (diff) |
Mac GLSL fixes; unreviewed.
git-svn-id: http://skia.googlecode.com/svn/trunk@4539 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects')
-rw-r--r-- | src/effects/SkLightingImageFilter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp index 9b8fb0f7c0..7ba425d4b7 100644 --- a/src/effects/SkLightingImageFilter.cpp +++ b/src/effects/SkLightingImageFilter.cpp @@ -1017,7 +1017,7 @@ void GrGLLightingEffect::emitFS(GrGLShaderBuilder* state, fLight->emitFuncs(funcs); emitLightFunc(funcs); funcs->appendf("float sobel(float a, float b, float c, float d, float e, float f, float scale) {\n"); - funcs->appendf("\treturn (-a + b - 2 * c + 2 * d -e + f) * scale;\n"); + funcs->appendf("\treturn (-a + b - 2.0 * c + 2.0 * d -e + f) * scale;\n"); funcs->appendf("}\n"); funcs->appendf("vec3 pointToNormal(float x, float y, float scale) {\n"); funcs->appendf("\treturn normalize(vec3(-x * scale, -y * scale, 1));\n"); @@ -1095,7 +1095,7 @@ void GrGLDiffuseLightingEffect::initUniforms(const GrGLInterface* gl, void GrGLDiffuseLightingEffect::emitLightFunc(SkString* funcs) { funcs->appendf("vec4 light(vec3 normal, vec3 surfaceToLight, vec3 lightColor) {\n"); funcs->appendf("\tfloat colorScale = %s * dot(normal, surfaceToLight);\n", fKDVar->getName().c_str()); - funcs->appendf("\treturn vec4(lightColor * clamp(colorScale, 0, 1), 1);\n"); + funcs->appendf("\treturn vec4(lightColor * clamp(colorScale, 0.0, 1.0), 1.0);\n"); funcs->appendf("}\n"); } @@ -1165,7 +1165,7 @@ void GrGLSpecularLightingEffect::emitLightFunc(SkString* funcs) { funcs->appendf("\tfloat colorScale = %s * pow(dot(normal, halfDir), %s);\n", fKSVar->getName().c_str(), fShininessVar->getName().c_str()); - funcs->appendf("\treturn vec4(lightColor * clamp(colorScale, 0, 1), 1);\n"); + funcs->appendf("\treturn vec4(lightColor * clamp(colorScale, 0.0, 1.0), 1.0);\n"); funcs->appendf("}\n"); } |