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

Unified Diff: tests/RecordPatternTest.cpp

Issue 767333002: Defer saves() until they're needed (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: now with faster counter Created 6 years 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/RecordPatternTest.cpp
diff --git a/tests/RecordPatternTest.cpp b/tests/RecordPatternTest.cpp
index 5f4d00668345f2957e54123e8c9001c16392ad1c..d225a8036510d96e5ef7fbfbcc71fd912b570c9c 100644
--- a/tests/RecordPatternTest.cpp
+++ b/tests/RecordPatternTest.cpp
@@ -75,21 +75,19 @@ DEF_TEST(RecordPattern_Star, r) {
SkRecord record;
SkRecorder recorder(&record, 1920, 1200);
-
- recorder.save();
- recorder.restore();
- REPORTER_ASSERT(r, pattern.match(&record, 0));
+ int index = 0;
recorder.save();
recorder.clipRect(SkRect::MakeWH(300, 200));
recorder.restore();
- REPORTER_ASSERT(r, pattern.match(&record, 2));
+ REPORTER_ASSERT(r, pattern.match(&record, index));
+ index += 3;
recorder.save();
recorder.clipRect(SkRect::MakeWH(300, 200));
recorder.clipRect(SkRect::MakeWH(100, 100));
recorder.restore();
- REPORTER_ASSERT(r, pattern.match(&record, 5));
+ REPORTER_ASSERT(r, pattern.match(&record, index));
}
robertphillips 2014/12/11 13:24:36 I think this test is dead - remove it ?
reed1 2014/12/11 14:54:08 Done.
DEF_TEST(RecordPattern_IsDraw, r) {
@@ -104,6 +102,7 @@ DEF_TEST(RecordPattern_IsDraw, r) {
REPORTER_ASSERT(r, !pattern.match(&record, 0));
+#if 0
SkPaint paint;
recorder.save();
@@ -125,8 +124,10 @@ DEF_TEST(RecordPattern_IsDraw, r) {
REPORTER_ASSERT(r, pattern.first<Save>() != NULL);
REPORTER_ASSERT(r, pattern.second<SkPaint>()->getColor() == 0xFACEFACE);
REPORTER_ASSERT(r, pattern.third<Restore>() != NULL);
+#endif
}
robertphillips 2014/12/11 13:24:36 This test should be pretty easy to bring back to l
reed1 2014/12/11 14:54:08 Done.
+#if 0
DEF_TEST(RecordPattern_Complex, r) {
Pattern3<Is<Save>,
Star<Not<Or3<Is<Save>,
@@ -187,6 +188,7 @@ DEF_TEST(RecordPattern_Complex, r) {
REPORTER_ASSERT(r, !pattern.search(&record, &begin, &end));
}
+#endif
DEF_TEST(RecordPattern_SaveLayerIsNotADraw, r) {
Pattern1<IsDraw> pattern;

Powered by Google App Engine
This is Rietveld 408576698