aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-12-06 14:23:20 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-12-06 14:23:20 +0000
commit34cd70a5810b3cf37b44de1ce080a911a8b342c8 (patch)
tree5ebaa681293e11e390f39d8434ff7cba7837c703 /tests
parent0264fb4543b0d8cebe00f1ee32433784f4ceb074 (diff)
Make the clip reducer operate on int rects. Remove redundant Gr from func
name. R=robertphillips@google.com Review URL: https://codereview.appspot.com/6890045 git-svn-id: http://skia.googlecode.com/svn/trunk@6688 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests')
-rw-r--r--tests/ClipStackTest.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/ClipStackTest.cpp b/tests/ClipStackTest.cpp
index 3127a71058..9b4a68f694 100644
--- a/tests/ClipStackTest.cpp
+++ b/tests/ClipStackTest.cpp
@@ -669,7 +669,13 @@ static void test_reduced_clip_stack(skiatest::Reporter* reporter) {
ElementList reducedClips;
GrReducedClip::InitialState initial;
- GrReducedClip::GrReduceClipStack(stack, inflatedBounds, &reducedClips, &initial);
+ SkIRect tBounds;
+ SkIRect* tightBounds = r.nextBool() ? &tBounds : NULL;
+ GrReducedClip::ReduceClipStack(stack,
+ inflatedIBounds,
+ &reducedClips,
+ &initial,
+ tightBounds);
// Build a new clip stack based on the reduced clip elements
SkClipStack reducedStack;
@@ -681,6 +687,11 @@ static void test_reduced_clip_stack(skiatest::Reporter* reporter) {
add_elem_to_stack(*iter.get(), &reducedStack);
}
+ // GrReducedClipStack assumes that the final result is clipped to the returned bounds
+ if (NULL != tightBounds) {
+ reducedStack.clipDevRect(*tightBounds, SkRegion::kIntersect_Op);
+ }
+
// convert both the original stack and reduced stack to SkRegions and see if they're equal
SkRegion region;
SkRegion reducedRegion;