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

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

Issue 1443743002: Rename some processor functions from GL to GLSL (Closed) Base URL: https://skia.googlesource.com/skia.git@primProcs
Patch Set: nits Created 5 years, 1 month 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/GrCircleBlurFragmentProcessor.h ('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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 GrTexture* blurProf ile) 86 GrTexture* blurProf ile)
87 : fCircle(circle) 87 : fCircle(circle)
88 , fSigma(sigma) 88 , fSigma(sigma)
89 , fOffset(offset) 89 , fOffset(offset)
90 , fBlurProfileAccess(blurProfile, GrTextureParams::kBilerp_FilterMode) { 90 , fBlurProfileAccess(blurProfile, GrTextureParams::kBilerp_FilterMode) {
91 this->initClassID<GrCircleBlurFragmentProcessor>(); 91 this->initClassID<GrCircleBlurFragmentProcessor>();
92 this->addTextureAccess(&fBlurProfileAccess); 92 this->addTextureAccess(&fBlurProfileAccess);
93 this->setWillReadFragmentPosition(); 93 this->setWillReadFragmentPosition();
94 } 94 }
95 95
96 GrGLSLFragmentProcessor* GrCircleBlurFragmentProcessor::onCreateGLInstance() con st { 96 GrGLSLFragmentProcessor* GrCircleBlurFragmentProcessor::onCreateGLSLInstance() c onst {
97 return new GrGLCircleBlurFragmentProcessor(*this); 97 return new GrGLCircleBlurFragmentProcessor(*this);
98 } 98 }
99 99
100 void GrCircleBlurFragmentProcessor::onGetGLProcessorKey(const GrGLSLCaps& caps, 100 void GrCircleBlurFragmentProcessor::onGetGLSLProcessorKey(const GrGLSLCaps& caps ,
101 GrProcessorKeyBuilder* b ) const { 101 GrProcessorKeyBuilder* b) const {
102 GrGLCircleBlurFragmentProcessor::GenKey(*this, caps, b); 102 GrGLCircleBlurFragmentProcessor::GenKey(*this, caps, b);
103 } 103 }
104 104
105 void GrCircleBlurFragmentProcessor::onComputeInvariantOutput(GrInvariantOutput* inout) const { 105 void GrCircleBlurFragmentProcessor::onComputeInvariantOutput(GrInvariantOutput* inout) const {
106 inout->mulByUnknownSingleComponent(); 106 inout->mulByUnknownSingleComponent();
107 } 107 }
108 108
109 // Evaluate an AA circle function centered at the origin with 'radius' at (x,y) 109 // Evaluate an AA circle function centered at the origin with 'radius' at (x,y)
110 static inline float disk(float x, float y, float radius) { 110 static inline float disk(float x, float y, float radius) {
111 float distSq = x*x + y*y; 111 float distSq = x*x + y*y;
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrCircleBlurFragmentProcessor); 252 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrCircleBlurFragmentProcessor);
253 253
254 const GrFragmentProcessor* GrCircleBlurFragmentProcessor::TestCreate(GrProcessor TestData* d) { 254 const GrFragmentProcessor* GrCircleBlurFragmentProcessor::TestCreate(GrProcessor TestData* d) {
255 SkScalar wh = d->fRandom->nextRangeScalar(100.f, 1000.f); 255 SkScalar wh = d->fRandom->nextRangeScalar(100.f, 1000.f);
256 SkScalar sigma = d->fRandom->nextRangeF(1.f,10.f); 256 SkScalar sigma = d->fRandom->nextRangeF(1.f,10.f);
257 SkRect circle = SkRect::MakeWH(wh, wh); 257 SkRect circle = SkRect::MakeWH(wh, wh);
258 return GrCircleBlurFragmentProcessor::Create(d->fContext->textureProvider(), circle, sigma); 258 return GrCircleBlurFragmentProcessor::Create(d->fContext->textureProvider(), circle, sigma);
259 } 259 }
260 260
261 #endif 261 #endif
OLDNEW
« no previous file with comments | « src/effects/GrCircleBlurFragmentProcessor.h ('k') | src/effects/SkAlphaThresholdFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698