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

Side by Side Diff: samplecode/SampleFilterFuzz.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 | « include/effects/SkDropShadowImageFilter.h ('k') | src/effects/SkDropShadowImageFilter.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 "SampleCode.h" 7 #include "SampleCode.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 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 make_scalar(true), make_scalar(true), R(10.0f), make_scalar()) : 676 make_scalar(true), make_scalar(true), R(10.0f), make_scalar()) :
677 SkPerlinNoiseShader::MakeTurbulence( 677 SkPerlinNoiseShader::MakeTurbulence(
678 make_scalar(true), make_scalar(true), R(10.0f), make_scalar())); 678 make_scalar(true), make_scalar(true), R(10.0f), make_scalar()));
679 SkPaint paint; 679 SkPaint paint;
680 paint.setShader(shader); 680 paint.setShader(shader);
681 SkImageFilter::CropRect cropR(SkRect::MakeWH(SkIntToScalar(kBitmapSize), 681 SkImageFilter::CropRect cropR(SkRect::MakeWH(SkIntToScalar(kBitmapSize),
682 SkIntToScalar(kBitmapSize)) ); 682 SkIntToScalar(kBitmapSize)) );
683 filter = SkPaintImageFilter::Make(paint, &cropR); 683 filter = SkPaintImageFilter::Make(paint, &cropR);
684 break; 684 break;
685 } 685 }
686 case DROP_SHADOW: { 686 case DROP_SHADOW:
687 sk_sp<SkImageFilter> subFilter(make_image_filter()); 687 filter = SkDropShadowImageFilter::Make(make_scalar(),
688 688 make_scalar(),
689 filter = sk_sp<SkImageFilter>(SkDropShadowImageFilter::Create(make_scala r(), 689 make_scalar(true),
690 make_scala r(), 690 make_scalar(true),
691 make_scala r(true), 691 make_color(),
692 make_scala r(true), 692 make_shadow_mode(),
693 make_color (), 693 make_image_filter(),
694 make_shado w_mode(), 694 nullptr);
695 subFilter. get(),
696 nullptr));
697 break; 695 break;
698 }
699 case MORPHOLOGY: 696 case MORPHOLOGY:
700 if (R(2) == 1) { 697 if (R(2) == 1) {
701 filter = SkDilateImageFilter::Make(R(static_cast<float>(kBitmapSize) ), 698 filter = SkDilateImageFilter::Make(R(static_cast<float>(kBitmapSize) ),
702 R(static_cast<float>(kBitmapSize) ), 699 R(static_cast<float>(kBitmapSize) ),
703 make_image_filter()); 700 make_image_filter());
704 } else { 701 } else {
705 filter = SkErodeImageFilter::Make(R(static_cast<float>(kBitmapSize)) , 702 filter = SkErodeImageFilter::Make(R(static_cast<float>(kBitmapSize)) ,
706 R(static_cast<float>(kBitmapSize)) , 703 R(static_cast<float>(kBitmapSize)) ,
707 make_image_filter()); 704 make_image_filter());
708 } 705 }
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 } 847 }
851 848
852 private: 849 private:
853 typedef SkView INHERITED; 850 typedef SkView INHERITED;
854 }; 851 };
855 852
856 ////////////////////////////////////////////////////////////////////////////// 853 //////////////////////////////////////////////////////////////////////////////
857 854
858 static SkView* MyFactory() { return new ImageFilterFuzzView; } 855 static SkView* MyFactory() { return new ImageFilterFuzzView; }
859 static SkViewRegister reg(MyFactory); 856 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « include/effects/SkDropShadowImageFilter.h ('k') | src/effects/SkDropShadowImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698