aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrReducedClip.cpp
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-11-01 16:25:59 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-11-01 16:25:59 +0000
commitf0784bde753feaff601f703089872fc1af265328 (patch)
treee3c52590d7de9b9df62d569c02e576c0596551c4 /src/gpu/GrReducedClip.cpp
parenteea3ab78e9f1680ada9bd471badc975e4d3cf8be (diff)
Revert "Avoid re-rendering stencil clip for every draw with reducable clip stack"
This reverts commit 92a7d4bf6a371f1f864154be902e8d86938e560b. Revert "fix mac 10.6 build" This reverts commit 114cd1a9f2734aaed6914718814364811b78bd7f. BUG= Review URL: https://codereview.chromium.org/54543008 git-svn-id: http://skia.googlecode.com/svn/trunk@12087 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/GrReducedClip.cpp')
-rw-r--r--src/gpu/GrReducedClip.cpp31
1 files changed, 2 insertions, 29 deletions
diff --git a/src/gpu/GrReducedClip.cpp b/src/gpu/GrReducedClip.cpp
index 8480e041b8..a5f4519ea7 100644
--- a/src/gpu/GrReducedClip.cpp
+++ b/src/gpu/GrReducedClip.cpp
@@ -17,7 +17,6 @@ namespace GrReducedClip {
void reduced_stack_walker(const SkClipStack& stack,
const SkRect& queryBounds,
ElementList* result,
- int32_t* resultGenID,
InitialState* initialState,
bool* requiresAA);
@@ -31,17 +30,11 @@ take a rect in case the caller knows a bound on what is to be drawn through this
void ReduceClipStack(const SkClipStack& stack,
const SkIRect& queryBounds,
ElementList* result,
- int32_t* resultGenID,
InitialState* initialState,
SkIRect* tighterBounds,
bool* requiresAA) {
result->reset();
- // The clip established by the element list might be cached based on the last
- // generation id. When we make early returns, we do not know what was the generation
- // id that lead to the state. Make a conservative guess.
- *resultGenID = stack.getTopmostGenID();
-
if (stack.isWideOpen()) {
*initialState = kAllIn_InitialState;
return;
@@ -77,9 +70,7 @@ void ReduceClipStack(const SkClipStack& stack,
SkRect scalarTighterBounds = SkRect::Make(*tighterBounds);
if (scalarTighterBounds == isectRect) {
// the round-out didn't add any area outside the clip rect.
- if (NULL != requiresAA) {
- *requiresAA = false;
- }
+ *requiresAA = false;
*initialState = kAllIn_InitialState;
return;
}
@@ -132,17 +123,12 @@ void ReduceClipStack(const SkClipStack& stack,
// Now that we have determined the bounds to use and filtered out the trivial cases, call the
// helper that actually walks the stack.
- reduced_stack_walker(stack, scalarBounds, result, resultGenID, initialState, requiresAA);
-
- // The list that was computed in this function may be cached based on the gen id of the last
- // element.
- SkASSERT(SkClipStack::kInvalidGenID != *resultGenID);
+ reduced_stack_walker(stack, scalarBounds, result, initialState, requiresAA);
}
void reduced_stack_walker(const SkClipStack& stack,
const SkRect& queryBounds,
ElementList* result,
- int32_t* resultGenID,
InitialState* initialState,
bool* requiresAA) {
@@ -326,11 +312,6 @@ void reduced_stack_walker(const SkClipStack& stack,
break;
}
if (!skippable) {
- if (0 == result->count()) {
- // This will be the last element. Record the stricter genID.
- *resultGenID = element->getGenID();
- }
-
// if it is a flip, change it to a bounds-filling rect
if (isFlip) {
SkASSERT(SkRegion::kXOR_Op == element->getOp() ||
@@ -436,13 +417,5 @@ void reduced_stack_walker(const SkClipStack& stack,
if (NULL != requiresAA) {
*requiresAA = numAAElements > 0;
}
-
- if (0 == result->count()) {
- if (*initialState == kAllIn_InitialState) {
- *resultGenID = SkClipStack::kWideOpenGenID;
- } else {
- *resultGenID = SkClipStack::kEmptyGenID;
- }
- }
}
} // namespace GrReducedClip