aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-29 21:14:59 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-29 21:14:59 +0000
commit5fac58c91d8053dcc05c5bc72cfccee9246d9add (patch)
tree09034496ac3de4a5b7f872248da1f7663a124e16 /src
parent9f686f3639ff87e6d28b4ffcc42feebeca90f8d8 (diff)
Remove SkClipStack::Iter::combinedNext.
Review URL: https://codereview.appspot.com/6844114 git-svn-id: http://skia.googlecode.com/svn/trunk@6619 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r--src/core/SkClipStack.cpp51
-rw-r--r--src/gpu/GrClipMaskManager.cpp12
2 files changed, 6 insertions, 57 deletions
diff --git a/src/core/SkClipStack.cpp b/src/core/SkClipStack.cpp
index d86761c7c9..33cd41f802 100644
--- a/src/core/SkClipStack.cpp
+++ b/src/core/SkClipStack.cpp
@@ -746,57 +746,6 @@ const SkClipStack::Iter::Clip* SkClipStack::Iter::skipToTopmost(SkRegion::Op op)
return this->next();
}
-const SkClipStack::Iter::Clip* SkClipStack::Iter::nextCombined() {
- const Clip* clip;
-
- if (NULL != (clip = this->next()) &&
- SkRegion::kIntersect_Op == clip->fOp &&
- NULL != clip->fRect) {
- fCombinedRect = *clip->fRect;
- bool doAA = clip->fDoAA;
-
- while(NULL != (clip = this->next()) &&
- SkRegion::kIntersect_Op == clip->fOp &&
- NULL != clip->fRect) { // backup if non-null
- /**
- * If the AA settings don't match on consecutive rects we can still continue if
- * either contains the other. Otherwise, we must stop.
- */
- if (doAA != clip->fDoAA) {
- if (fCombinedRect.contains(*clip->fRect)) {
- fCombinedRect = *clip->fRect;
- doAA = clip->fDoAA;
- } else if (!clip->fRect->contains(fCombinedRect)) {
- break;
- }
- } else if (!fCombinedRect.intersect(*fClip.fRect)) {
- fCombinedRect.setEmpty();
- clip = NULL; // prevents unnecessary rewind below.
- break;
- }
- }
- // If we got here and clip is non-NULL then we got an element that we weren't able to
- // combine. We need to backup one to ensure that the callers next next() call returns it.
- if (NULL != clip) {
- // If next() above returned the last element then due to Iter's internal workings prev()
- // will return NULL. In that case we reset to the last element.
- if (NULL == this->prev()) {
- this->reset(*fStack, SkClipStack::Iter::kTop_IterStart);
- }
- }
-
- // Must do this last because it is overwritten in the above backup.
- fClip.fRect = &fCombinedRect;
- fClip.fPath = NULL;
- fClip.fOp = SkRegion::kIntersect_Op;
- fClip.fDoAA = doAA;
- fClip.fGenID = kInvalidGenID;
- return &fClip;
- } else {
- return clip;
- }
-}
-
void SkClipStack::Iter::reset(const SkClipStack& stack, IterStart startLoc) {
fStack = &stack;
fIter.reset(stack.fDeque, static_cast<SkDeque::Iter::IterStart>(startLoc));
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index 9190bdc6a6..fdaa067c9d 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -416,7 +416,7 @@ bool requires_AA(const SkClipStack& clipIn) {
const SkClipStack::Iter::Clip* clip = NULL;
for (clip = iter.skipToTopmost(SkRegion::kReplace_Op);
NULL != clip;
- clip = iter.nextCombined()) {
+ clip = iter.next()) {
if (clip->fDoAA) {
return true;
@@ -445,7 +445,7 @@ bool GrClipMaskManager::useSWOnlyPath(const SkClipStack& clipIn) {
for (clip = iter.skipToTopmost(SkRegion::kReplace_Op);
NULL != clip;
- clip = iter.nextCombined()) {
+ clip = iter.next()) {
// rects can always be drawn directly w/o using the software path
// so only paths need to be checked
@@ -619,7 +619,7 @@ const SkClipStack::Iter::Clip* process_initial_clip_elements(
for (clip = iter->skipToTopmost(SkRegion::kReplace_Op);
NULL != clip && !done;
- clip = iter->nextCombined()) {
+ clip = iter->next()) {
switch (clip->fOp) {
case SkRegion::kReplace_Op:
// replace ignores everything previous
@@ -966,7 +966,7 @@ bool GrClipMaskManager::createAlphaClipMask(const GrClipData& clipDataIn,
GrAutoScratchTexture temp;
bool first = true;
// walk through each clip element and perform its set op
- for ( ; NULL != clip; clip = iter.nextCombined()) {
+ for ( ; NULL != clip; clip = iter.next()) {
SkRegion::Op op = clip->fOp;
if (first) {
@@ -1107,7 +1107,7 @@ bool GrClipMaskManager::createStencilClipMask(const GrClipData& clipDataIn,
// walk through each clip element and perform its set op
// with the existing clip.
- for ( ; NULL != clip; clip = iter.nextCombined()) {
+ for ( ; NULL != clip; clip = iter.next()) {
GrPathFill fill;
bool fillInverted = false;
// enabled at bottom of loop
@@ -1473,7 +1473,7 @@ bool GrClipMaskManager::createSoftwareClipMask(const GrClipData& clipDataIn,
helper.clear(clearToInside ? 0xFF : 0x00);
bool first = true;
- for ( ; NULL != clip; clip = iter.nextCombined()) {
+ for ( ; NULL != clip; clip = iter.next()) {
SkRegion::Op op = clip->fOp;
if (first) {