Surface resource cache through cmdline flag
This lets us test out the memory-fallback code in the new
ops task reordering pathway on our bots.
Bug: skia:10877
Change-Id: Ic5662ef68e46b144eb2821687390c858d0056ba1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/396157
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
diff --git a/src/gpu/GrDirectContext.cpp b/src/gpu/GrDirectContext.cpp
index 4b0a867..6435e7e 100644
--- a/src/gpu/GrDirectContext.cpp
+++ b/src/gpu/GrDirectContext.cpp
@@ -65,6 +65,11 @@
GrDirectContext::GrDirectContext(GrBackendApi backend, const GrContextOptions& options)
: INHERITED(GrContextThreadSafeProxyPriv::Make(backend, options), false)
, fDirectContextID(DirectContextID::Next()) {
+#if GR_TEST_UTILS
+ if (options.fResourceCacheLimitOverride != -1) {
+ this->setResourceCacheLimit(options.fResourceCacheLimitOverride);
+ }
+#endif
}
GrDirectContext::~GrDirectContext() {