Fixed assert in unlockStencilBuffer

http://codereview.appspot.com/6492088/



git-svn-id: http://skia.googlecode.com/svn/trunk@5413 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
robertphillips@google.com 2012-09-06 14:50:45 +00:00
parent 0d50bc1490
commit 667c3a3b8b

View File

@ -246,7 +246,6 @@ GrStencilBuffer* GrContext::findAndLockStencilBuffer(int width, int height,
}
void GrContext::unlockStencilBuffer(GrStencilBuffer* sb) {
ASSERT_OWNED_RESOURCE(sb);
if (NULL == sb->getCacheEntry()) {
// This can happen when the GrResourceCache is being deleted. If
@ -256,6 +255,10 @@ void GrContext::unlockStencilBuffer(GrStencilBuffer* sb) {
return;
}
// If the texture cache still exists we know the GrGpu & GrContext still
// exist so we can verify ownership.
ASSERT_OWNED_RESOURCE(sb);
fTextureCache->unlock(sb->getCacheEntry());
}