Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Unified Diff: tests/CanvasStateTest.cpp

Issue 1470563003: Revert[2] of "quick-accept clipRect calls" (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/CanvasStateTest.cpp
diff --git a/tests/CanvasStateTest.cpp b/tests/CanvasStateTest.cpp
index b5543a1523c53f084539d875c66f63b49dd139c8..4f5fb463e3a3461bd0c22bff432d6977c1e92f8f 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
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698