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

Side by Side Diff: src/effects/SkMagnifierImageFilter.cpp

Issue 1862373003: Rename EmitArgs::fSamplers to fTexSamplers (Closed) Base URL: https://skia.googlesource.com/skia.git@upload3_infer
Patch Set: rebase Created 4 years, 8 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 fragBuilder->codeAppend("\t\t\tfloat dist = length(delta);\n"); 148 fragBuilder->codeAppend("\t\t\tfloat dist = length(delta);\n");
149 fragBuilder->codeAppend("\t\t\tdist = max(2.0 - dist, 0.0);\n"); 149 fragBuilder->codeAppend("\t\t\tdist = max(2.0 - dist, 0.0);\n");
150 fragBuilder->codeAppend("\t\t\tweight = min(dist * dist, 1.0);\n"); 150 fragBuilder->codeAppend("\t\t\tweight = min(dist * dist, 1.0);\n");
151 fragBuilder->codeAppend("\t\t} else {\n"); 151 fragBuilder->codeAppend("\t\t} else {\n");
152 fragBuilder->codeAppend("\t\t\tvec2 delta_squared = delta * delta;\n"); 152 fragBuilder->codeAppend("\t\t\tvec2 delta_squared = delta * delta;\n");
153 fragBuilder->codeAppend("\t\t\tweight = min(min(delta_squared.x, delta_squar ed.y), 1.0);\n"); 153 fragBuilder->codeAppend("\t\t\tweight = min(min(delta_squared.x, delta_squar ed.y), 1.0);\n");
154 fragBuilder->codeAppend("\t\t}\n"); 154 fragBuilder->codeAppend("\t\t}\n");
155 155
156 fragBuilder->codeAppend("\t\tvec2 mix_coord = mix(coord, zoom_coord, weight) ;\n"); 156 fragBuilder->codeAppend("\t\tvec2 mix_coord = mix(coord, zoom_coord, weight) ;\n");
157 fragBuilder->codeAppend("\t\tvec4 output_color = "); 157 fragBuilder->codeAppend("\t\tvec4 output_color = ");
158 fragBuilder->appendTextureLookup(args.fSamplers[0], "mix_coord"); 158 fragBuilder->appendTextureLookup(args.fTexSamplers[0], "mix_coord");
159 fragBuilder->codeAppend(";\n"); 159 fragBuilder->codeAppend(";\n");
160 160
161 fragBuilder->codeAppendf("\t\t%s = output_color;", args.fOutputColor); 161 fragBuilder->codeAppendf("\t\t%s = output_color;", args.fOutputColor);
162 SkString modulate; 162 SkString modulate;
163 GrGLSLMulVarBy4f(&modulate, args.fOutputColor, args.fInputColor); 163 GrGLSLMulVarBy4f(&modulate, args.fOutputColor, args.fInputColor);
164 fragBuilder->codeAppend(modulate.c_str()); 164 fragBuilder->codeAppend(modulate.c_str());
165 } 165 }
166 166
167 void GrGLMagnifierEffect::onSetData(const GrGLSLProgramDataManager& pdman, 167 void GrGLMagnifierEffect::onSetData(const GrGLSLProgramDataManager& pdman,
168 const GrProcessor& effect) { 168 const GrProcessor& effect) {
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 367
368 #ifndef SK_IGNORE_TO_STRING 368 #ifndef SK_IGNORE_TO_STRING
369 void SkMagnifierImageFilter::toString(SkString* str) const { 369 void SkMagnifierImageFilter::toString(SkString* str) const {
370 str->appendf("SkMagnifierImageFilter: ("); 370 str->appendf("SkMagnifierImageFilter: (");
371 str->appendf("src: (%f,%f,%f,%f) ", 371 str->appendf("src: (%f,%f,%f,%f) ",
372 fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.fRight, fSrcRect.fBotto m); 372 fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.fRight, fSrcRect.fBotto m);
373 str->appendf("inset: %f", fInset); 373 str->appendf("inset: %f", fInset);
374 str->append(")"); 374 str->append(")");
375 } 375 }
376 #endif 376 #endif
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