Remove maxCount resource cache limit
Change-Id: I0f1064c8433d69e24ca3d5b970c99d539dc1dadd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238442
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 4e927fc..78e302f 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -298,20 +298,29 @@
//////////////////////////////////////////////////////////////////////////////
-// DDL TODO: remove 'maxResources'
void GrContext::getResourceCacheLimits(int* maxResources, size_t* maxResourceBytes) const {
ASSERT_SINGLE_OWNER
if (maxResources) {
- *maxResources = fResourceCache->getMaxResourceCount();
+ *maxResources = -1;
}
if (maxResourceBytes) {
- *maxResourceBytes = fResourceCache->getMaxResourceBytes();
+ *maxResourceBytes = this->getResourceCacheLimit();
}
}
-void GrContext::setResourceCacheLimits(int maxResources, size_t maxResourceBytes) {
+size_t GrContext::getResourceCacheLimit() const {
ASSERT_SINGLE_OWNER
- fResourceCache->setLimits(maxResources, maxResourceBytes);
+ return fResourceCache->getMaxResourceBytes();
+}
+
+void GrContext::setResourceCacheLimits(int unused, size_t maxResourceBytes) {
+ ASSERT_SINGLE_OWNER
+ this->setResourceCacheLimit(maxResourceBytes);
+}
+
+void GrContext::setResourceCacheLimit(size_t maxResourceBytes) {
+ ASSERT_SINGLE_OWNER
+ fResourceCache->setLimit(maxResourceBytes);
}
//////////////////////////////////////////////////////////////////////////////