From dea2f8d86378b791a2de94384a18e29f13f65a3e Mon Sep 17 00:00:00 2001 From: "bsalomon@google.com" Date: Mon, 1 Aug 2011 15:51:05 +0000 Subject: Remove unnecessary dirty clip flag in GrGpu, remove getUsableStencilBits() Review URL: http://codereview.appspot.com/4828050/ git-svn-id: http://skia.googlecode.com/svn/trunk@2011 2bbb7eff-a529-9590-31e7-b0007b416f81 --- gpu/src/GrGpu.cpp | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'gpu/src/GrGpu.cpp') diff --git a/gpu/src/GrGpu.cpp b/gpu/src/GrGpu.cpp index 011d39d58e..c89dd4e4bb 100644 --- a/gpu/src/GrGpu.cpp +++ b/gpu/src/GrGpu.cpp @@ -257,14 +257,6 @@ const GrVertexBuffer* GrGpu::getUnitSquareVertexBuffer() const { //////////////////////////////////////////////////////////////////////////////// -void GrGpu::clipWillBeSet(const GrClip& newClip) { - if (newClip != fClip) { - fClipState.fClipIsDirty = true; - } -} - -//////////////////////////////////////////////////////////////////////////////// - // stencil settings to use when clip is in stencil const GrStencilSettings GrGpu::gClipStencilSettings = { kKeep_StencilOp, kKeep_StencilOp, @@ -402,13 +394,12 @@ bool GrGpu::setupClipAndFlushState(GrPrimitiveType type) { } r = &clipRect; - fClipState.fClipInStencil = !fClip.isRect() && - !fClip.isEmpty() && - !bounds.isEmpty(); + // use the stencil clip if we can't represent the clip as a rectangle. + fClipInStencil = !fClip.isRect() && !fClip.isEmpty() && + !bounds.isEmpty(); - if (fClipState.fClipInStencil && - (fClipState.fClipIsDirty || - fClip != rt.fLastStencilClip)) { + if (fClipInStencil && + fClip != rt.fLastStencilClip) { rt.fLastStencilClip = fClip; // we set the current clip to the bounds so that our recursive @@ -533,12 +524,12 @@ bool GrGpu::setupClipAndFlushState(GrPrimitiveType type) { } } } + // restore clip fClip = clip; - // recusive draws would have disabled this. - fClipState.fClipInStencil = true; + // recusive draws would have disabled this since they drew with + // the clip bounds as clip. + fClipInStencil = true; } - - fClipState.fClipIsDirty = false; } // Must flush the scissor after graphics state -- cgit v1.2.3