Index: tests/RecordCullingTest.cpp |
diff --git a/tests/RecordCullingTest.cpp b/tests/RecordCullingTest.cpp |
index 982fbe79388680559780f4c3a19c78adea0a233f..7cb62414c319d6dd14e8178128a7279dc4271af8 100644 |
--- a/tests/RecordCullingTest.cpp |
+++ b/tests/RecordCullingTest.cpp |
@@ -12,14 +12,20 @@ |
#include "SkRecorder.h" |
#include "SkRecords.h" |
-struct PushCullScanner { |
+struct SkipScanner { |
template <typename T> void operator()(const T&) {} |
- SkTDArray<unsigned> fPopOffsets; |
+ void apply(const SkRecord& record) { |
+ for (unsigned i = 0; i < record.count(); i++) { |
+ record.visit(i, *this); |
+ } |
+ } |
+ |
+ SkTDArray<unsigned> fSkips; |
}; |
-template <> void PushCullScanner::operator()(const SkRecords::PushCull& record) { |
- *fPopOffsets.append() = record.popOffset; |
+template <> void SkipScanner::operator()(const SkRecords::PairedPushCull& r) { |
+ *fSkips.append() = r.skip; |
} |
@@ -39,10 +45,10 @@ DEF_TEST(RecordCulling, r) { |
SkRecordAnnotateCullingPairs(&record); |
- PushCullScanner scan; |
- record.visit(scan); |
+ SkipScanner scan; |
+ scan.apply(record); |
- REPORTER_ASSERT(r, 2 == scan.fPopOffsets.count()); |
- REPORTER_ASSERT(r, 6 == scan.fPopOffsets[0]); |
- REPORTER_ASSERT(r, 2 == scan.fPopOffsets[1]); |
+ REPORTER_ASSERT(r, 2 == scan.fSkips.count()); |
+ REPORTER_ASSERT(r, 6 == scan.fSkips[0]); |
+ REPORTER_ASSERT(r, 2 == scan.fSkips[1]); |
} |