aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects/GrBicubicEffect.cpp
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2017-07-28 15:19:46 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-28 20:43:03 +0000
commit5af9ea399d5e0344cc4b7da4e97b5dc5b3c74f64 (patch)
treedf906a3af0b954b130340589f24d128ce655bb01 /src/gpu/effects/GrBicubicEffect.cpp
parent0edfbb78244739cb6e695f240edb7f659a543160 (diff)
renamed SkSL types in preparation for killing precision modifiers
Bug: skia: Change-Id: Iff0289e25355a89cdc289a0892ed755dd1b1c900 Reviewed-on: https://skia-review.googlesource.com/27703 Commit-Queue: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/effects/GrBicubicEffect.cpp')
-rw-r--r--src/gpu/effects/GrBicubicEffect.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gpu/effects/GrBicubicEffect.cpp b/src/gpu/effects/GrBicubicEffect.cpp
index 4095f93e7a..28fcd9e1dc 100644
--- a/src/gpu/effects/GrBicubicEffect.cpp
+++ b/src/gpu/effects/GrBicubicEffect.cpp
@@ -71,26 +71,26 @@ void GrGLBicubicEffect::emitCode(EmitArgs& args) {
*
* This is GLSL, so the matrix is column-major (transposed from standard matrix notation).
*/
- fragBuilder->codeAppend("mat4 kMitchellCoefficients = mat4("
+ fragBuilder->codeAppend("float4x4 kMitchellCoefficients = float4x4("
" 1.0 / 18.0, 16.0 / 18.0, 1.0 / 18.0, 0.0 / 18.0,"
"-9.0 / 18.0, 0.0 / 18.0, 9.0 / 18.0, 0.0 / 18.0,"
"15.0 / 18.0, -36.0 / 18.0, 27.0 / 18.0, -6.0 / 18.0,"
"-7.0 / 18.0, 21.0 / 18.0, -21.0 / 18.0, 7.0 / 18.0);");
- fragBuilder->codeAppendf("vec2 coord = %s - %s * vec2(0.5);", coords2D.c_str(), imgInc);
+ fragBuilder->codeAppendf("float2 coord = %s - %s * float2(0.5);", coords2D.c_str(), imgInc);
// We unnormalize the coord in order to determine our fractional offset (f) within the texel
// We then snap coord to a texel center and renormalize. The snap prevents cases where the
// starting coords are near a texel boundary and accumulations of imgInc would cause us to skip/
// double hit a texel.
fragBuilder->codeAppendf("coord /= %s;", imgInc);
- fragBuilder->codeAppend("vec2 f = fract(coord);");
- fragBuilder->codeAppendf("coord = (coord - f + vec2(0.5)) * %s;", imgInc);
- fragBuilder->codeAppend("vec4 wx = kMitchellCoefficients * vec4(1.0, f.x, f.x * f.x, f.x * f.x * f.x);");
- fragBuilder->codeAppend("vec4 wy = kMitchellCoefficients * vec4(1.0, f.y, f.y * f.y, f.y * f.y * f.y);");
- fragBuilder->codeAppend("vec4 rowColors[4];");
+ fragBuilder->codeAppend("float2 f = fract(coord);");
+ fragBuilder->codeAppendf("coord = (coord - f + float2(0.5)) * %s;", imgInc);
+ fragBuilder->codeAppend("float4 wx = kMitchellCoefficients * float4(1.0, f.x, f.x * f.x, f.x * f.x * f.x);");
+ fragBuilder->codeAppend("float4 wy = kMitchellCoefficients * float4(1.0, f.y, f.y * f.y, f.y * f.y * f.y);");
+ fragBuilder->codeAppend("float4 rowColors[4];");
for (int y = 0; y < 4; ++y) {
for (int x = 0; x < 4; ++x) {
SkString coord;
- coord.printf("coord + %s * vec2(%d, %d)", imgInc, x - 1, y - 1);
+ coord.printf("coord + %s * float2(%d, %d)", imgInc, x - 1, y - 1);
SkString sampleVar;
sampleVar.printf("rowColors[%d]", x);
fDomain.sampleTexture(fragBuilder,
@@ -102,7 +102,7 @@ void GrGLBicubicEffect::emitCode(EmitArgs& args) {
args.fTexSamplers[0]);
}
fragBuilder->codeAppendf(
- "vec4 s%d = wx.x * rowColors[0] + wx.y * rowColors[1] + wx.z * rowColors[2] + wx.w * rowColors[3];",
+ "float4 s%d = wx.x * rowColors[0] + wx.y * rowColors[1] + wx.z * rowColors[2] + wx.w * rowColors[3];",
y);
}
SkString bicubicColor("(wy.x * s0 + wy.y * s1 + wy.z * s2 + wy.w * s3)");