OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkAlphaThresholdFilter.h" | 8 #include "SkAlphaThresholdFilter.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkReadBuffer.h" | 10 #include "SkReadBuffer.h" |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 const GrProcessor& proc) { | 188 const GrProcessor& proc) { |
189 const AlphaThresholdEffect& alpha_threshold = proc.cast<AlphaThresholdEffect
>(); | 189 const AlphaThresholdEffect& alpha_threshold = proc.cast<AlphaThresholdEffect
>(); |
190 pdman.set1f(fInnerThresholdVar, alpha_threshold.innerThreshold()); | 190 pdman.set1f(fInnerThresholdVar, alpha_threshold.innerThreshold()); |
191 pdman.set1f(fOuterThresholdVar, alpha_threshold.outerThreshold()); | 191 pdman.set1f(fOuterThresholdVar, alpha_threshold.outerThreshold()); |
192 } | 192 } |
193 | 193 |
194 ///////////////////////////////////////////////////////////////////// | 194 ///////////////////////////////////////////////////////////////////// |
195 | 195 |
196 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(AlphaThresholdEffect); | 196 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(AlphaThresholdEffect); |
197 | 197 |
198 GrFragmentProcessor* AlphaThresholdEffect::TestCreate(GrProcessorTestData* d) { | 198 const GrFragmentProcessor* AlphaThresholdEffect::TestCreate(GrProcessorTestData*
d) { |
199 GrTexture* bmpTex = d->fTextures[GrProcessorUnitTest::kSkiaPMTextureIdx]; | 199 GrTexture* bmpTex = d->fTextures[GrProcessorUnitTest::kSkiaPMTextureIdx]; |
200 GrTexture* maskTex = d->fTextures[GrProcessorUnitTest::kAlphaTextureIdx]; | 200 GrTexture* maskTex = d->fTextures[GrProcessorUnitTest::kAlphaTextureIdx]; |
201 float innerThresh = d->fRandom->nextUScalar1(); | 201 float innerThresh = d->fRandom->nextUScalar1(); |
202 float outerThresh = d->fRandom->nextUScalar1(); | 202 float outerThresh = d->fRandom->nextUScalar1(); |
203 return AlphaThresholdEffect::Create(d->fProcDataManager, bmpTex, maskTex, in
nerThresh, | 203 return AlphaThresholdEffect::Create(d->fProcDataManager, bmpTex, maskTex, in
nerThresh, |
204 outerThresh); | 204 outerThresh); |
205 } | 205 } |
206 | 206 |
207 /////////////////////////////////////////////////////////////////////////////// | 207 /////////////////////////////////////////////////////////////////////////////// |
208 | 208 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 } | 372 } |
373 | 373 |
374 #ifndef SK_IGNORE_TO_STRING | 374 #ifndef SK_IGNORE_TO_STRING |
375 void SkAlphaThresholdFilterImpl::toString(SkString* str) const { | 375 void SkAlphaThresholdFilterImpl::toString(SkString* str) const { |
376 str->appendf("SkAlphaThresholdImageFilter: ("); | 376 str->appendf("SkAlphaThresholdImageFilter: ("); |
377 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold); | 377 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold); |
378 str->append(")"); | 378 str->append(")"); |
379 } | 379 } |
380 #endif | 380 #endif |
381 | 381 |
OLD | NEW |