aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench
diff options
context:
space:
mode:
authorGravatar Hal Canary <halcanary@google.com>2016-11-04 13:02:54 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-07 15:17:32 +0000
commit2db83612576d64935bd88747cf9855e79cad70d4 (patch)
tree2e9cbd612abc2a52dc1bb8c594d328ddee2b93fa /bench
parent12313f072b3563d652a789e28140f70b48e57e03 (diff)
bench, samples, etc: s/SkAutoTUnref/sk_sp/
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4437 Change-Id: Ice071684ac8a99e4bb405b4b9be8e8f42c7bac42 Reviewed-on: https://skia-review.googlesource.com/4437 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'bench')
-rw-r--r--bench/GrResourceCacheBench.cpp6
-rw-r--r--bench/SKPAnimationBench.h8
-rw-r--r--bench/SKPBench.cpp8
-rw-r--r--bench/SKPBench.h4
-rw-r--r--bench/nanobench.cpp4
5 files changed, 15 insertions, 15 deletions
diff --git a/bench/GrResourceCacheBench.cpp b/bench/GrResourceCacheBench.cpp
index 295a5bcec1..903c773f33 100644
--- a/bench/GrResourceCacheBench.cpp
+++ b/bench/GrResourceCacheBench.cpp
@@ -69,7 +69,7 @@ protected:
}
void onDraw(int loops, SkCanvas* canvas) override {
- SkAutoTUnref<GrContext> context(GrContext::CreateMockContext());
+ sk_sp<GrContext> context(GrContext::CreateMockContext());
if (nullptr == context) {
return;
}
@@ -143,14 +143,14 @@ protected:
for (int k = 0; k < CACHE_SIZE_COUNT; ++k) {
GrUniqueKey key;
BenchResource::ComputeKey(k, fKeyData32Count, &key);
- SkAutoTUnref<GrGpuResource> resource(cache->findAndRefUniqueResource(key));
+ sk_sp<GrGpuResource> resource(cache->findAndRefUniqueResource(key));
SkASSERT(resource);
}
}
}
private:
- SkAutoTUnref<GrContext> fContext;
+ sk_sp<GrContext> fContext;
SkString fFullName;
int fKeyData32Count;
typedef Benchmark INHERITED;
diff --git a/bench/SKPAnimationBench.h b/bench/SKPAnimationBench.h
index c0bef308ec..7701595691 100644
--- a/bench/SKPAnimationBench.h
+++ b/bench/SKPAnimationBench.h
@@ -40,10 +40,10 @@ protected:
void drawPicture() override;
private:
- SkAutoTUnref<Animation> fAnimation;
- WallTimer fAnimationTimer;
- SkString fUniqueName;
- SkIRect fDevBounds;
+ sk_sp<Animation> fAnimation;
+ WallTimer fAnimationTimer;
+ SkString fUniqueName;
+ SkIRect fDevBounds;
typedef SKPBench INHERITED;
};
diff --git a/bench/SKPBench.cpp b/bench/SKPBench.cpp
index add415dcb8..7d92c9e738 100644
--- a/bench/SKPBench.cpp
+++ b/bench/SKPBench.cpp
@@ -135,7 +135,7 @@ void SKPBench::drawMPDPicture() {
SkMatrix trans;
trans.setTranslate(-fTileRects[j].fLeft/fScale,
-fTileRects[j].fTop/fScale);
- mpd.add(fSurfaces[j]->getCanvas(), fPic, &trans);
+ mpd.add(fSurfaces[j]->getCanvas(), fPic.get(), &trans);
}
mpd.draw();
@@ -149,7 +149,7 @@ void SKPBench::drawPicture() {
for (int j = 0; j < fTileRects.count(); ++j) {
const SkMatrix trans = SkMatrix::MakeTrans(-fTileRects[j].fLeft / fScale,
-fTileRects[j].fTop / fScale);
- fSurfaces[j]->getCanvas()->drawPicture(fPic, &trans, nullptr);
+ fSurfaces[j]->getCanvas()->drawPicture(fPic.get(), &trans, nullptr);
}
for (int j = 0; j < fTileRects.count(); ++j) {
@@ -190,10 +190,10 @@ void SKPBench::getGpuStats(SkCanvas* canvas, SkTArray<SkString>* keys, SkTArray<
context->freeGpuResources();
context->resetContext();
context->getGpu()->resetShaderCacheForTesting();
- draw_pic_for_stats(canvas, context, fPic, keys, values, "first_frame");
+ draw_pic_for_stats(canvas, context, fPic.get(), keys, values, "first_frame");
// draw second frame
- draw_pic_for_stats(canvas, context, fPic, keys, values, "second_frame");
+ draw_pic_for_stats(canvas, context, fPic.get(), keys, values, "second_frame");
#endif
}
diff --git a/bench/SKPBench.h b/bench/SKPBench.h
index 1f34a003b2..2874bff8b0 100644
--- a/bench/SKPBench.h
+++ b/bench/SKPBench.h
@@ -42,12 +42,12 @@ protected:
virtual void drawMPDPicture();
virtual void drawPicture();
- const SkPicture* picture() const { return fPic; }
+ const SkPicture* picture() const { return fPic.get(); }
const SkTDArray<SkSurface*>& surfaces() const { return fSurfaces; }
const SkTDArray<SkIRect>& tileRects() const { return fTileRects; }
private:
- SkAutoTUnref<const SkPicture> fPic;
+ sk_sp<const SkPicture> fPic;
const SkIRect fClip;
const SkScalar fScale;
SkString fName;
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index 0651302d0b..25e04bf77d 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -801,9 +801,9 @@ public:
fCurrentAnimSKP++;
SkString name = SkOSPath::Basename(path.c_str());
- SkAutoTUnref<SKPAnimationBench::Animation> animation(
+ sk_sp<SKPAnimationBench::Animation> animation(
SKPAnimationBench::CreateZoomAnimation(fZoomMax, fZoomPeriodMs));
- return new SKPAnimationBench(name.c_str(), pic.get(), fClip, animation,
+ return new SKPAnimationBench(name.c_str(), pic.get(), fClip, animation.get(),
FLAGS_loopSKP);
}
}