aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/CanvasStateTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/CanvasStateTest.cpp')
-rw-r--r--tests/CanvasStateTest.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/CanvasStateTest.cpp b/tests/CanvasStateTest.cpp
index b5543a1523..4f5fb463e3 100644
--- a/tests/CanvasStateTest.cpp
+++ b/tests/CanvasStateTest.cpp
@@ -322,8 +322,14 @@ DEF_TEST(CanvasState_test_saveLayer_clip, reporter) {
SkRect clipStackBounds;
SkClipStack::BoundsType boundsType;
canvas.getClipStack()->getBounds(&clipStackBounds, &boundsType);
- REPORTER_ASSERT(reporter, clipStackBounds.width() == WIDTH);
- REPORTER_ASSERT(reporter, clipStackBounds.height() == HEIGHT);
+ // The clip stack will return its bounds, or it may be "full" : i.e. empty + inside_out.
+ // Either result is consistent with this test, since the canvas' size is WIDTH/HEIGHT
+ if (SkClipStack::kInsideOut_BoundsType == boundsType) {
+ REPORTER_ASSERT(reporter, clipStackBounds.isEmpty());
+ } else {
+ REPORTER_ASSERT(reporter, clipStackBounds.width() == WIDTH);
+ REPORTER_ASSERT(reporter, clipStackBounds.height() == HEIGHT);
+ }
canvas.restore();
// Check that saveLayer with the kClipToLayer_SaveFlag sets the clip