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

Unified Diff: tests/CanvasTest.cpp

Issue 340403003: SaveFlags be-gone (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 months 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
Index: tests/CanvasTest.cpp
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp
index f8e856ac00f98c84280791a96f940a86ab3af405..3f93b89b367d3bc30bd456c91db3c2e04b710067 100644
--- a/tests/CanvasTest.cpp
+++ b/tests/CanvasTest.cpp
@@ -367,45 +367,11 @@ SIMPLE_TEST_STEP(EndGroup, endCommentGroup());
///////////////////////////////////////////////////////////////////////////////
// Complex test steps
-// Save/restore calls cannot be in isolated simple test steps because the test
-// cases that use SkPicture require that save and restore calls be balanced.
-static void SaveMatrixStep(SkCanvas* canvas,
- skiatest::Reporter* reporter,
- CanvasTestStep* testStep) {
- int saveCount = canvas->getSaveCount();
- canvas->save(SkCanvas::kMatrix_SaveFlag);
- canvas->clipRegion(kTestRegion);
- canvas->translate(SkIntToScalar(1), SkIntToScalar(2));
- canvas->restore();
- REPORTER_ASSERT_MESSAGE(reporter, canvas->getSaveCount() == saveCount,
- testStep->assertMessage());
- REPORTER_ASSERT_MESSAGE(reporter, canvas->getTotalMatrix().isIdentity(),
- testStep->assertMessage());
-// REPORTER_ASSERT_MESSAGE(reporter, canvas->getTotalClip() == kTestRegion, testStep->assertMessage());
-}
-TEST_STEP(SaveMatrix, SaveMatrixStep);
-
-static void SaveClipStep(SkCanvas* canvas,
- skiatest::Reporter* reporter,
- CanvasTestStep* testStep) {
- int saveCount = canvas->getSaveCount();
- canvas->save(SkCanvas::kClip_SaveFlag);
- canvas->translate(SkIntToScalar(1), SkIntToScalar(2));
- canvas->clipRegion(kTestRegion);
- canvas->restore();
- REPORTER_ASSERT_MESSAGE(reporter, canvas->getSaveCount() == saveCount,
- testStep->assertMessage());
- REPORTER_ASSERT_MESSAGE(reporter, !canvas->getTotalMatrix().isIdentity(),
- testStep->assertMessage());
-// REPORTER_ASSERT_MESSAGE(reporter, canvas->getTotalClip() != kTestRegion, testStep->assertMessage());
-}
-TEST_STEP(SaveClip, SaveClipStep);
-
static void SaveMatrixClipStep(SkCanvas* canvas,
skiatest::Reporter* reporter,
CanvasTestStep* testStep) {
int saveCount = canvas->getSaveCount();
- canvas->save(SkCanvas::kMatrixClip_SaveFlag);
+ canvas->save();
canvas->translate(SkIntToScalar(1), SkIntToScalar(2));
canvas->clipRegion(kTestRegion);
canvas->restore();

Powered by Google App Engine
This is Rietveld 408576698