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

Unified Diff: tests/ResourceCacheTest.cpp

Issue 275563005: cleanup GrContext resource cache api (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix use of SK_ATTR_DEPRECATED Created 6 years, 7 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 | « src/gpu/SkGpuDevice.cpp ('k') | tests/SurfaceTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ResourceCacheTest.cpp
diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp
index f6c8b1da1a1c9033d2419edf6d3609f0007595b7..78c11243de08de8c8e745fdc87761e76e74e4727 100644
--- a/tests/ResourceCacheTest.cpp
+++ b/tests/ResourceCacheTest.cpp
@@ -26,16 +26,17 @@ static void test_cache(skiatest::Reporter* reporter,
src.eraseColor(SK_ColorBLACK);
size_t srcSize = src.getSize();
- size_t initialCacheSize = context->getGpuTextureCacheBytes();
+ size_t initialCacheSize;
+ context->getResourceCacheUsage(NULL, &initialCacheSize);
int oldMaxNum;
size_t oldMaxBytes;
- context->getTextureCacheLimits(&oldMaxNum, &oldMaxBytes);
+ context->getResourceCacheLimits(&oldMaxNum, &oldMaxBytes);
// Set the cache limits so we can fit 10 "src" images and the
// max number of textures doesn't matter
size_t maxCacheSize = initialCacheSize + 10*srcSize;
- context->setTextureCacheLimits(1000, maxCacheSize);
+ context->setResourceCacheLimits(1000, maxCacheSize);
SkBitmap readback;
readback.allocN32Pixels(size.width(), size.height());
@@ -47,13 +48,14 @@ static void test_cache(skiatest::Reporter* reporter,
// "modify" the src texture
src.notifyPixelsChanged();
- size_t curCacheSize = context->getGpuTextureCacheBytes();
+ size_t curCacheSize;
+ context->getResourceCacheUsage(NULL, &curCacheSize);
// we should never go over the size limit
REPORTER_ASSERT(reporter, curCacheSize <= maxCacheSize);
}
- context->setTextureCacheLimits(oldMaxNum, oldMaxBytes);
+ context->setResourceCacheLimits(oldMaxNum, oldMaxBytes);
}
class TestResource : public GrCacheable {
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | tests/SurfaceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698