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

Unified Diff: bench/DashBench.cpp

Issue 1813123003: Reland of "switch patheffects over to sk_sp (patchset #5 id:80001 of https://codereview.chromium.or… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: move flag into sktypes, so it is visible to both paint and other patheffect clients 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 e3d8364013a7c1a2da09bd3a8ce3cf43e9dc9679..43db54c0928ca4a0fe1952fbdf83d5b499551fe3 100644
--- a/bench/DashBench.cpp
+++ b/bench/DashBench.cpp
@@ -72,9 +72,7 @@ protected:
SkPath path;
this->makePath(&path);
- SkAutoTUnref<SkPathEffect> effect(SkDashPathEffect::Create(fIntervals.begin(),
- fIntervals.count(), 0));
- paint.setPathEffect(effect);
+ paint.setPathEffect(SkDashPathEffect::Make(fIntervals.begin(), fIntervals.count(), 0));
if (fDoClip) {
SkRect r = path.getBounds();
@@ -179,7 +177,7 @@ static void make_cubic(SkPath* path) {
class MakeDashBench : public Benchmark {
SkString fName;
SkPath fPath;
- SkAutoTUnref<SkPathEffect> fPE;
+ sk_sp<SkPathEffect> fPE;
public:
MakeDashBench(void (*proc)(SkPath*), const char name[]) {
@@ -187,7 +185,7 @@ public:
proc(&fPath);
SkScalar vals[] = { SkIntToScalar(4), SkIntToScalar(4) };
- fPE.reset(SkDashPathEffect::Create(vals, 2, 0));
+ fPE = SkDashPathEffect::Make(vals, 2, 0);
}
protected:
@@ -216,7 +214,7 @@ class DashLineBench : public Benchmark {
SkString fName;
SkScalar fStrokeWidth;
bool fIsRound;
- SkAutoTUnref<SkPathEffect> fPE;
+ sk_sp<SkPathEffect> fPE;
public:
DashLineBench(SkScalar width, bool isRound) {
@@ -225,7 +223,7 @@ public:
fIsRound = isRound;
SkScalar vals[] = { SK_Scalar1, SK_Scalar1 };
- fPE.reset(SkDashPathEffect::Create(vals, 2, 0));
+ fPE = SkDashPathEffect::Make(vals, 2, 0);
}
protected:
@@ -254,7 +252,7 @@ class DrawPointsDashingBench : public Benchmark {
int fStrokeWidth;
bool fDoAA;
- SkAutoTUnref<SkPathEffect> fPathEffect;
+ sk_sp<SkPathEffect> fPathEffect;
public:
DrawPointsDashingBench(int dashLength, int strokeWidth, bool doAA)
@@ -264,7 +262,7 @@ public:
fDoAA = doAA;
SkScalar vals[] = { SkIntToScalar(dashLength), SkIntToScalar(dashLength) };
- fPathEffect.reset(SkDashPathEffect::Create(vals, 2, SK_Scalar1));
+ fPathEffect = SkDashPathEffect::Make(vals, 2, SK_Scalar1);
}
protected:
@@ -301,7 +299,7 @@ class GiantDashBench : public Benchmark {
SkString fName;
SkScalar fStrokeWidth;
SkPoint fPts[2];
- SkAutoTUnref<SkPathEffect> fPathEffect;
+ sk_sp<SkPathEffect> fPathEffect;
public:
enum LineType {
@@ -324,8 +322,7 @@ public:
// 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.reset(SkDashPathEffect::Create(intervals,
- SK_ARRAY_COUNT(intervals), 0));
+ fPathEffect = SkDashPathEffect::Make(intervals, SK_ARRAY_COUNT(intervals), 0);
SkScalar cx = 640 / 2; // center X
SkScalar cy = 480 / 2; // center Y
@@ -381,7 +378,7 @@ class DashGridBench : public Benchmark {
int fStrokeWidth;
bool fDoAA;
- SkAutoTUnref<SkPathEffect> fPathEffect;
+ sk_sp<SkPathEffect> fPathEffect;
public:
DashGridBench(int dashLength, int strokeWidth, bool doAA) {
@@ -390,7 +387,7 @@ public:
fDoAA = doAA;
SkScalar vals[] = { SkIntToScalar(dashLength), SkIntToScalar(dashLength) };
- fPathEffect.reset(SkDashPathEffect::Create(vals, 2, SK_Scalar1));
+ fPathEffect = SkDashPathEffect::Make(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