diff options
author | cdalton <cdalton@nvidia.com> | 2016-04-11 12:18:09 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-11 12:18:09 -0700 |
commit | 3f6f76f98b6b37d17d1492791ff0feb1b7586bd6 (patch) | |
tree | f9d4ea6d87cfe9f1f05626eaac549e163bd00638 /experimental/SkPerlinNoiseShader2 | |
parent | a6b92ad1f7b79106caef6a4c721903544f507a02 (diff) |
Rename EmitArgs::fSamplers to fTexSamplers
Renames fSamplers to fTexSamplers in GrProcessor EmitArgs, and renames
GrGLSLTextureSampler to GrGLSLSampler. This will allow us to add a
second array of buffer samplers.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1862373003
Review URL: https://codereview.chromium.org/1862373003
Diffstat (limited to 'experimental/SkPerlinNoiseShader2')
-rw-r--r-- | experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp b/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp index 09762b3326..42211e4d7b 100644 --- a/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp +++ b/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp @@ -819,7 +819,7 @@ void GrGLPerlinNoise2::emitCode(EmitArgs& args) { xCoords.appendf("vec2(%s.x, 0.5)", floorVal); noiseCode.appendf("\n\tvec2 %s;\n\t%s.x = ", latticeIdx, latticeIdx); - fsBuilder->appendTextureLookup(&noiseCode, args.fSamplers[0], xCoords.c_str(), + fsBuilder->appendTextureLookup(&noiseCode, args.fTexSamplers[0], xCoords.c_str(), kVec2f_GrSLType); noiseCode.append(".r;"); } @@ -830,7 +830,7 @@ void GrGLPerlinNoise2::emitCode(EmitArgs& args) { xCoords.appendf("vec2(%s.z, 0.5)", floorVal); noiseCode.appendf("\n\t%s.y = ", latticeIdx); - fsBuilder->appendTextureLookup(&noiseCode, args.fSamplers[0], xCoords.c_str(), + fsBuilder->appendTextureLookup(&noiseCode, args.fTexSamplers[0], xCoords.c_str(), kVec2f_GrSLType); noiseCode.append(".r;"); } @@ -855,7 +855,7 @@ void GrGLPerlinNoise2::emitCode(EmitArgs& args) { SkString latticeCoords(""); latticeCoords.appendf("vec2(%s.x, %s)", bcoords, chanCoord); noiseCode.appendf("\n\tvec4 %s = ", lattice); - fsBuilder->appendTextureLookup(&noiseCode, args.fSamplers[1], latticeCoords.c_str(), + fsBuilder->appendTextureLookup(&noiseCode, args.fTexSamplers[1], latticeCoords.c_str(), kVec2f_GrSLType); noiseCode.appendf(".bgra;\n\t%s.x = ", uv); noiseCode.appendf(dotLattice, lattice, lattice, inc8bit, fractVal); @@ -867,7 +867,7 @@ void GrGLPerlinNoise2::emitCode(EmitArgs& args) { SkString latticeCoords(""); latticeCoords.appendf("vec2(%s.y, %s)", bcoords, chanCoord); noiseCode.append("\n\tlattice = "); - fsBuilder->appendTextureLookup(&noiseCode, args.fSamplers[1], latticeCoords.c_str(), + fsBuilder->appendTextureLookup(&noiseCode, args.fTexSamplers[1], latticeCoords.c_str(), kVec2f_GrSLType); noiseCode.appendf(".bgra;\n\t%s.y = ", uv); noiseCode.appendf(dotLattice, lattice, lattice, inc8bit, fractVal); @@ -883,7 +883,7 @@ void GrGLPerlinNoise2::emitCode(EmitArgs& args) { SkString latticeCoords(""); latticeCoords.appendf("vec2(%s.w, %s)", bcoords, chanCoord); noiseCode.append("\n\tlattice = "); - fsBuilder->appendTextureLookup(&noiseCode, args.fSamplers[1], latticeCoords.c_str(), + fsBuilder->appendTextureLookup(&noiseCode, args.fTexSamplers[1], latticeCoords.c_str(), kVec2f_GrSLType); noiseCode.appendf(".bgra;\n\t%s.y = ", uv); noiseCode.appendf(dotLattice, lattice, lattice, inc8bit, fractVal); @@ -895,7 +895,7 @@ void GrGLPerlinNoise2::emitCode(EmitArgs& args) { SkString latticeCoords(""); latticeCoords.appendf("vec2(%s.z, %s)", bcoords, chanCoord); noiseCode.append("\n\tlattice = "); - fsBuilder->appendTextureLookup(&noiseCode, args.fSamplers[1], latticeCoords.c_str(), + fsBuilder->appendTextureLookup(&noiseCode, args.fTexSamplers[1], latticeCoords.c_str(), kVec2f_GrSLType); noiseCode.appendf(".bgra;\n\t%s.x = ", uv); noiseCode.appendf(dotLattice, lattice, lattice, inc8bit, fractVal); @@ -1175,7 +1175,7 @@ void GrGLImprovedPerlinNoise::emitCode(EmitArgs& args) { SkString permCode("return "); // FIXME even though I'm creating these textures with kRepeat_TileMode, they're clamped. Not // sure why. Using fract() (here and the next texture lookup) as a workaround. - fsBuilder->appendTextureLookup(&permCode, args.fSamplers[0], "vec2(fract(x / 256.0), 0.0)", + fsBuilder->appendTextureLookup(&permCode, args.fTexSamplers[0], "vec2(fract(x / 256.0), 0.0)", kVec2f_GrSLType); permCode.append(".r * 255.0;"); fsBuilder->emitFunction(kFloat_GrSLType, "perm", SK_ARRAY_COUNT(permArgs), permArgs, @@ -1188,7 +1188,7 @@ void GrGLImprovedPerlinNoise::emitCode(EmitArgs& args) { }; SkString gradFuncName; SkString gradCode("return dot("); - fsBuilder->appendTextureLookup(&gradCode, args.fSamplers[1], "vec2(fract(x / 16.0), 0.0)", + fsBuilder->appendTextureLookup(&gradCode, args.fTexSamplers[1], "vec2(fract(x / 16.0), 0.0)", kVec2f_GrSLType); gradCode.append(".rgb * 255.0 - vec3(1.0), p);"); fsBuilder->emitFunction(kFloat_GrSLType, "grad", SK_ARRAY_COUNT(gradArgs), gradArgs, |