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

Side by Side Diff: src/effects/SkMagnifierImageFilter.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
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkMorphologyImageFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The Android Open Source Project 2 * Copyright 2012 The Android Open Source Project
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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkMagnifierImageFilter.h" 9 #include "SkMagnifierImageFilter.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 fsBuilder->codeAppend("\t\t\tweight = min(min(delta_squared.x, delta_squared .y), 1.0);\n"); 161 fsBuilder->codeAppend("\t\t\tweight = min(min(delta_squared.x, delta_squared .y), 1.0);\n");
162 fsBuilder->codeAppend("\t\t}\n"); 162 fsBuilder->codeAppend("\t\t}\n");
163 163
164 fsBuilder->codeAppend("\t\tvec2 mix_coord = mix(coord, zoom_coord, weight);\ n"); 164 fsBuilder->codeAppend("\t\tvec2 mix_coord = mix(coord, zoom_coord, weight);\ n");
165 fsBuilder->codeAppend("\t\tvec4 output_color = "); 165 fsBuilder->codeAppend("\t\tvec4 output_color = ");
166 fsBuilder->appendTextureLookup(samplers[0], "mix_coord"); 166 fsBuilder->appendTextureLookup(samplers[0], "mix_coord");
167 fsBuilder->codeAppend(";\n"); 167 fsBuilder->codeAppend(";\n");
168 168
169 fsBuilder->codeAppendf("\t\t%s = output_color;", outputColor); 169 fsBuilder->codeAppendf("\t\t%s = output_color;", outputColor);
170 SkString modulate; 170 SkString modulate;
171 GrGLSLMulVarBy4f(&modulate, 2, outputColor, inputColor); 171 GrGLSLMulVarBy4f(&modulate, outputColor, inputColor);
172 fsBuilder->codeAppend(modulate.c_str()); 172 fsBuilder->codeAppend(modulate.c_str());
173 } 173 }
174 174
175 void GrGLMagnifierEffect::setData(const GrGLProgramDataManager& pdman, 175 void GrGLMagnifierEffect::setData(const GrGLProgramDataManager& pdman,
176 const GrProcessor& effect) { 176 const GrProcessor& effect) {
177 const GrMagnifierEffect& zoom = effect.cast<GrMagnifierEffect>(); 177 const GrMagnifierEffect& zoom = effect.cast<GrMagnifierEffect>();
178 pdman.set2f(fOffsetVar, zoom.x_offset(), zoom.y_offset()); 178 pdman.set2f(fOffsetVar, zoom.x_offset(), zoom.y_offset());
179 pdman.set2f(fInvZoomVar, zoom.x_inv_zoom(), zoom.y_inv_zoom()); 179 pdman.set2f(fInvZoomVar, zoom.x_inv_zoom(), zoom.y_inv_zoom());
180 pdman.set2f(fInvInsetVar, zoom.x_inv_inset(), zoom.y_inv_inset()); 180 pdman.set2f(fInvInsetVar, zoom.x_inv_inset(), zoom.y_inv_inset());
181 } 181 }
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 366
367 int x_val = SkPin32(SkScalarFloorToInt(x_interp), 0, width - 1); 367 int x_val = SkPin32(SkScalarFloorToInt(x_interp), 0, width - 1);
368 int y_val = SkPin32(SkScalarFloorToInt(y_interp), 0, height - 1); 368 int y_val = SkPin32(SkScalarFloorToInt(y_interp), 0, height - 1);
369 369
370 *dptr = sptr[y_val * width + x_val]; 370 *dptr = sptr[y_val * width + x_val];
371 dptr++; 371 dptr++;
372 } 372 }
373 } 373 }
374 return true; 374 return true;
375 } 375 }
OLDNEW
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkMorphologyImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698