diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-01-10 14:40:28 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-01-10 14:40:28 +0000 |
commit | 358e427763f0971af436f07170c641f747b94595 (patch) | |
tree | 9e9deee9b9a2fa1c53237e940bce83ed2e666f11 /src | |
parent | e04cf0cf1d281b4e282dbd5d2eb2de553bc1d2b7 (diff) |
Remove default clip/drawstate in GrIODB.
R=robertphillips@google.com
Review URL: https://codereview.appspot.com/7070064
git-svn-id: http://skia.googlecode.com/svn/trunk@7114 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrInOrderDrawBuffer.cpp | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/gpu/GrInOrderDrawBuffer.cpp b/src/gpu/GrInOrderDrawBuffer.cpp index d51dca4fde..d65a71e41d 100644 --- a/src/gpu/GrInOrderDrawBuffer.cpp +++ b/src/gpu/GrInOrderDrawBuffer.cpp @@ -551,12 +551,6 @@ void GrInOrderDrawBuffer::reset() { fClipSet = true; this->resetDrawTracking(); - - // we start off with a default clip and state so that we don't have - // to do count checks on fClips, fStates, or fCmds before checking their - // last entry. - this->recordDefaultState(); - this->recordDefaultClip(); } bool GrInOrderDrawBuffer::playback(GrDrawTarget* target) { @@ -567,10 +561,7 @@ bool GrInOrderDrawBuffer::playback(GrDrawTarget* target) { GrAssert(target != this); // not considered and why? int numCmds = fCmds.count(); - GrAssert(numCmds >= 2); - if (2 == numCmds) { - GrAssert(kSetState_Cmd == fCmds[0]); - GrAssert(kSetClip_Cmd == fCmds[1]); + if (0 == numCmds) { return false; } @@ -868,15 +859,15 @@ void GrInOrderDrawBuffer::geometrySourceWillPop( } bool GrInOrderDrawBuffer::needsNewState() const { - // we should have recorded a default state in reset() - GrAssert(!fStates.empty()); - return fStates.back() != this->getDrawState(); + return fStates.empty() || fStates.back() != this->getDrawState(); } bool GrInOrderDrawBuffer::needsNewClip() const { - if (this->getDrawState().isClipState()) { + GrAssert(fClips.count() == fClipOrigins.count()); + if (this->getDrawState().isClipState()) { if (fClipSet && - (fClips.back() != *fClip->fClipStack || + (fClips.empty() || + fClips.back() != *fClip->fClipStack || fClipOrigins.back() != fClip->fOrigin)) { return true; } |