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

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

Issue 1684063006: Add GrShaderFlags enum (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Bit->Flag Created 4 years, 10 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 /* 2 /*
3 * Copyright 2015 Google Inc. 3 * Copyright 2015 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrCircleBlurFragmentProcessor.h" 9 #include "GrCircleBlurFragmentProcessor.h"
10 10
(...skipping 22 matching lines...) Expand all
33 }; 33 };
34 34
35 void GrGLCircleBlurFragmentProcessor::emitCode(EmitArgs& args) { 35 void GrGLCircleBlurFragmentProcessor::emitCode(EmitArgs& args) {
36 36
37 const char *dataName; 37 const char *dataName;
38 38
39 // The data is formatted as: 39 // The data is formatted as:
40 // x,y - the center of the circle 40 // x,y - the center of the circle
41 // z - the distance at which the intensity starts falling off (e.g., the start of the table) 41 // z - the distance at which the intensity starts falling off (e.g., the start of the table)
42 // w - the inverse of the profile texture size 42 // w - the inverse of the profile texture size
43 fDataUniform = args.fUniformHandler->addUniform(GrGLSLUniformHandler::kFragm ent_Visibility, 43 fDataUniform = args.fUniformHandler->addUniform(kFragment_GrShaderFlag,
44 kVec4f_GrSLType, 44 kVec4f_GrSLType,
45 kDefault_GrSLPrecision, 45 kDefault_GrSLPrecision,
46 "data", 46 "data",
47 &dataName); 47 &dataName);
48 48
49 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; 49 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
50 const char *fragmentPos = fragBuilder->fragmentPosition(); 50 const char *fragmentPos = fragBuilder->fragmentPosition();
51 51
52 if (args.fInputColor) { 52 if (args.fInputColor) {
53 fragBuilder->codeAppendf("vec4 src=%s;", args.fInputColor); 53 fragBuilder->codeAppendf("vec4 src=%s;", args.fInputColor);
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrCircleBlurFragmentProcessor); 257 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrCircleBlurFragmentProcessor);
258 258
259 const GrFragmentProcessor* GrCircleBlurFragmentProcessor::TestCreate(GrProcessor TestData* d) { 259 const GrFragmentProcessor* GrCircleBlurFragmentProcessor::TestCreate(GrProcessor TestData* d) {
260 SkScalar wh = d->fRandom->nextRangeScalar(100.f, 1000.f); 260 SkScalar wh = d->fRandom->nextRangeScalar(100.f, 1000.f);
261 SkScalar sigma = d->fRandom->nextRangeF(1.f,10.f); 261 SkScalar sigma = d->fRandom->nextRangeF(1.f,10.f);
262 SkRect circle = SkRect::MakeWH(wh, wh); 262 SkRect circle = SkRect::MakeWH(wh, wh);
263 return GrCircleBlurFragmentProcessor::Create(d->fContext->textureProvider(), circle, sigma); 263 return GrCircleBlurFragmentProcessor::Create(d->fContext->textureProvider(), circle, sigma);
264 } 264 }
265 265
266 #endif 266 #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