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

Unified Diff: tests/CodexTest.cpp

Issue 1779263003: Make sp variants for SkData (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 | « src/sfnt/SkOTUtils.cpp ('k') | tests/Writer32Test.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/CodexTest.cpp
diff --git a/tests/CodexTest.cpp b/tests/CodexTest.cpp
index 51e41235cbfc47d8df6b43b6978abcc128b49f6c..907fd7db9bb333e4fec829b65c41d3b153c6c922 100644
--- a/tests/CodexTest.cpp
+++ b/tests/CodexTest.cpp
@@ -898,20 +898,21 @@ DEF_TEST(Codec_raw_notseekable, r) {
DEF_TEST(Codec_webp_peek, r) {
const char* path = "baby_tux.webp";
SkString fullPath(GetResourcePath(path));
- SkAutoTUnref<SkData> data(SkData::NewFromFileName(fullPath.c_str()));
+ auto data = SkData::MakeFromFileName(fullPath.c_str());
if (!data) {
SkDebugf("Missing resource '%s'\n", path);
return;
}
// The limit is less than webp needs to peek or read.
- SkAutoTDelete<SkCodec> codec(SkCodec::NewFromStream(new LimitedPeekingMemStream(data, 25)));
+ SkAutoTDelete<SkCodec> codec(SkCodec::NewFromStream(
+ new LimitedPeekingMemStream(data.get(), 25)));
REPORTER_ASSERT(r, codec);
test_info(r, codec.get(), codec->getInfo(), SkCodec::kSuccess, nullptr);
// Similarly, a stream which does not peek should still succeed.
- codec.reset(SkCodec::NewFromStream(new LimitedPeekingMemStream(data, 0)));
+ codec.reset(SkCodec::NewFromStream(new LimitedPeekingMemStream(data.get(), 0)));
REPORTER_ASSERT(r, codec);
test_info(r, codec.get(), codec->getInfo(), SkCodec::kSuccess, nullptr);
@@ -930,12 +931,12 @@ DEF_TEST(Codec_wbmp, r) {
}
// Modify the stream to contain a second byte with some bits set.
- SkAutoTUnref<SkData> data(SkCopyStreamToData(stream));
+ auto data = SkCopyStreamToData(stream);
uint8_t* writeableData = static_cast<uint8_t*>(data->writable_data());
writeableData[1] = static_cast<uint8_t>(~0x9F);
// SkCodec should support this.
- SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(data));
+ SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(data.get()));
REPORTER_ASSERT(r, codec);
if (!codec) {
return;
« no previous file with comments | « src/sfnt/SkOTUtils.cpp ('k') | tests/Writer32Test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698