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 #include "Fuzz.h" | 7 #include "Fuzz.h" |
8 #include "Sk1DPathEffect.h" | 8 #include "Sk1DPathEffect.h" |
9 #include "Sk2DPathEffect.h" | 9 #include "Sk2DPathEffect.h" |
10 #include "SkAlphaThresholdFilter.h" | 10 #include "SkAlphaThresholdFilter.h" |
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 make_scalar(true), make_scalar(true), R(10.0f), make_scalar()) : | 673 make_scalar(true), make_scalar(true), R(10.0f), make_scalar()) : |
674 SkPerlinNoiseShader::MakeTurbulence( | 674 SkPerlinNoiseShader::MakeTurbulence( |
675 make_scalar(true), make_scalar(true), R(10.0f), make_scalar())); | 675 make_scalar(true), make_scalar(true), R(10.0f), make_scalar())); |
676 SkPaint paint; | 676 SkPaint paint; |
677 paint.setShader(shader); | 677 paint.setShader(shader); |
678 SkImageFilter::CropRect cropR(SkRect::MakeWH(SkIntToScalar(kBitmapSize), | 678 SkImageFilter::CropRect cropR(SkRect::MakeWH(SkIntToScalar(kBitmapSize), |
679 SkIntToScalar(kBitmapSize))
); | 679 SkIntToScalar(kBitmapSize))
); |
680 filter = SkPaintImageFilter::Make(paint, &cropR); | 680 filter = SkPaintImageFilter::Make(paint, &cropR); |
681 break; | 681 break; |
682 } | 682 } |
683 case DROP_SHADOW: { | 683 case DROP_SHADOW: |
684 sk_sp<SkImageFilter> subFilter(make_image_filter()); | 684 filter = SkDropShadowImageFilter::Make(make_scalar(), |
685 | 685 make_scalar(), |
686 filter = sk_sp<SkImageFilter>(SkDropShadowImageFilter::Create(make_scala
r(), | 686 make_scalar(true), |
687 make_scala
r(), | 687 make_scalar(true), |
688 make_scala
r(true), | 688 make_color(), |
689 make_scala
r(true), | 689 make_shadow_mode(), |
690 make_color
(), | 690 make_image_filter(), |
691 make_shado
w_mode(), | 691 nullptr); |
692 subFilter.
get(), | |
693 nullptr)); | |
694 break; | 692 break; |
695 } | |
696 case MORPHOLOGY: | 693 case MORPHOLOGY: |
697 if (R(2) == 1) { | 694 if (R(2) == 1) { |
698 filter = SkDilateImageFilter::Make(R(static_cast<float>(kBitmapSize)
), | 695 filter = SkDilateImageFilter::Make(R(static_cast<float>(kBitmapSize)
), |
699 R(static_cast<float>(kBitmapSize)
), | 696 R(static_cast<float>(kBitmapSize)
), |
700 make_image_filter()); | 697 make_image_filter()); |
701 } else { | 698 } else { |
702 filter = SkErodeImageFilter::Make(R(static_cast<float>(kBitmapSize))
, | 699 filter = SkErodeImageFilter::Make(R(static_cast<float>(kBitmapSize))
, |
703 R(static_cast<float>(kBitmapSize))
, | 700 R(static_cast<float>(kBitmapSize))
, |
704 make_image_filter()); | 701 make_image_filter()); |
705 } | 702 } |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 DEF_FUZZ(SerializedImageFilter, f) { | 797 DEF_FUZZ(SerializedImageFilter, f) { |
801 fuzz = f; | 798 fuzz = f; |
802 SkImageFilter* filter = make_serialized_image_filter(); | 799 SkImageFilter* filter = make_serialized_image_filter(); |
803 | 800 |
804 SkPaint paint; | 801 SkPaint paint; |
805 SkSafeUnref(paint.setImageFilter(filter)); | 802 SkSafeUnref(paint.setImageFilter(filter)); |
806 SkBitmap bitmap; | 803 SkBitmap bitmap; |
807 SkCanvas canvas(bitmap); | 804 SkCanvas canvas(bitmap); |
808 drawClippedBitmap(&canvas, 0, 0, paint); | 805 drawClippedBitmap(&canvas, 0, 0, paint); |
809 } | 806 } |
OLD | NEW |