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>
This commit is contained in:
parent
bd4bfa8a6e
commit
4d12051d35
@ -28,6 +28,7 @@ GrProxyProvider::GrProxyProvider(GrResourceProvider* resourceProvider,
|
||||
GrSingleOwner* owner)
|
||||
: fResourceProvider(resourceProvider)
|
||||
, fResourceCache(resourceCache)
|
||||
, fAbandoned(false)
|
||||
, fCaps(caps)
|
||||
#ifdef SK_DEBUG
|
||||
, fSingleOwner(owner)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user