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

Unified Diff: bench/DashBench.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 | « no previous file | gm/arcto.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/DashBench.cpp
diff --git a/bench/DashBench.cpp b/bench/DashBench.cpp
index 43db54c0928ca4a0fe1952fbdf83d5b499551fe3..e3d8364013a7c1a2da09bd3a8ce3cf43e9dc9679 100644
--- a/bench/DashBench.cpp
+++ b/bench/DashBench.cpp
@@ -72,7 +72,9 @@
SkPath path;
this->makePath(&path);
- paint.setPathEffect(SkDashPathEffect::Make(fIntervals.begin(), fIntervals.count(), 0));
+ SkAutoTUnref<SkPathEffect> effect(SkDashPathEffect::Create(fIntervals.begin(),
+ fIntervals.count(), 0));
+ paint.setPathEffect(effect);
if (fDoClip) {
SkRect r = path.getBounds();
@@ -177,7 +179,7 @@
class MakeDashBench : public Benchmark {
SkString fName;
SkPath fPath;
- sk_sp<SkPathEffect> fPE;
+ SkAutoTUnref<SkPathEffect> fPE;
public:
MakeDashBench(void (*proc)(SkPath*), const char name[]) {
@@ -185,7 +187,7 @@
proc(&fPath);
SkScalar vals[] = { SkIntToScalar(4), SkIntToScalar(4) };
- fPE = SkDashPathEffect::Make(vals, 2, 0);
+ fPE.reset(SkDashPathEffect::Create(vals, 2, 0));
}
protected:
@@ -214,7 +216,7 @@
SkString fName;
SkScalar fStrokeWidth;
bool fIsRound;
- sk_sp<SkPathEffect> fPE;
+ SkAutoTUnref<SkPathEffect> fPE;
public:
DashLineBench(SkScalar width, bool isRound) {
@@ -223,7 +225,7 @@
fIsRound = isRound;
SkScalar vals[] = { SK_Scalar1, SK_Scalar1 };
- fPE = SkDashPathEffect::Make(vals, 2, 0);
+ fPE.reset(SkDashPathEffect::Create(vals, 2, 0));
}
protected:
@@ -252,7 +254,7 @@
int fStrokeWidth;
bool fDoAA;
- sk_sp<SkPathEffect> fPathEffect;
+ SkAutoTUnref<SkPathEffect> fPathEffect;
public:
DrawPointsDashingBench(int dashLength, int strokeWidth, bool doAA)
@@ -262,7 +264,7 @@
fDoAA = doAA;
SkScalar vals[] = { SkIntToScalar(dashLength), SkIntToScalar(dashLength) };
- fPathEffect = SkDashPathEffect::Make(vals, 2, SK_Scalar1);
+ fPathEffect.reset(SkDashPathEffect::Create(vals, 2, SK_Scalar1));
}
protected:
@@ -299,7 +301,7 @@
SkString fName;
SkScalar fStrokeWidth;
SkPoint fPts[2];
- sk_sp<SkPathEffect> fPathEffect;
+ SkAutoTUnref<SkPathEffect> fPathEffect;
public:
enum LineType {
@@ -322,7 +324,8 @@
// deliberately pick intervals that won't be caught by asPoints(), so
// we can test the filterPath code-path.
const SkScalar intervals[] = { 20, 10, 10, 10 };
- fPathEffect = SkDashPathEffect::Make(intervals, SK_ARRAY_COUNT(intervals), 0);
+ fPathEffect.reset(SkDashPathEffect::Create(intervals,
+ SK_ARRAY_COUNT(intervals), 0));
SkScalar cx = 640 / 2; // center X
SkScalar cy = 480 / 2; // center Y
@@ -378,7 +381,7 @@
int fStrokeWidth;
bool fDoAA;
- sk_sp<SkPathEffect> fPathEffect;
+ SkAutoTUnref<SkPathEffect> fPathEffect;
public:
DashGridBench(int dashLength, int strokeWidth, bool doAA) {
@@ -387,7 +390,7 @@
fDoAA = doAA;
SkScalar vals[] = { SkIntToScalar(dashLength), SkIntToScalar(dashLength) };
- fPathEffect = SkDashPathEffect::Make(vals, 2, SK_Scalar1);
+ fPathEffect.reset(SkDashPathEffect::Create(vals, 2, SK_Scalar1));
}
protected:
« no previous file with comments | « no previous file | gm/arcto.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698