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.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gpu/GrStencilBuffer.cpp b/src/gpu/GrStencilBuffer.cpp
index bf14f4864e..7bd6f3228d 100644
--- a/src/gpu/GrStencilBuffer.cpp
+++ b/src/gpu/GrStencilBuffer.cpp
@@ -41,7 +41,6 @@ void GrStencilBuffer::onRelease() {
this->unlockInCache();
// we shouldn't be deleted here because some RT still has a ref on us.
}
- fHoldingLock = false;
}
void GrStencilBuffer::onAbandon() {
@@ -50,12 +49,13 @@ void GrStencilBuffer::onAbandon() {
}
void GrStencilBuffer::unlockInCache() {
- if (fHoldingLock) {
+ if (fHoldingLock && this->isInCache()) {
GrGpu* gpu = this->getGpu();
if (NULL != gpu) {
GrAssert(NULL != gpu->getContext());
gpu->getContext()->unlockStencilBuffer(this);
}
+ fHoldingLock = false;
}
}