Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Unified Diff: tests/ImageCacheTest.cpp

Issue 223403012: SkDiscardableMemoryPool to abstract class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: AnotherPatchSet Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/DrawBitmapRectTest.cpp ('k') | tools/bench_pictures_main.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ImageCacheTest.cpp
diff --git a/tests/ImageCacheTest.cpp b/tests/ImageCacheTest.cpp
index 43a5e70f23b605f47eef44404f81396615b69474..92d0b519d0dc3e367161f151e7f5c3508b7dbe09 100644
--- a/tests/ImageCacheTest.cpp
+++ b/tests/ImageCacheTest.cpp
@@ -81,6 +81,7 @@ static void test_cache(skiatest::Reporter* reporter, SkScaledImageCache& cache,
static SkDiscardableMemoryPool* gPool;
static SkDiscardableMemory* pool_factory(size_t bytes) {
+ SkASSERT(gPool);
return gPool->create(bytes);
}
@@ -92,8 +93,9 @@ DEF_TEST(ImageCache, reporter) {
test_cache(reporter, cache, true);
}
{
- SkDiscardableMemoryPool pool(defLimit);
- gPool = &pool;
+ SkAutoTUnref<SkDiscardableMemoryPool> pool(
+ SkDiscardableMemoryPool::Create(defLimit, NULL));
+ gPool = pool.get();
SkScaledImageCache cache(pool_factory);
test_cache(reporter, cache, true);
}
« no previous file with comments | « tests/DrawBitmapRectTest.cpp ('k') | tools/bench_pictures_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698