diff options
author | 2013-01-24 14:46:47 +0000 | |
---|---|---|
committer | 2013-01-24 14:46:47 +0000 | |
commit | 95ed55adc6b8f0cee063c2cf2e14782773b0087f (patch) | |
tree | 0ff40233b89b318ba9eb573cc90dbf3e43c71da7 /tests | |
parent | baa0220dfddda3cd44f0ffb5f95a4a60443eb8c3 (diff) |
Make all GrContext members that return a texture also ref the texture for the caller.
Review URL: https://codereview.appspot.com/7198049
git-svn-id: http://skia.googlecode.com/svn/trunk@7362 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ClipCacheTest.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/ClipCacheTest.cpp b/tests/ClipCacheTest.cpp index 1aeebb80dc..c80ba631da 100644 --- a/tests/ClipCacheTest.cpp +++ b/tests/ClipCacheTest.cpp @@ -155,14 +155,14 @@ static void test_cache(skiatest::Reporter* reporter, GrContext* context) { // check that the set took check_state(reporter, cache, clip1, texture1, bound1); - REPORTER_ASSERT(reporter, 1 == texture1->getRefCnt()); + REPORTER_ASSERT(reporter, texture1->getRefCnt()); // push the state cache.push(); // verify that the pushed state is initially empty check_state(reporter, cache, emptyClip, NULL, emptyBound); - REPORTER_ASSERT(reporter, 1 == texture1->getRefCnt()); + REPORTER_ASSERT(reporter, texture1->getRefCnt()); // modify the new state GrIRect bound2; @@ -180,8 +180,8 @@ static void test_cache(skiatest::Reporter* reporter, GrContext* context) { // check that the changes took check_state(reporter, cache, clip2, texture2, bound2); - REPORTER_ASSERT(reporter, 1 == texture1->getRefCnt()); - REPORTER_ASSERT(reporter, 1 == texture2->getRefCnt()); + REPORTER_ASSERT(reporter, texture1->getRefCnt()); + REPORTER_ASSERT(reporter, texture2->getRefCnt()); // check to make sure canReuse works REPORTER_ASSERT(reporter, cache.canReuse(clip2.getTopmostGenID(), bound2)); @@ -192,16 +192,16 @@ static void test_cache(skiatest::Reporter* reporter, GrContext* context) { // verify that the old state is restored check_state(reporter, cache, clip1, texture1, bound1); - REPORTER_ASSERT(reporter, 1 == texture1->getRefCnt()); - REPORTER_ASSERT(reporter, 1 == texture2->getRefCnt()); + REPORTER_ASSERT(reporter, texture1->getRefCnt()); + REPORTER_ASSERT(reporter, texture2->getRefCnt()); // manually clear the state cache.reset(); // verify it is now empty check_state(reporter, cache, emptyClip, NULL, emptyBound); - REPORTER_ASSERT(reporter, 1 == texture1->getRefCnt()); - REPORTER_ASSERT(reporter, 1 == texture2->getRefCnt()); + REPORTER_ASSERT(reporter, texture1->getRefCnt()); + REPORTER_ASSERT(reporter, texture2->getRefCnt()); // pop again - so there is no state cache.pop(); @@ -211,8 +211,8 @@ static void test_cache(skiatest::Reporter* reporter, GrContext* context) { // only do in release since it generates asserts in debug check_state(reporter, cache, emptyClip, NULL, emptyBound); #endif - REPORTER_ASSERT(reporter, 1 == texture1->getRefCnt()); - REPORTER_ASSERT(reporter, 1 == texture2->getRefCnt()); + REPORTER_ASSERT(reporter, texture1->getRefCnt()); + REPORTER_ASSERT(reporter, texture2->getRefCnt()); } //////////////////////////////////////////////////////////////////////////////// |