diff options
author | 2016-11-03 14:40:50 -0400 | |
---|---|---|
committer | 2016-11-03 19:03:40 +0000 | |
commit | 145dbcd165d9d27298eb8888bc240e2d06a95464 (patch) | |
tree | 461ac2a3fe607bdf1d72fd72ae9451a58490a1bc /tests/CodecPartialTest.cpp | |
parent | b1c7f88df9ec40b4efb52d314304adfbaf95697c (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 'tests/CodecPartialTest.cpp')
-rw-r--r-- | tests/CodecPartialTest.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/CodecPartialTest.cpp b/tests/CodecPartialTest.cpp index 22d4e7b594..ba1a51f4ef 100644 --- a/tests/CodecPartialTest.cpp +++ b/tests/CodecPartialTest.cpp @@ -28,12 +28,12 @@ static SkImageInfo standardize_info(SkCodec* codec) { } static bool create_truth(sk_sp<SkData> data, SkBitmap* dst) { - SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(std::move(data))); + std::unique_ptr<SkCodec> codec(SkCodec::NewFromData(std::move(data))); if (!codec) { return false; } - const SkImageInfo info = standardize_info(codec); + const SkImageInfo info = standardize_info(codec.get()); dst->allocPixels(info); return SkCodec::kSuccess == codec->getPixels(info, dst->getPixels(), dst->rowBytes()); } @@ -108,7 +108,7 @@ static void test_partial(skiatest::Reporter* r, const char* name) { // Note that we cheat and hold on to a pointer to stream, though it is owned by // partialCodec. - SkAutoTDelete<SkCodec> partialCodec(SkCodec::NewFromStream(stream)); + std::unique_ptr<SkCodec> partialCodec(SkCodec::NewFromStream(stream)); if (!partialCodec) { // Technically, this could be a small file where half the file is not // enough. @@ -116,7 +116,7 @@ static void test_partial(skiatest::Reporter* r, const char* name) { return; } - const SkImageInfo info = standardize_info(partialCodec); + const SkImageInfo info = standardize_info(partialCodec.get()); SkASSERT(info == truth.info()); SkBitmap incremental; incremental.allocPixels(info); @@ -284,14 +284,14 @@ static void test_interleaved(skiatest::Reporter* r, const char* name) { return; } const size_t halfSize = file->size() / 2; - SkAutoTDelete<SkCodec> partialCodec(SkCodec::NewFromStream( + std::unique_ptr<SkCodec> partialCodec(SkCodec::NewFromStream( new HaltingStream(std::move(file), halfSize))); if (!partialCodec) { ERRORF(r, "Failed to create codec for %s", name); return; } - const SkImageInfo info = standardize_info(partialCodec); + const SkImageInfo info = standardize_info(partialCodec.get()); SkBitmap incremental; incremental.allocPixels(info); |