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

Side by Side Diff: src/effects/GrCircleBlurFragmentProcessor.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/core/SkLightingShader.cpp ('k') | src/effects/SkAlphaThresholdFilter.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 2015 Google Inc. 2 * Copyright 2015 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 "GrCircleBlurFragmentProcessor.h" 8 #include "GrCircleBlurFragmentProcessor.h"
9 9
10 #if SK_SUPPORT_GPU 10 #if SK_SUPPORT_GPU
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 // We just want to compute "length(vec) - %s.z + 0.5) * %s.w" but need to re arrange 59 // We just want to compute "length(vec) - %s.z + 0.5) * %s.w" but need to re arrange
60 // for precision 60 // for precision
61 fragBuilder->codeAppendf("vec2 vec = vec2( (%s.x - %s.x) * %s.w , (%s.y - %s .y) * %s.w );", 61 fragBuilder->codeAppendf("vec2 vec = vec2( (%s.x - %s.x) * %s.w , (%s.y - %s .y) * %s.w );",
62 fragmentPos, dataName, dataName, 62 fragmentPos, dataName, dataName,
63 fragmentPos, dataName, dataName); 63 fragmentPos, dataName, dataName);
64 fragBuilder->codeAppendf("float dist = length(vec) + ( 0.5 - %s.z ) * %s.w;" , 64 fragBuilder->codeAppendf("float dist = length(vec) + ( 0.5 - %s.z ) * %s.w;" ,
65 dataName, dataName); 65 dataName, dataName);
66 66
67 fragBuilder->codeAppendf("float intensity = "); 67 fragBuilder->codeAppendf("float intensity = ");
68 fragBuilder->appendTextureLookup(args.fSamplers[0], "vec2(dist, 0.5)"); 68 fragBuilder->appendTextureLookup(args.fTexSamplers[0], "vec2(dist, 0.5)");
69 fragBuilder->codeAppend(".a;"); 69 fragBuilder->codeAppend(".a;");
70 70
71 fragBuilder->codeAppendf("%s = src * intensity;\n", args.fOutputColor ); 71 fragBuilder->codeAppendf("%s = src * intensity;\n", args.fOutputColor );
72 } 72 }
73 73
74 void GrGLCircleBlurFragmentProcessor::onSetData(const GrGLSLProgramDataManager& pdman, 74 void GrGLCircleBlurFragmentProcessor::onSetData(const GrGLSLProgramDataManager& pdman,
75 const GrProcessor& proc) { 75 const GrProcessor& proc) {
76 const GrCircleBlurFragmentProcessor& cbfp = proc.cast<GrCircleBlurFragmentPr ocessor>(); 76 const GrCircleBlurFragmentProcessor& cbfp = proc.cast<GrCircleBlurFragmentPr ocessor>();
77 const SkRect& circle = cbfp.circle(); 77 const SkRect& circle = cbfp.circle();
78 78
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrCircleBlurFragmentProcessor); 260 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrCircleBlurFragmentProcessor);
261 261
262 const GrFragmentProcessor* GrCircleBlurFragmentProcessor::TestCreate(GrProcessor TestData* d) { 262 const GrFragmentProcessor* GrCircleBlurFragmentProcessor::TestCreate(GrProcessor TestData* d) {
263 SkScalar wh = d->fRandom->nextRangeScalar(100.f, 1000.f); 263 SkScalar wh = d->fRandom->nextRangeScalar(100.f, 1000.f);
264 SkScalar sigma = d->fRandom->nextRangeF(1.f,10.f); 264 SkScalar sigma = d->fRandom->nextRangeF(1.f,10.f);
265 SkRect circle = SkRect::MakeWH(wh, wh); 265 SkRect circle = SkRect::MakeWH(wh, wh);
266 return GrCircleBlurFragmentProcessor::Create(d->fContext->textureProvider(), circle, sigma); 266 return GrCircleBlurFragmentProcessor::Create(d->fContext->textureProvider(), circle, sigma);
267 } 267 }
268 268
269 #endif 269 #endif
OLDNEW
« no previous file with comments | « src/core/SkLightingShader.cpp ('k') | src/effects/SkAlphaThresholdFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698