aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ClipStackTest.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-12-04 15:22:12 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-12-04 15:22:12 +0000
commita444430281ea35cb76fb42516978b4a93221c2c7 (patch)
tree81422ef04fcf935c553944bf9dcfab6f5e54e24e /tests/ClipStackTest.cpp
parent4b90b1122c93e6600ea352f4ccf1dfc54c8bb146 (diff)
Make GrReduceClipStack use a caller provided query rect rather than return a
bounds. R=robertphillips@google.com Review URL: https://codereview.appspot.com/6865059 git-svn-id: http://skia.googlecode.com/svn/trunk@6665 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests/ClipStackTest.cpp')
-rw-r--r--tests/ClipStackTest.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/tests/ClipStackTest.cpp b/tests/ClipStackTest.cpp
index bbd833b6bb..aba5334505 100644
--- a/tests/ClipStackTest.cpp
+++ b/tests/ClipStackTest.cpp
@@ -659,13 +659,17 @@ static void test_reduced_clip_stack(skiatest::Reporter* reporter) {
}
}
+ SkRect inflatedBounds = kBounds;
+ inflatedBounds.outset(kBounds.width() / 2, kBounds.height() / 2);
+ SkIRect inflatedIBounds;
+ inflatedBounds.roundOut(&inflatedIBounds);
+
typedef GrReducedClip::ElementList ElementList;
// Get the reduced version of the stack.
ElementList reducedClips;
- SkRect resultBounds;
- bool bounded;
+
GrReducedClip::InitialState initial;
- GrReducedClip::GrReduceClipStack(stack, &reducedClips, &resultBounds, &bounded, &initial);
+ GrReducedClip::GrReduceClipStack(stack, inflatedBounds, &reducedClips, &initial);
// Build a new clip stack based on the reduced clip elements
SkClipStack reducedStack;
@@ -676,17 +680,8 @@ static void test_reduced_clip_stack(skiatest::Reporter* reporter) {
for (ElementList::Iter iter = reducedClips.headIter(); NULL != iter.get(); iter.next()) {
add_elem_to_stack(*iter.get(), &reducedStack);
}
- if (bounded) {
- // GrReduceClipStack() assumes that there is an implicit clip to the bounds
- reducedStack.clipDevRect(resultBounds, SkRegion::kIntersect_Op, true);
- }
// convert both the original stack and reduced stack to SkRegions and see if they're equal
- SkRect inflatedBounds = kBounds;
- inflatedBounds.outset(kBounds.width() / 2, kBounds.height() / 2);
- SkIRect inflatedIBounds;
- inflatedBounds.roundOut(&inflatedIBounds);
-
SkRegion region;
SkRegion reducedRegion;