Cleanup restore offsets at end of SkPicture recording
Review URL: http://codereview.appspot.com/6355099/
TEST=skia unit test CanvasTest, test step TwoClipOps
BUG=https://code.google.com/p/chromium/issues/detail?id=133432
git-svn-id: http://skia.googlecode.com/svn/trunk@4577 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp
index 0677ce8..a1ca236 100644
--- a/tests/CanvasTest.cpp
+++ b/tests/CanvasTest.cpp
@@ -327,6 +327,18 @@
///////////////////////////////////////////////////////////////////////////////
// Complex test steps
+static void TwoClipOpsStep(SkCanvas* canvas,
+ skiatest::Reporter* reporter,
+ CanvasTestStep* testStep) {
+ // This test exercises a functionality in SkPicture that leads to the
+ // recording of restore offset placeholders. This test will trigger an
+ // assertion at playback time if the placeholders are not properly
+ // filled when the recording ends.
+ canvas->clipRect(kTestRect);
+ canvas->clipRegion(kTestRegion);
+}
+TEST_STEP(TwoClipOps, TwoClipOpsStep);
+
// exercise fix for http://code.google.com/p/skia/issues/detail?id=560
// ('SkPathStroker::lineTo() fails for line with length SK_ScalarNearlyZero')
static void DrawNearlyZeroLengthPathTestStep(SkCanvas* canvas,