aboutsummaryrefslogtreecommitdiff
path: root/tests/ClipStackTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ClipStackTest.cpp')
-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;