Change to fuzzer for new constructor
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 15 Jan 2014 20:20:24 +0000 (20:20 +0000)
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 15 Jan 2014 20:20:24 +0000 (20:20 +0000)
BUG=skia:
R=senorblanco@google.com, sugoi@google.com, senorblanco@chromium.org

Author: sugoi@chromium.org

Review URL: https://codereview.chromium.org/139613002

git-svn-id: http://skia.googlecode.com/svn/trunk@13099 2bbb7eff-a529-9590-31e7-b0007b416f81

samplecode/SampleFilterFuzz.cpp

index 8fa147a..e31f512 100644 (file)
@@ -251,15 +251,20 @@ static SkImageFilter* make_image_filter(bool canBeNull = true) {
                      make_scalar(true), make_color(), make_image_filter());
         break;
     case MORPHOLOGY:
-        if (R(2) == 1)
+        if (R(2) == 1) {
             filter = new SkDilateImageFilter(R(static_cast<float>(kBitmapSize)),
                 R(static_cast<float>(kBitmapSize)), make_image_filter());
-        else
+        } else {
             filter = new SkErodeImageFilter(R(static_cast<float>(kBitmapSize)),
                 R(static_cast<float>(kBitmapSize)), make_image_filter());
+        }
         break;
     case BITMAP:
-        filter = new SkBitmapSource(make_bitmap());
+        if (R(2) == 1) {
+            filter = new SkBitmapSource(make_bitmap(), make_rect(), make_rect());
+        } else {
+            filter = new SkBitmapSource(make_bitmap());
+        }
         break;
     case DISPLACE:
         filter = new SkDisplacementMapEffect(make_channel_selector_type(),