diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-01-23 21:37:01 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-01-23 21:37:01 +0000 |
commit | 838f6e18fb13cd295f2c4d1e673cb03458f4e0a8 (patch) | |
tree | 367463b733117e4f03070295531bc2df0b3d03e6 /src | |
parent | 1f0f1a3b5ef4404da11ccf937ee270ea6ddb41e2 (diff) |
Add deferred count to GrResource.
This will be used to determine whether a resource can either be deleted or reinserted in the cache when its ref count reaches zero.
Review URL: https://codereview.appspot.com/7202046
git-svn-id: http://skia.googlecode.com/svn/trunk@7355 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrResource.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gpu/GrResource.cpp b/src/gpu/GrResource.cpp index 002c2622c0..8fb21e8879 100644 --- a/src/gpu/GrResource.cpp +++ b/src/gpu/GrResource.cpp @@ -13,8 +13,9 @@ SK_DEFINE_INST_COUNT(GrResource) GrResource::GrResource(GrGpu* gpu, bool isWrapped) { - fGpu = gpu; - fCacheEntry = NULL; + fGpu = gpu; + fCacheEntry = NULL; + fDeferredRefCount = 0; if (isWrapped) { fFlags = kWrapped_Flag; } else { @@ -25,6 +26,7 @@ GrResource::GrResource(GrGpu* gpu, bool isWrapped) { GrResource::~GrResource() { // subclass should have released this. + GrAssert(0 == fDeferredRefCount); GrAssert(!this->isValid()); } |