From 1e78fc4ed2a1ef9f049311696ebd0a26e1c3782d Mon Sep 17 00:00:00 2001 From: mtklein Date: Tue, 16 Sep 2014 11:11:20 -0700 Subject: Turn disable or delete optimizations that don't have any effect. Recording gets a ~5% speedup. BUG=skia: R=robertphillips@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/577673003 --- tests/RecordOptsTest.cpp | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'tests/RecordOptsTest.cpp') diff --git a/tests/RecordOptsTest.cpp b/tests/RecordOptsTest.cpp index e17b5e6bfa..c5c4471d67 100644 --- a/tests/RecordOptsTest.cpp +++ b/tests/RecordOptsTest.cpp @@ -16,30 +16,6 @@ static const int W = 1920, H = 1080; -static void draw_pos_text(SkCanvas* canvas, const char* text, bool constantY) { - const size_t len = strlen(text); - SkAutoTMalloc pos(len); - for (size_t i = 0; i < len; i++) { - pos[i].fX = (SkScalar)i; - pos[i].fY = constantY ? SK_Scalar1 : (SkScalar)i; - } - canvas->drawPosText(text, len, pos, SkPaint()); -} - -DEF_TEST(RecordOpts_StrengthReduction, r) { - SkRecord record; - SkRecorder recorder(&record, W, H); - - // We can convert a drawPosText into a drawPosTextH when all the Ys are the same. - draw_pos_text(&recorder, "This will be reduced to drawPosTextH.", true); - draw_pos_text(&recorder, "This cannot be reduced to drawPosTextH.", false); - - SkRecordReduceDrawPosTextStrength(&record); - - assert_type(r, record, 0); - assert_type(r, record, 1); -} - DEF_TEST(RecordOpts_NoopDrawSaveRestore, r) { SkRecord record; SkRecorder recorder(&record, W, H); -- cgit v1.2.3