diff options
author | 2011-03-29 20:52:23 +0000 | |
---|---|---|
committer | 2011-03-29 20:52:23 +0000 | |
commit | 11f0b519766dabed4ce882f3ee7c07a68d3ccb52 (patch) | |
tree | a24df14209f74dac930584f0cc22d8e72ae06517 /gpu/src/GrGpu.cpp | |
parent | cf3edc9c972ce1696d1fe21dcddbabbca2999361 (diff) |
Fix ref leak on GrGpu.
Review URL: http://codereview.appspot.com/4323043/
git-svn-id: http://skia.googlecode.com/svn/trunk@1015 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu/src/GrGpu.cpp')
-rw-r--r-- | gpu/src/GrGpu.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/gpu/src/GrGpu.cpp b/gpu/src/GrGpu.cpp index 1db92522c6..378b881637 100644 --- a/gpu/src/GrGpu.cpp +++ b/gpu/src/GrGpu.cpp @@ -432,7 +432,7 @@ bool GrGpu::setupClipAndFlushState(GrPrimitiveType type) { const GrPath& path = clip.getPath(c); pathIter.reset(path); pr = this->getClipPathRenderer(&pathIter, NonInvertedFill(fill)); - canRenderDirectToStencil = + canRenderDirectToStencil = !pr->requiresStencilPass(this, &pathIter, NonInvertedFill(fill)); } @@ -441,14 +441,14 @@ bool GrGpu::setupClipAndFlushState(GrPrimitiveType type) { int passes; GrStencilSettings stencilSettings[GrStencilSettings::kMaxStencilClipPasses]; - bool canDrawDirectToClip; // Given the renderer, the element, + bool canDrawDirectToClip; // Given the renderer, the element, // fill rule, and set operation can // we render the element directly to // stencil bit used for clipping. - canDrawDirectToClip = - GrStencilSettings::GetClipPasses(op, + canDrawDirectToClip = + GrStencilSettings::GetClipPasses(op, canRenderDirectToStencil, - clipBit, + clipBit, IsFillInverted(fill), &passes, stencilSettings); @@ -469,7 +469,7 @@ bool GrGpu::setupClipAndFlushState(GrPrimitiveType type) { } else { if (canRenderDirectToStencil) { this->setStencil(gDrawToStencil); - pr->drawPath(this, 0, + pr->drawPath(this, 0, &pathIter, NonInvertedFill(fill), NULL); @@ -519,12 +519,12 @@ bool GrGpu::setupClipAndFlushState(GrPrimitiveType type) { GrPathRenderer* GrGpu::getClipPathRenderer(GrPathIter* path, GrPathFill fill) { - if (NULL != fClientPathRenderer && + if (NULL != fClientPathRenderer && fClientPathRenderer->canDrawPath(this, path, fill)) { return fClientPathRenderer; } else { if (NULL == fDefaultPathRenderer) { - fDefaultPathRenderer = + fDefaultPathRenderer = new GrDefaultPathRenderer(this->supportsTwoSidedStencil(), this->supportsStencilWrapOps()); } @@ -603,6 +603,7 @@ void GrGpu::prepareVertexPool() { fVertexPool = new GrVertexBufferAllocPool(this, true, VERTEX_POOL_VB_SIZE, VERTEX_POOL_VB_COUNT); + fVertexPool->releaseGpuRef(); } else if (!fVertexPoolInUse) { // the client doesn't have valid data in the pool fVertexPool->reset(); @@ -612,6 +613,7 @@ void GrGpu::prepareVertexPool() { void GrGpu::prepareIndexPool() { if (NULL == fIndexPool) { fIndexPool = new GrIndexBufferAllocPool(this, true, 0, 1); + fIndexPool->releaseGpuRef(); } else if (!fIndexPoolInUse) { // the client doesn't have valid data in the pool fIndexPool->reset(); |