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

Unified Diff: bench/nanobench.cpp

Issue 2206633004: Move off SK_SUPPORT_LEGACY_DATA_FACTORIES. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Gotta catch 'em all. Created 4 years, 4 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 | dm/DM.cpp » ('j') | include/core/SkData.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/nanobench.cpp
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index 518383b0e01f2d6216b090dab3c6eaae6ad0eaf7..6ff2be4b1b3afc4d5db9bab23521389d9aac9b64 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -754,8 +754,8 @@ public:
if (SkCommandLineFlags::ShouldSkip(FLAGS_match, path.c_str())) {
continue;
}
- SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(path.c_str()));
- SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded));
+ sk_sp<SkData> encoded(SkData::MakeFromFileName(path.c_str()));
+ SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded.get()));
if (!codec) {
// Nothing to time.
SkDebugf("Cannot find codec for %s\n", path.c_str());
@@ -815,7 +815,7 @@ public:
case SkCodec::kSuccess:
case SkCodec::kIncompleteInput:
return new CodecBench(SkOSPath::Basename(path.c_str()),
- encoded, colorType, alphaType);
+ encoded.get(), colorType, alphaType);
case SkCodec::kInvalidConversion:
// This is okay. Not all conversions are valid.
break;
@@ -838,8 +838,8 @@ public:
if (SkCommandLineFlags::ShouldSkip(FLAGS_match, path.c_str())) {
continue;
}
- SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(path.c_str()));
- SkAutoTDelete<SkAndroidCodec> codec(SkAndroidCodec::NewFromData(encoded));
+ sk_sp<SkData> encoded(SkData::MakeFromFileName(path.c_str()));
+ SkAutoTDelete<SkAndroidCodec> codec(SkAndroidCodec::NewFromData(encoded.get()));
if (!codec) {
// Nothing to time.
SkDebugf("Cannot find codec for %s\n", path.c_str());
@@ -854,7 +854,8 @@ public:
break;
}
- return new AndroidCodecBench(SkOSPath::Basename(path.c_str()), encoded, sampleSize);
+ return new AndroidCodecBench(SkOSPath::Basename(path.c_str()),
+ encoded.get(), sampleSize);
}
fCurrentSampleSize = 0;
}
@@ -887,7 +888,7 @@ public:
while (fCurrentSampleSize < (int) SK_ARRAY_COUNT(brdSampleSizes)) {
while (fCurrentSubsetType <= kLastSingle_SubsetType) {
- SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(path.c_str()));
+ sk_sp<SkData> encoded(SkData::MakeFromFileName(path.c_str()));
const SkColorType colorType = fColorTypes[fCurrentColorType];
uint32_t sampleSize = brdSampleSizes[fCurrentSampleSize];
int currentSubsetType = fCurrentSubsetType++;
« no previous file with comments | « no previous file | dm/DM.cpp » ('j') | include/core/SkData.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698