diff options
author | mtklein <mtklein@chromium.org> | 2014-09-16 11:11:20 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-16 11:11:20 -0700 |
commit | 1e78fc4ed2a1ef9f049311696ebd0a26e1c3782d (patch) | |
tree | 883f5a6b42c4e3186782d3662a97069d9de41b50 /tests/RecordOptsTest.cpp | |
parent | e3b051cf8bfd5d8921516fdc7ffd33dc80b73184 (diff) |
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
Diffstat (limited to 'tests/RecordOptsTest.cpp')
-rw-r--r-- | tests/RecordOptsTest.cpp | 24 |
1 files changed, 0 insertions, 24 deletions
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<SkPoint> 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<SkRecords::DrawPosTextH>(r, record, 0); - assert_type<SkRecords::DrawPosText>(r, record, 1); -} - DEF_TEST(RecordOpts_NoopDrawSaveRestore, r) { SkRecord record; SkRecorder recorder(&record, W, H); |