| OLD | NEW |
| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 GrCircleBlurFragmentProcessor::GrCircleBlurFragmentProcessor(const SkRect& circl
e, | 89 GrCircleBlurFragmentProcessor::GrCircleBlurFragmentProcessor(const SkRect& circl
e, |
| 90 float sigma, | 90 float sigma, |
| 91 float solidRadius, | 91 float solidRadius, |
| 92 float textureRadius
, | 92 float textureRadius
, |
| 93 GrTexture* blurProf
ile) | 93 GrTexture* blurProf
ile) |
| 94 : fCircle(circle) | 94 : fCircle(circle) |
| 95 , fSigma(sigma) | 95 , fSigma(sigma) |
| 96 , fSolidRadius(solidRadius) | 96 , fSolidRadius(solidRadius) |
| 97 , fTextureRadius(textureRadius) | 97 , fTextureRadius(textureRadius) |
| 98 , fBlurProfileAccess(blurProfile, GrTextureParams::kBilerp_FilterMode) { | 98 , fBlurProfileAccess(blurProfile, nullptr, GrTextureParams::kBilerp_FilterMo
de) { |
| 99 this->initClassID<GrCircleBlurFragmentProcessor>(); | 99 this->initClassID<GrCircleBlurFragmentProcessor>(); |
| 100 this->addTextureAccess(&fBlurProfileAccess); | 100 this->addTextureAccess(&fBlurProfileAccess); |
| 101 this->setWillReadFragmentPosition(); | 101 this->setWillReadFragmentPosition(); |
| 102 } | 102 } |
| 103 | 103 |
| 104 GrGLSLFragmentProcessor* GrCircleBlurFragmentProcessor::onCreateGLSLInstance() c
onst { | 104 GrGLSLFragmentProcessor* GrCircleBlurFragmentProcessor::onCreateGLSLInstance() c
onst { |
| 105 return new GLSLProcessor; | 105 return new GLSLProcessor; |
| 106 } | 106 } |
| 107 | 107 |
| 108 void GrCircleBlurFragmentProcessor::onGetGLSLProcessorKey(const GrGLSLCaps& caps
, | 108 void GrCircleBlurFragmentProcessor::onGetGLSLProcessorKey(const GrGLSLCaps& caps
, |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrCircleBlurFragmentProcessor); | 315 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrCircleBlurFragmentProcessor); |
| 316 | 316 |
| 317 sk_sp<GrFragmentProcessor> GrCircleBlurFragmentProcessor::TestCreate(GrProcessor
TestData* d) { | 317 sk_sp<GrFragmentProcessor> GrCircleBlurFragmentProcessor::TestCreate(GrProcessor
TestData* d) { |
| 318 SkScalar wh = d->fRandom->nextRangeScalar(100.f, 1000.f); | 318 SkScalar wh = d->fRandom->nextRangeScalar(100.f, 1000.f); |
| 319 SkScalar sigma = d->fRandom->nextRangeF(1.f,10.f); | 319 SkScalar sigma = d->fRandom->nextRangeF(1.f,10.f); |
| 320 SkRect circle = SkRect::MakeWH(wh, wh); | 320 SkRect circle = SkRect::MakeWH(wh, wh); |
| 321 return GrCircleBlurFragmentProcessor::Make(d->fContext->textureProvider(), c
ircle, sigma); | 321 return GrCircleBlurFragmentProcessor::Make(d->fContext->textureProvider(), c
ircle, sigma); |
| 322 } | 322 } |
| 323 | 323 |
| 324 #endif | 324 #endif |
| OLD | NEW |