Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(324)

Side by Side Diff: src/gpu/effects/GrConvolutionEffect.cpp

Issue 648463002: Remove tab parameter from GrGLSLMulVarBy4f function (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix comment Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "gl/builders/GrGLProgramBuilder.h" 8 #include "gl/builders/GrGLProgramBuilder.h"
9 #include "GrConvolutionEffect.h" 9 #include "GrConvolutionEffect.h"
10 #include "gl/GrGLProcessor.h" 10 #include "gl/GrGLProcessor.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 const char* bounds = builder->getUniformCStr(fBoundsUni); 94 const char* bounds = builder->getUniformCStr(fBoundsUni);
95 const char* component = this->direction() == Gr1DKernelEffect::kY_Di rection ? "y" : "x"; 95 const char* component = this->direction() == Gr1DKernelEffect::kY_Di rection ? "y" : "x";
96 fsBuilder->codeAppendf(" * float(coord.%s >= %s.x && coord.%s <= %s. y)", 96 fsBuilder->codeAppendf(" * float(coord.%s >= %s.x && coord.%s <= %s. y)",
97 component, bounds, component, bounds); 97 component, bounds, component, bounds);
98 } 98 }
99 fsBuilder->codeAppendf(" * %s;\n", kernelIndex.c_str()); 99 fsBuilder->codeAppendf(" * %s;\n", kernelIndex.c_str());
100 fsBuilder->codeAppendf("\t\tcoord += %s;\n", imgInc); 100 fsBuilder->codeAppendf("\t\tcoord += %s;\n", imgInc);
101 } 101 }
102 102
103 SkString modulate; 103 SkString modulate;
104 GrGLSLMulVarBy4f(&modulate, 2, outputColor, inputColor); 104 GrGLSLMulVarBy4f(&modulate, outputColor, inputColor);
105 fsBuilder->codeAppend(modulate.c_str()); 105 fsBuilder->codeAppend(modulate.c_str());
106 } 106 }
107 107
108 void GrGLConvolutionEffect::setData(const GrGLProgramDataManager& pdman, 108 void GrGLConvolutionEffect::setData(const GrGLProgramDataManager& pdman,
109 const GrProcessor& processor) { 109 const GrProcessor& processor) {
110 const GrConvolutionEffect& conv = processor.cast<GrConvolutionEffect>(); 110 const GrConvolutionEffect& conv = processor.cast<GrConvolutionEffect>();
111 GrTexture& texture = *conv.texture(0); 111 GrTexture& texture = *conv.texture(0);
112 // the code we generated was for a specific kernel radius 112 // the code we generated was for a specific kernel radius
113 SkASSERT(conv.radius() == fRadius); 113 SkASSERT(conv.radius() == fRadius);
114 float imageIncrement[2] = { 0 }; 114 float imageIncrement[2] = { 0 };
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 } 232 }
233 233
234 bool useBounds = random->nextBool(); 234 bool useBounds = random->nextBool();
235 return GrConvolutionEffect::Create(textures[texIdx], 235 return GrConvolutionEffect::Create(textures[texIdx],
236 dir, 236 dir,
237 radius, 237 radius,
238 kernel, 238 kernel,
239 useBounds, 239 useBounds,
240 bounds); 240 bounds);
241 } 241 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrConfigConversionEffect.cpp ('k') | src/gpu/effects/GrMatrixConvolutionEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698