aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrStencilBuffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrStencilBuffer.cpp')
-rw-r--r--src/gpu/GrStencilBuffer.cpp39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/gpu/GrStencilBuffer.cpp b/src/gpu/GrStencilBuffer.cpp
index 7bd6f3228d..2b7dfedc64 100644
--- a/src/gpu/GrStencilBuffer.cpp
+++ b/src/gpu/GrStencilBuffer.cpp
@@ -14,49 +14,10 @@
GR_DEFINE_RESOURCE_CACHE_TYPE(GrStencilBuffer)
-void GrStencilBuffer::wasDetachedFromRenderTarget(const GrRenderTarget* rt) {
- GrAssert(fRTAttachmentCnt > 0);
- if (0 == --fRTAttachmentCnt) {
- this->unlockInCache();
- // At this point we could be deleted!
- }
-}
-
void GrStencilBuffer::transferToCacheAndLock() {
GrAssert(NULL == this->getCacheEntry());
- GrAssert(!fHoldingLock);
this->getGpu()->getContext()->addAndLockStencilBuffer(this);
- fHoldingLock = true;
-}
-
-void GrStencilBuffer::onRelease() {
- // When the GrGpu rips through its list of resources and releases
- // them it may release an SB before it releases its attached RTs.
- // In that case when GrStencilBuffer sees its last detach it no
- // long has a gpu ptr (gets nulled in GrResource::release()) and can't
- // access the cache to unlock itself. So if we're being released and still
- // have attachments go ahead and unlock now.
- if (fRTAttachmentCnt) {
- this->unlockInCache();
- // we shouldn't be deleted here because some RT still has a ref on us.
- }
-}
-
-void GrStencilBuffer::onAbandon() {
- // we can use the same behavior as release.
- this->onRelease();
-}
-
-void GrStencilBuffer::unlockInCache() {
- if (fHoldingLock && this->isInCache()) {
- GrGpu* gpu = this->getGpu();
- if (NULL != gpu) {
- GrAssert(NULL != gpu->getContext());
- gpu->getContext()->unlockStencilBuffer(this);
- }
- fHoldingLock = false;
- }
}
namespace {