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

Unified Diff: samplecode/SampleFilterFuzz.cpp

Issue 1817543002: Revert of switch patheffects over to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samplecode/SampleAll.cpp ('k') | samplecode/SamplePath.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleFilterFuzz.cpp
diff --git a/samplecode/SampleFilterFuzz.cpp b/samplecode/SampleFilterFuzz.cpp
index fe2fb0b2ffa04019fff7ba688abce1709dac78ba..0dd01e95b2f25250bb2f5f8c0e5cbbdc8e979474 100644
--- a/samplecode/SampleFilterFuzz.cpp
+++ b/samplecode/SampleFilterFuzz.cpp
@@ -422,20 +422,22 @@
return path;
}
-static sk_sp<SkPathEffect> make_path_effect(bool canBeNull = true) {
- sk_sp<SkPathEffect> pathEffect;
+static SkPathEffect* make_path_effect(bool canBeNull = true) {
+ SkPathEffect* pathEffect = nullptr;
if (canBeNull && (R(3) == 1)) { return pathEffect; }
switch (R(9)) {
case 0:
- pathEffect = SkArcToPathEffect::Make(make_scalar(true));
- break;
- case 1:
- pathEffect = SkComposePathEffect::Make(make_path_effect(false),
- make_path_effect(false));
- break;
+ pathEffect = SkArcToPathEffect::Create(make_scalar(true));
+ break;
+ case 1: {
+ SkAutoTUnref<SkPathEffect> outer(make_path_effect(false));
+ SkAutoTUnref<SkPathEffect> inner(make_path_effect(false));
+ pathEffect = SkComposePathEffect::Create(outer, inner);
+ break;
+ }
case 2:
- pathEffect = SkCornerPathEffect::Make(make_scalar());
+ pathEffect = SkCornerPathEffect::Create(make_scalar());
break;
case 3: {
int count = R(10);
@@ -443,26 +445,28 @@
for (int i = 0; i < count; ++i) {
intervals[i] = make_scalar();
}
- pathEffect = SkDashPathEffect::Make(intervals, count, make_scalar());
+ pathEffect = SkDashPathEffect::Create(intervals, count, make_scalar());
break;
}
case 4:
- pathEffect = SkDiscretePathEffect::Make(make_scalar(), make_scalar());
+ pathEffect = SkDiscretePathEffect::Create(make_scalar(), make_scalar());
break;
case 5:
- pathEffect = SkPath1DPathEffect::Make(make_path(), make_scalar(), make_scalar(),
- make_path_1d_path_effect_style());
+ pathEffect = SkPath1DPathEffect::Create(make_path(),
+ make_scalar(),
+ make_scalar(),
+ make_path_1d_path_effect_style());
break;
case 6:
- pathEffect = SkLine2DPathEffect::Make(make_scalar(), make_matrix());
+ pathEffect = SkLine2DPathEffect::Create(make_scalar(), make_matrix());
break;
case 7:
- pathEffect = SkPath2DPathEffect::Make(make_matrix(), make_path());
+ pathEffect = SkPath2DPathEffect::Create(make_matrix(), make_path());
break;
case 8:
default:
- pathEffect = SkSumPathEffect::Make(make_path_effect(false),
- make_path_effect(false));
+ pathEffect = SkSumPathEffect::Create(make_path_effect(false),
+ make_path_effect(false));
break;
}
return pathEffect;
« no previous file with comments | « samplecode/SampleAll.cpp ('k') | samplecode/SamplePath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698