OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
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 "SkBlurMaskFilter.h" | 9 #include "SkBlurMaskFilter.h" |
10 #include "SkBlurMask.h" | 10 #include "SkBlurMask.h" |
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 } | 815 } |
816 | 816 |
817 void GrRectBlurEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const
{ | 817 void GrRectBlurEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const
{ |
818 inout->mulByUnknownSingleComponent(); | 818 inout->mulByUnknownSingleComponent(); |
819 } | 819 } |
820 | 820 |
821 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrRectBlurEffect); | 821 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrRectBlurEffect); |
822 | 822 |
823 GrFragmentProcessor* GrRectBlurEffect::TestCreate(SkRandom* random, | 823 GrFragmentProcessor* GrRectBlurEffect::TestCreate(SkRandom* random, |
824 GrContext* context, | 824 GrContext* context, |
825 const GrDrawTargetCaps&, | 825 const GrCaps&, |
826 GrTexture**) { | 826 GrTexture**) { |
827 float sigma = random->nextRangeF(3,8); | 827 float sigma = random->nextRangeF(3,8); |
828 float width = random->nextRangeF(200,300); | 828 float width = random->nextRangeF(200,300); |
829 float height = random->nextRangeF(200,300); | 829 float height = random->nextRangeF(200,300); |
830 return GrRectBlurEffect::Create(context->textureProvider(), SkRect::MakeWH(w
idth, height), | 830 return GrRectBlurEffect::Create(context->textureProvider(), SkRect::MakeWH(w
idth, height), |
831 sigma); | 831 sigma); |
832 } | 832 } |
833 | 833 |
834 | 834 |
835 bool SkBlurMaskFilterImpl::directFilterMaskGPU(GrContext* context, | 835 bool SkBlurMaskFilterImpl::directFilterMaskGPU(GrContext* context, |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
997 const GrRRectBlurEffect& rrbe = other.cast<GrRRectBlurEffect>(); | 997 const GrRRectBlurEffect& rrbe = other.cast<GrRRectBlurEffect>(); |
998 return fRRect.getSimpleRadii().fX == rrbe.fRRect.getSimpleRadii().fX && fSig
ma == rrbe.fSigma; | 998 return fRRect.getSimpleRadii().fX == rrbe.fRRect.getSimpleRadii().fX && fSig
ma == rrbe.fSigma; |
999 } | 999 } |
1000 | 1000 |
1001 ////////////////////////////////////////////////////////////////////////////// | 1001 ////////////////////////////////////////////////////////////////////////////// |
1002 | 1002 |
1003 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrRRectBlurEffect); | 1003 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrRRectBlurEffect); |
1004 | 1004 |
1005 GrFragmentProcessor* GrRRectBlurEffect::TestCreate(SkRandom* random, | 1005 GrFragmentProcessor* GrRRectBlurEffect::TestCreate(SkRandom* random, |
1006 GrContext* context, | 1006 GrContext* context, |
1007 const GrDrawTargetCaps& caps, | 1007 const GrCaps& caps, |
1008 GrTexture*[]) { | 1008 GrTexture*[]) { |
1009 SkScalar w = random->nextRangeScalar(100.f, 1000.f); | 1009 SkScalar w = random->nextRangeScalar(100.f, 1000.f); |
1010 SkScalar h = random->nextRangeScalar(100.f, 1000.f); | 1010 SkScalar h = random->nextRangeScalar(100.f, 1000.f); |
1011 SkScalar r = random->nextRangeF(1.f, 9.f); | 1011 SkScalar r = random->nextRangeF(1.f, 9.f); |
1012 SkScalar sigma = random->nextRangeF(1.f,10.f); | 1012 SkScalar sigma = random->nextRangeF(1.f,10.f); |
1013 SkRRect rrect; | 1013 SkRRect rrect; |
1014 rrect.setRectXY(SkRect::MakeWH(w, h), r, r); | 1014 rrect.setRectXY(SkRect::MakeWH(w, h), r, r); |
1015 return GrRRectBlurEffect::Create(context, sigma, rrect); | 1015 return GrRRectBlurEffect::Create(context, sigma, rrect); |
1016 } | 1016 } |
1017 | 1017 |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1271 } else { | 1271 } else { |
1272 str->append("None"); | 1272 str->append("None"); |
1273 } | 1273 } |
1274 str->append("))"); | 1274 str->append("))"); |
1275 } | 1275 } |
1276 #endif | 1276 #endif |
1277 | 1277 |
1278 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) | 1278 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) |
1279 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) | 1279 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) |
1280 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 1280 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |