| 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 "SampleCode.h" | 7 #include "SampleCode.h" |
| 8 #include "SkAlphaThresholdFilter.h" | 8 #include "SkAlphaThresholdFilter.h" |
| 9 #include "SkBitmapSource.h" | 9 #include "SkBitmapSource.h" |
| 10 #include "SkBlurImageFilter.h" | 10 #include "SkBlurImageFilter.h" |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 static void do_fuzz(SkCanvas* canvas) { | 428 static void do_fuzz(SkCanvas* canvas) { |
| 429 SkImageFilter* filter = make_serialized_image_filter(); | 429 SkImageFilter* filter = make_serialized_image_filter(); |
| 430 | 430 |
| 431 #ifdef SK_FUZZER_IS_VERBOSE | 431 #ifdef SK_FUZZER_IS_VERBOSE |
| 432 static uint32_t numFilters = 0; | 432 static uint32_t numFilters = 0; |
| 433 static uint32_t numValidFilters = 0; | 433 static uint32_t numValidFilters = 0; |
| 434 if (0 == numFilters) { | 434 if (0 == numFilters) { |
| 435 printf("Fuzzing with %u\n", kSeed); | 435 printf("Fuzzing with %u\n", kSeed); |
| 436 } | 436 } |
| 437 numFilters++; | 437 numFilters++; |
| 438 if (NULL != filter) { | 438 if (filter) { |
| 439 numValidFilters++; | 439 numValidFilters++; |
| 440 } | 440 } |
| 441 printf("Filter no : %u. Valid filters so far : %u\r", numFilters, numValidFi
lters); | 441 printf("Filter no : %u. Valid filters so far : %u\r", numFilters, numValidFi
lters); |
| 442 fflush(stdout); | 442 fflush(stdout); |
| 443 #endif | 443 #endif |
| 444 | 444 |
| 445 SkPaint paint; | 445 SkPaint paint; |
| 446 SkSafeUnref(paint.setImageFilter(filter)); | 446 SkSafeUnref(paint.setImageFilter(filter)); |
| 447 drawClippedBitmap(canvas, 0, 0, paint); | 447 drawClippedBitmap(canvas, 0, 0, paint); |
| 448 } | 448 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 475 } | 475 } |
| 476 | 476 |
| 477 private: | 477 private: |
| 478 typedef SkView INHERITED; | 478 typedef SkView INHERITED; |
| 479 }; | 479 }; |
| 480 | 480 |
| 481 ////////////////////////////////////////////////////////////////////////////// | 481 ////////////////////////////////////////////////////////////////////////////// |
| 482 | 482 |
| 483 static SkView* MyFactory() { return new ImageFilterFuzzView; } | 483 static SkView* MyFactory() { return new ImageFilterFuzzView; } |
| 484 static SkViewRegister reg(MyFactory); | 484 static SkViewRegister reg(MyFactory); |
| OLD | NEW |