diff options
author | Hal Canary <halcanary@google.com> | 2016-12-12 13:48:12 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-12-12 20:18:50 +0000 |
commit | 1b3387b5cfef150c3237c6a8700b2d6f3730e4ce (patch) | |
tree | 3b0e9690f1346e37631aa687650390d49f5f3c46 /tests/WritePixelsTest.cpp | |
parent | 8615fe59fcc0246a8b0c11b37b3e75f82c9933dd (diff) |
SkBitmap::setPixelRef(): less reference churn
BUG=skia:
Change-Id: I9657e4af5fcc808f9175ff336155374ccc77999d
Reviewed-on: https://skia-review.googlesource.com/5461
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'tests/WritePixelsTest.cpp')
-rw-r--r-- | tests/WritePixelsTest.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/WritePixelsTest.cpp b/tests/WritePixelsTest.cpp index 2937e0ef00..1c5ce81cbf 100644 --- a/tests/WritePixelsTest.cpp +++ b/tests/WritePixelsTest.cpp @@ -263,8 +263,8 @@ static bool alloc_row_bytes(SkBitmap* bm, const SkImageInfo& info, size_t rowByt if (!bm->setInfo(info, rowBytes)) { return false; } - SkPixelRef* pr = SkMallocPixelRef::NewAllocate(info, rowBytes, nullptr); - bm->setPixelRef(pr)->unref(); + sk_sp<SkPixelRef> pr(SkMallocPixelRef::NewAllocate(info, rowBytes, nullptr)); + bm->setPixelRef(std::move(pr), 0, 0); return true; } |