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

Unified Diff: tests/CanvasTest.cpp

Issue 340403003: SaveFlags be-gone (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: One more baseurl attempt 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
« no previous file with comments | « src/utils/debugger/SkObjectParser.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/CanvasTest.cpp
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp
index ae686762bae1e938272bf00ba91e2b88d2504338..217cf0349e4751dfc883758bb4e808a25fe3286f 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();
« no previous file with comments | « src/utils/debugger/SkObjectParser.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698