| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 pdman.set1f(fInnerThresholdVar, alpha_threshold.innerThreshold()); | 196 pdman.set1f(fInnerThresholdVar, alpha_threshold.innerThreshold()); |
| 197 pdman.set1f(fOuterThresholdVar, alpha_threshold.outerThreshold()); | 197 pdman.set1f(fOuterThresholdVar, alpha_threshold.outerThreshold()); |
| 198 } | 198 } |
| 199 | 199 |
| 200 ///////////////////////////////////////////////////////////////////// | 200 ///////////////////////////////////////////////////////////////////// |
| 201 | 201 |
| 202 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(AlphaThresholdEffect); | 202 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(AlphaThresholdEffect); |
| 203 | 203 |
| 204 GrFragmentProcessor* AlphaThresholdEffect::TestCreate(SkRandom* random, | 204 GrFragmentProcessor* AlphaThresholdEffect::TestCreate(SkRandom* random, |
| 205 GrContext* context, | 205 GrContext* context, |
| 206 const GrDrawTargetCaps&, | 206 const GrCaps&, |
| 207 GrTexture** textures) { | 207 GrTexture** textures) { |
| 208 GrTexture* bmpTex = textures[GrProcessorUnitTest::kSkiaPMTextureIdx]; | 208 GrTexture* bmpTex = textures[GrProcessorUnitTest::kSkiaPMTextureIdx]; |
| 209 GrTexture* maskTex = textures[GrProcessorUnitTest::kAlphaTextureIdx]; | 209 GrTexture* maskTex = textures[GrProcessorUnitTest::kAlphaTextureIdx]; |
| 210 float inner_thresh = random->nextUScalar1(); | 210 float inner_thresh = random->nextUScalar1(); |
| 211 float outer_thresh = random->nextUScalar1(); | 211 float outer_thresh = random->nextUScalar1(); |
| 212 return AlphaThresholdEffect::Create(bmpTex, maskTex, inner_thresh, outer_thr
esh); | 212 return AlphaThresholdEffect::Create(bmpTex, maskTex, inner_thresh, outer_thr
esh); |
| 213 } | 213 } |
| 214 | 214 |
| 215 /////////////////////////////////////////////////////////////////////////////// | 215 /////////////////////////////////////////////////////////////////////////////// |
| 216 | 216 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 } | 377 } |
| 378 | 378 |
| 379 #ifndef SK_IGNORE_TO_STRING | 379 #ifndef SK_IGNORE_TO_STRING |
| 380 void SkAlphaThresholdFilterImpl::toString(SkString* str) const { | 380 void SkAlphaThresholdFilterImpl::toString(SkString* str) const { |
| 381 str->appendf("SkAlphaThresholdImageFilter: ("); | 381 str->appendf("SkAlphaThresholdImageFilter: ("); |
| 382 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold); | 382 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold); |
| 383 str->append(")"); | 383 str->append(")"); |
| 384 } | 384 } |
| 385 #endif | 385 #endif |
| 386 | 386 |
| OLD | NEW |