aboutsummaryrefslogtreecommitdiffhomepage
path: root/gpu/src/GrGpu.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-08-01 15:51:05 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-08-01 15:51:05 +0000
commitdea2f8d86378b791a2de94384a18e29f13f65a3e (patch)
treec8772110b55a013a8cfe65b3556fd569adf11456 /gpu/src/GrGpu.cpp
parent896d79da5359370c28fc17c631d9d6bab2bdb6f3 (diff)
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
Diffstat (limited to 'gpu/src/GrGpu.cpp')
-rw-r--r--gpu/src/GrGpu.cpp27
1 files changed, 9 insertions, 18 deletions
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