From 0a98d870448f66ea0df7c37a47b38cf2d3b734e5 Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Mon, 19 May 2014 15:15:24 +0000 Subject: Don't clobber initial transform with SetMatrix. BUG=skia:2378 R=reed@google.com, mtklein@google.com, robertphillips@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/290883004 git-svn-id: http://skia.googlecode.com/svn/trunk@14778 2bbb7eff-a529-9590-31e7-b0007b416f81 --- tests/RecordOptsTest.cpp | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) (limited to 'tests/RecordOptsTest.cpp') diff --git a/tests/RecordOptsTest.cpp b/tests/RecordOptsTest.cpp index 34229d7a6b..d4ad73931b 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 -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 - void operator()(const T&) { type = U::kType; } -}; - -// Assert that the ith command in record is of type T, and return it. -template -static const T* assert_type(skiatest::Reporter* r, const SkRecord& record, unsigned index) { - ReadAs reader; - record.visit(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); -- cgit v1.2.3