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

Side by Side Diff: samplecode/SampleFilterFuzz.cpp

Issue 1829303002: move setshader to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: addressing comments from #8 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 | « samplecode/SampleEmboss.cpp ('k') | samplecode/SampleLighting.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 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 filter = (R(2) == 1) ? 641 filter = (R(2) == 1) ?
642 SkLightingImageFilter::CreateSpotLitDiffuse(SkPoint3::Make(0, 0 , 0), 642 SkLightingImageFilter::CreateSpotLitDiffuse(SkPoint3::Make(0, 0 , 0),
643 make_point(), make_scalar(), make_scalar(), make_color(), 643 make_point(), make_scalar(), make_scalar(), make_color(),
644 make_scalar(), make_scalar(), make_image_filter()) : 644 make_scalar(), make_scalar(), make_image_filter()) :
645 SkLightingImageFilter::CreateSpotLitSpecular(SkPoint3::Make(0, 0, 0), 645 SkLightingImageFilter::CreateSpotLitSpecular(SkPoint3::Make(0, 0, 0),
646 make_point(), make_scalar(), make_scalar(), make_color(), 646 make_point(), make_scalar(), make_scalar(), make_color(),
647 make_scalar(), make_scalar(), SkIntToScalar(R(10)), make_image_ filter()); 647 make_scalar(), make_scalar(), SkIntToScalar(R(10)), make_image_ filter());
648 break; 648 break;
649 case NOISE: 649 case NOISE:
650 { 650 {
651 SkAutoTUnref<SkShader> shader((R(2) == 1) ? 651 sk_sp<SkShader> shader((R(2) == 1) ?
652 SkPerlinNoiseShader::CreateFractalNoise( 652 SkPerlinNoiseShader::MakeFractalNoise(
653 make_scalar(true), make_scalar(true), R(10.0f), make_scalar()) : 653 make_scalar(true), make_scalar(true), R(10.0f), make_scalar()) :
654 SkPerlinNoiseShader::CreateTurbulence( 654 SkPerlinNoiseShader::MakeTurbulence(
655 make_scalar(true), make_scalar(true), R(10.0f), make_scalar())); 655 make_scalar(true), make_scalar(true), R(10.0f), make_scalar()));
656 SkPaint paint; 656 SkPaint paint;
657 paint.setShader(shader); 657 paint.setShader(shader);
658 SkImageFilter::CropRect cropR(SkRect::MakeWH(SkIntToScalar(kBitmapSize), 658 SkImageFilter::CropRect cropR(SkRect::MakeWH(SkIntToScalar(kBitmapSize),
659 SkIntToScalar(kBitmapSize)) ); 659 SkIntToScalar(kBitmapSize)) );
660 filter = SkPaintImageFilter::Create(paint, &cropR); 660 filter = SkPaintImageFilter::Create(paint, &cropR);
661 } 661 }
662 break; 662 break;
663 case DROP_SHADOW: 663 case DROP_SHADOW:
664 filter = SkDropShadowImageFilter::Create(make_scalar(), make_scalar(), m ake_scalar(true), 664 filter = SkDropShadowImageFilter::Create(make_scalar(), make_scalar(), m ake_scalar(true),
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 } 805 }
806 806
807 private: 807 private:
808 typedef SkView INHERITED; 808 typedef SkView INHERITED;
809 }; 809 };
810 810
811 ////////////////////////////////////////////////////////////////////////////// 811 //////////////////////////////////////////////////////////////////////////////
812 812
813 static SkView* MyFactory() { return new ImageFilterFuzzView; } 813 static SkView* MyFactory() { return new ImageFilterFuzzView; }
814 static SkViewRegister reg(MyFactory); 814 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleEmboss.cpp ('k') | samplecode/SampleLighting.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698