diff options
author | 2012-06-15 21:50:15 +0000 | |
---|---|---|
committer | 2012-06-15 21:50:15 +0000 | |
commit | fc0d23a6ba476c7fac0d0581880a930c1951efa0 (patch) | |
tree | 98ed897a00248501435a6a50d9394aaf7acc23e6 /src/gpu/effects/GrConvolutionEffect.cpp | |
parent | 13b85aab6e1ff2ffd5475e329f9d1d21863b8eb6 (diff) |
Avoid un-necessary re-calculations of width in for loop of emitFS function
Committed on behalf of kondapallykalyan@gmail.com
Review URL: https://codereview.appspot.com/6294075/
git-svn-id: http://skia.googlecode.com/svn/trunk@4270 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/effects/GrConvolutionEffect.cpp')
-rw-r--r-- | src/gpu/effects/GrConvolutionEffect.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gpu/effects/GrConvolutionEffect.cpp b/src/gpu/effects/GrConvolutionEffect.cpp index d1ccc917ec..d0462c6292 100644 --- a/src/gpu/effects/GrConvolutionEffect.cpp +++ b/src/gpu/effects/GrConvolutionEffect.cpp @@ -88,9 +88,10 @@ void GrGLConvolutionEffect::emitFS(GrGLShaderBuilder* state, code->appendf("\t\t%s = vec4(0, 0, 0, 0);\n", outputColor); code->appendf("\t\tvec2 coord = %s;\n", state->fSampleCoords.c_str()); - + + int width = this ->width(); // Manually unroll loop because some drivers don't; yields 20-30% speedup. - for (int i = 0; i < this->width(); i++) { + for (int i = 0; i < width; i++) { GrStringBuilder index; GrStringBuilder kernelIndex; index.appendS32(i); |