diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-12-12 22:37:32 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-12-12 22:37:32 +0000 |
commit | 1d0654f69d1d0c3bb565fba018a11c77f25bc55e (patch) | |
tree | 8d4cf489a5756efec4d47ea0e94b3486a7032fc8 /tests | |
parent | 9c5435de44ed491353b41f863c4e176b6e7ddc94 (diff) |
be sure to unlock the discardablememory before deleting it
BUG=
Review URL: https://codereview.chromium.org/114673002
git-svn-id: http://skia.googlecode.com/svn/trunk@12658 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CachedDecodingPixelRefTest.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/CachedDecodingPixelRefTest.cpp b/tests/CachedDecodingPixelRefTest.cpp index f97e89361f..04eddd9070 100644 --- a/tests/CachedDecodingPixelRefTest.cpp +++ b/tests/CachedDecodingPixelRefTest.cpp @@ -268,12 +268,25 @@ void CheckPixelRef(TestImageGenerator::TestType type, } } } // namespace + +// new/lock/delete is an odd pattern for a pixelref, but it needs to not assert +static void test_newlockdelete(skiatest::Reporter* reporter) { + SkBitmap bm; + SkImageGenerator* ig = new TestImageGenerator( + TestImageGenerator::kSucceedGetPixels_TestType, + reporter); + SkInstallDiscardablePixelRef(ig, &bm, NULL); + bm.pixelRef()->lockPixels(); +} + /** * This tests the basic functionality of SkDiscardablePixelRef with a * basic SkImageGenerator implementation and several * SkDiscardableMemory::Factory choices. */ DEF_TEST(DiscardableAndCachingPixelRef, reporter) { + test_newlockdelete(reporter); + CheckPixelRef(TestImageGenerator::kFailGetInfo_TestType, reporter, kSkCaching_PixelRefType, NULL); CheckPixelRef(TestImageGenerator::kFailGetPixels_TestType, |