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

Side by Side Diff: samplecode/SampleFilterFuzz.cpp

Issue 1841233002: Update SkComposeImageFilter to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address code review comments 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/SkComposeImageFilter.h ('k') | src/effects/SkComposeImageFilter.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 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 kernel.begin(), 639 kernel.begin(),
640 make_scalar(), 640 make_scalar(),
641 make_scalar(), 641 make_scalar(),
642 kernelOffset, 642 kernelOffset,
643 (SkMatrixConvolutionImag eFilter::TileMode)R(3), 643 (SkMatrixConvolutionImag eFilter::TileMode)R(3),
644 R(2) == 1, 644 R(2) == 1,
645 subFilter.get(), 645 subFilter.get(),
646 &cropR)); 646 &cropR));
647 break; 647 break;
648 } 648 }
649 case COMPOSE: { 649 case COMPOSE:
650 sk_sp<SkImageFilter> subFilter1(make_image_filter()); 650 filter = SkComposeImageFilter::Make(make_image_filter(), make_image_filt er());
651 sk_sp<SkImageFilter> subFilter2(make_image_filter());
652 filter = sk_sp<SkImageFilter>(SkComposeImageFilter::Create(subFilter1.ge t(),
653 subFilter2.ge t()));
654 break; 651 break;
655 }
656 case DISTANT_LIGHT: { 652 case DISTANT_LIGHT: {
657 sk_sp<SkImageFilter> subFilter(make_image_filter()); 653 sk_sp<SkImageFilter> subFilter(make_image_filter());
658 654
659 filter = (R(2) == 1) 655 filter = (R(2) == 1)
660 ? sk_sp<SkImageFilter>(SkLightingImageFilter::CreateDistantLitD iffuse(make_point(), 656 ? sk_sp<SkImageFilter>(SkLightingImageFilter::CreateDistantLitD iffuse(make_point(),
661 make_color(), make_scalar(), mak e_scalar(), 657 make_color(), make_scalar(), mak e_scalar(),
662 subFilter.get())) 658 subFilter.get()))
663 : sk_sp<SkImageFilter>(SkLightingImageFilter::CreateDistantLitS pecular(make_point(), 659 : sk_sp<SkImageFilter>(SkLightingImageFilter::CreateDistantLitS pecular(make_point(),
664 make_color(), make_scalar(), 660 make_color(), make_scalar(),
665 make_scalar(), SkIntToScalar(R(1 0)), 661 make_scalar(), SkIntToScalar(R(1 0)),
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 } 872 }
877 873
878 private: 874 private:
879 typedef SkView INHERITED; 875 typedef SkView INHERITED;
880 }; 876 };
881 877
882 ////////////////////////////////////////////////////////////////////////////// 878 //////////////////////////////////////////////////////////////////////////////
883 879
884 static SkView* MyFactory() { return new ImageFilterFuzzView; } 880 static SkView* MyFactory() { return new ImageFilterFuzzView; }
885 static SkViewRegister reg(MyFactory); 881 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « include/effects/SkComposeImageFilter.h ('k') | src/effects/SkComposeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698