Index: tests/RecordOptsTest.cpp |
diff --git a/tests/RecordOptsTest.cpp b/tests/RecordOptsTest.cpp |
index 34229d7a6b69adcaaf583552444f05410d3a6280..d4ad73931b352c23a838d41990455901ee026182 100644 |
--- a/tests/RecordOptsTest.cpp |
+++ b/tests/RecordOptsTest.cpp |
@@ -6,40 +6,16 @@ |
*/ |
#include "Test.h" |
+#include "RecordTestUtils.h" |
#include "SkRecord.h" |
#include "SkRecordOpts.h" |
#include "SkRecorder.h" |
#include "SkRecords.h" |
- |
#include "SkXfermode.h" |
static const int W = 1920, H = 1080; |
-// If the command we're reading is a U, set ptr to it, otherwise set it to NULL. |
-template <typename U> |
-struct ReadAs { |
- ReadAs() : ptr(NULL), type(SkRecords::Type(~0)) {} |
- |
- const U* ptr; |
- SkRecords::Type type; |
- |
- void operator()(const U& r) { ptr = &r; type = U::kType; } |
- |
- template <typename T> |
- void operator()(const T&) { type = U::kType; } |
-}; |
- |
-// Assert that the ith command in record is of type T, and return it. |
-template <typename T> |
-static const T* assert_type(skiatest::Reporter* r, const SkRecord& record, unsigned index) { |
- ReadAs<T> reader; |
- record.visit<void>(index, reader); |
- REPORTER_ASSERT(r, T::kType == reader.type); |
- REPORTER_ASSERT(r, NULL != reader.ptr); |
- return reader.ptr; |
-} |
- |
DEF_TEST(RecordOpts_Culling, r) { |
SkRecord record; |
SkRecorder recorder(SkRecorder::kWriteOnly_Mode, &record, W, H); |