aboutsummaryrefslogtreecommitdiff
path: root/tests/MallocPixelRefTest.cpp
diff options
context:
space:
mode:
authorHal Canary <halcanary@google.com>2016-11-04 11:49:42 -0400
committerSkia Commit-Bot <skia-commit-bot@chromium.org>2016-11-04 16:55:38 +0000
commit342b7acc46550af5fbefc6f9313231ede11ed692 (patch)
tree1077b67b06a35c49e93fd9a210204c597a6239df /tests/MallocPixelRefTest.cpp
parentd49128ab8ec6b3aadeb650074ddd8ddbdcce15eb (diff)
downloadskia-342b7acc46550af5fbefc6f9313231ede11ed692.tar.gz
tests: s/SkAutoTUnref/sk_sp/
BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4394 Change-Id: I088b3c6e2adff07abed1e8a50091cc0ec4a4109c Reviewed-on: https://skia-review.googlesource.com/4394 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'tests/MallocPixelRefTest.cpp')
-rw-r--r--tests/MallocPixelRefTest.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/MallocPixelRefTest.cpp b/tests/MallocPixelRefTest.cpp
index adc69148b0..09e1b934e9 100644
--- a/tests/MallocPixelRefTest.cpp
+++ b/tests/MallocPixelRefTest.cpp
@@ -24,7 +24,7 @@ DEF_TEST(MallocPixelRef, reporter) {
REPORTER_ASSERT(reporter, true);
SkImageInfo info = SkImageInfo::MakeN32Premul(10, 13);
{
- SkAutoTUnref<SkMallocPixelRef> pr(
+ sk_sp<SkMallocPixelRef> pr(
SkMallocPixelRef::NewAllocate(info, info.minRowBytes() - 1, nullptr));
// rowbytes too small.
REPORTER_ASSERT(reporter, nullptr == pr.get());
@@ -33,7 +33,7 @@ DEF_TEST(MallocPixelRef, reporter) {
size_t rowBytes = info.minRowBytes() - 1;
size_t size = info.getSafeSize(rowBytes);
sk_sp<SkData> data(SkData::MakeUninitialized(size));
- SkAutoTUnref<SkMallocPixelRef> pr(
+ sk_sp<SkMallocPixelRef> pr(
SkMallocPixelRef::NewWithData(info, rowBytes, nullptr, data.get()));
// rowbytes too small.
REPORTER_ASSERT(reporter, nullptr == pr.get());
@@ -42,7 +42,7 @@ DEF_TEST(MallocPixelRef, reporter) {
size_t rowBytes = info.minRowBytes() + 2;
size_t size = info.getSafeSize(rowBytes) - 1;
sk_sp<SkData> data(SkData::MakeUninitialized(size));
- SkAutoTUnref<SkMallocPixelRef> pr(
+ sk_sp<SkMallocPixelRef> pr(
SkMallocPixelRef::NewWithData(info, rowBytes, nullptr, data.get()));
// data too small.
REPORTER_ASSERT(reporter, nullptr == pr.get());
@@ -51,20 +51,20 @@ DEF_TEST(MallocPixelRef, reporter) {
size_t size = info.getSafeSize(rowBytes) + 9;
{
SkAutoMalloc memory(size);
- SkAutoTUnref<SkMallocPixelRef> pr(
+ sk_sp<SkMallocPixelRef> pr(
SkMallocPixelRef::NewDirect(info, memory.get(), rowBytes, nullptr));
REPORTER_ASSERT(reporter, pr.get() != nullptr);
REPORTER_ASSERT(reporter, memory.get() == pr->pixels());
}
{
- SkAutoTUnref<SkMallocPixelRef> pr(
+ sk_sp<SkMallocPixelRef> pr(
SkMallocPixelRef::NewAllocate(info, rowBytes, nullptr));
REPORTER_ASSERT(reporter, pr.get() != nullptr);
REPORTER_ASSERT(reporter, pr->pixels());
}
{
void* addr = static_cast<void*>(new uint8_t[size]);
- SkAutoTUnref<SkMallocPixelRef> pr(
+ sk_sp<SkMallocPixelRef> pr(
SkMallocPixelRef::NewWithProc(info, rowBytes, nullptr, addr,
delete_uint8_proc, nullptr));
REPORTER_ASSERT(reporter, pr.get() != nullptr);
@@ -73,7 +73,7 @@ DEF_TEST(MallocPixelRef, reporter) {
{
int x = 0;
SkAutoMalloc memory(size);
- SkAutoTUnref<SkMallocPixelRef> pr(
+ sk_sp<SkMallocPixelRef> pr(
SkMallocPixelRef::NewWithProc(info, rowBytes, nullptr,
memory.get(), set_to_one_proc,
static_cast<void*>(&x)));
@@ -87,7 +87,7 @@ DEF_TEST(MallocPixelRef, reporter) {
{
void* addr = static_cast<void*>(new uint8_t[size]);
REPORTER_ASSERT(reporter, addr != nullptr);
- SkAutoTUnref<SkMallocPixelRef> pr(
+ sk_sp<SkMallocPixelRef> pr(
SkMallocPixelRef::NewWithProc(info, rowBytes, nullptr, addr,
delete_uint8_proc, nullptr));
REPORTER_ASSERT(reporter, addr == pr->pixels());
@@ -96,7 +96,7 @@ DEF_TEST(MallocPixelRef, reporter) {
sk_sp<SkData> data(SkData::MakeUninitialized(size));
SkData* dataPtr = data.get();
REPORTER_ASSERT(reporter, dataPtr->unique());
- SkAutoTUnref<SkMallocPixelRef> pr(
+ sk_sp<SkMallocPixelRef> pr(
SkMallocPixelRef::NewWithData(info, rowBytes, nullptr, data.get()));
REPORTER_ASSERT(reporter, !(dataPtr->unique()));
data.reset(nullptr);