aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/nanobench.cpp
diff options
context:
space:
mode:
authorGravatar Ben Wagner <bungeman@google.com>2016-11-03 14:40:50 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-03 19:03:40 +0000
commit145dbcd165d9d27298eb8888bc240e2d06a95464 (patch)
tree461ac2a3fe607bdf1d72fd72ae9451a58490a1bc /bench/nanobench.cpp
parentb1c7f88df9ec40b4efb52d314304adfbaf95697c (diff)
Remove SkAutoTDelete.
Replace with std::unique_ptr. Change-Id: I5806cfbb30515fcb20e5e66ce13fb5f3b8728176 Reviewed-on: https://skia-review.googlesource.com/4381 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'bench/nanobench.cpp')
-rw-r--r--bench/nanobench.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index 37e3f060bc..0651302d0b 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -63,7 +63,7 @@
#include "gl/GrGLUtil.h"
using sk_gpu_test::GrContextFactory;
using sk_gpu_test::TestContext;
- SkAutoTDelete<GrContextFactory> gGrFactory;
+ std::unique_ptr<GrContextFactory> gGrFactory;
#endif
struct GrContextOptions;
@@ -481,7 +481,7 @@ void create_configs(SkTArray<Config>* configs) {
SkCommandLineConfigArray array;
ParseConfigs(FLAGS_config, &array);
for (int i = 0; i < array.count(); ++i) {
- create_config(array[i], configs);
+ create_config(array[i].get(), configs);
}
}
@@ -531,7 +531,7 @@ static Target* is_enabled(Benchmark* bench, const Config& config) {
static bool valid_brd_bench(sk_sp<SkData> encoded, SkColorType colorType, uint32_t sampleSize,
uint32_t minOutputSize, int* width, int* height) {
- SkAutoTDelete<SkBitmapRegionDecoder> brd(
+ std::unique_ptr<SkBitmapRegionDecoder> brd(
SkBitmapRegionDecoder::Create(encoded, SkBitmapRegionDecoder::kAndroidCodec_Strategy));
if (nullptr == brd.get()) {
// This is indicates that subset decoding is not supported for a particular image format.
@@ -683,7 +683,7 @@ public:
}
Benchmark* next() {
- SkAutoTDelete<Benchmark> bench;
+ std::unique_ptr<Benchmark> bench;
do {
bench.reset(this->rawNext());
if (!bench) {
@@ -704,7 +704,7 @@ public:
}
while (fGMs) {
- SkAutoTDelete<skiagm::GM> gm(fGMs->factory()(nullptr));
+ std::unique_ptr<skiagm::GM> gm(fGMs->factory()(nullptr));
fGMs = fGMs->next();
if (gm->runAsBench()) {
fSourceType = "gm";
@@ -816,7 +816,7 @@ public:
continue;
}
sk_sp<SkData> encoded(SkData::MakeFromFileName(path.c_str()));
- SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded));
+ std::unique_ptr<SkCodec> codec(SkCodec::NewFromData(encoded));
if (!codec) {
// Nothing to time.
SkDebugf("Cannot find codec for %s\n", path.c_str());
@@ -900,7 +900,7 @@ public:
continue;
}
sk_sp<SkData> encoded(SkData::MakeFromFileName(path.c_str()));
- SkAutoTDelete<SkAndroidCodec> codec(SkAndroidCodec::NewFromData(encoded));
+ std::unique_ptr<SkAndroidCodec> codec(SkAndroidCodec::NewFromData(encoded));
if (!codec) {
// Nothing to time.
SkDebugf("Cannot find codec for %s\n", path.c_str());
@@ -1137,7 +1137,7 @@ int nanobench_main() {
}
}
- SkAutoTDelete<ResultsWriter> log(new ResultsWriter);
+ std::unique_ptr<ResultsWriter> log(new ResultsWriter);
if (!FLAGS_outResultsFile.isEmpty()) {
#if defined(SK_RELEASE)
log.reset(new NanoJSONResultsWriter(FLAGS_outResultsFile[0]));
@@ -1204,7 +1204,7 @@ int nanobench_main() {
int runs = 0;
BenchmarkStream benchStream;
while (Benchmark* b = benchStream.next()) {
- SkAutoTDelete<Benchmark> bench(b);
+ std::unique_ptr<Benchmark> bench(b);
if (SkCommandLineFlags::ShouldSkip(FLAGS_match, bench->getUniqueName())) {
continue;
}
@@ -1249,12 +1249,12 @@ int nanobench_main() {
samples.reset();
auto stop = now_ms() + FLAGS_ms;
do {
- samples.push_back(time(loops, bench, target) / loops);
+ samples.push_back(time(loops, bench.get(), target) / loops);
} while (now_ms() < stop);
} else {
samples.reset(FLAGS_samples);
for (int s = 0; s < FLAGS_samples; s++) {
- samples[s] = time(loops, bench, target) / loops;
+ samples[s] = time(loops, bench.get(), target) / loops;
}
}