Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(786)

Side by Side Diff: fuzz/FilterFuzz.cpp

Issue 1861843002: Update DropShadowImageFilter to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address code review issues Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | gm/dropshadowimagefilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | gm/dropshadowimagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698