OLD | NEW |
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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 GrCircleBlurFragmentProcessor::GrCircleBlurFragmentProcessor(const SkRect& circl
e, | 88 GrCircleBlurFragmentProcessor::GrCircleBlurFragmentProcessor(const SkRect& circl
e, |
89 float sigma, | 89 float sigma, |
90 float offset, | 90 float offset, |
91 GrTexture* blurProf
ile) | 91 GrTexture* blurProf
ile) |
92 : fCircle(circle) | 92 : fCircle(circle) |
93 , fSigma(sigma) | 93 , fSigma(sigma) |
94 , fOffset(offset) | 94 , fOffset(offset) |
95 , fBlurProfileAccess(blurProfile, GrTextureParams::kBilerp_FilterMode) { | 95 , fBlurProfileAccess(blurProfile, GrTextureParams::kBilerp_FilterMode) { |
96 this->initClassID<GrCircleBlurFragmentProcessor>(); | 96 this->initClassID<GrCircleBlurFragmentProcessor>(); |
97 this->addTextureAccess(&fBlurProfileAccess); | 97 this->addTextureAccess(&fBlurProfileAccess); |
98 this->setWillReadFragmentPosition(); | 98 this->enableBuiltInState(kFragmentPosition_BuiltInState); |
99 } | 99 } |
100 | 100 |
101 GrGLSLFragmentProcessor* GrCircleBlurFragmentProcessor::onCreateGLSLInstance() c
onst { | 101 GrGLSLFragmentProcessor* GrCircleBlurFragmentProcessor::onCreateGLSLInstance() c
onst { |
102 return new GrGLCircleBlurFragmentProcessor; | 102 return new GrGLCircleBlurFragmentProcessor; |
103 } | 103 } |
104 | 104 |
105 void GrCircleBlurFragmentProcessor::onGetGLSLProcessorKey(const GrGLSLCaps& caps
, | 105 void GrCircleBlurFragmentProcessor::onGetGLSLProcessorKey(const GrGLSLCaps& caps
, |
106 GrProcessorKeyBuilder*
b) const { | 106 GrProcessorKeyBuilder*
b) const { |
107 GrGLCircleBlurFragmentProcessor::GenKey(*this, caps, b); | 107 GrGLCircleBlurFragmentProcessor::GenKey(*this, caps, b); |
108 } | 108 } |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |