aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrProxyProvider.h
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-01-19 13:22:07 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-19 19:18:16 +0000
commit4d12051d351a0a210d62b2d7fcf2de33c712a468 (patch)
tree19aed5211f837d72d67bb6df56822f3ab2c2d419 /src/gpu/GrProxyProvider.h
parentbd4bfa8a6e91fbc88a7c0121470f359d96dd50ed (diff)
Add explicit abandoned flag to the GrProxyProvider
In the DDL world it is valid for the GrProxyProvider to not have a GrResourceProvider so we need a separate marker for abandonment. Change-Id: Iae18a25226d35e1152a902e17a8091e0058695f3 Reviewed-on: https://skia-review.googlesource.com/97220 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrProxyProvider.h')
-rw-r--r--src/gpu/GrProxyProvider.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gpu/GrProxyProvider.h b/src/gpu/GrProxyProvider.h
index f0b1bbd1ed..8ddd61ce7c 100644
--- a/src/gpu/GrProxyProvider.h
+++ b/src/gpu/GrProxyProvider.h
@@ -183,11 +183,16 @@ public:
void abandon() {
fResourceCache = nullptr;
fResourceProvider = nullptr;
+ fAbandoned = true;
}
bool isAbandoned() const {
- SkASSERT(SkToBool(fResourceCache) == SkToBool(fResourceProvider));
- return !SkToBool(fResourceCache);
+#ifdef SK_DEBUG
+ if (fAbandoned) {
+ SkASSERT(!fResourceCache && !fResourceProvider);
+ }
+#endif
+ return fAbandoned;
}
int numUniqueKeyProxies_TestOnly() const;
@@ -212,6 +217,7 @@ private:
GrResourceProvider* fResourceProvider;
GrResourceCache* fResourceCache;
+ bool fAbandoned;
sk_sp<const GrCaps> fCaps;
// In debug builds we guard against improper thread handling