| * Copyright 2012 The Android Open Source Project |
| * Use of this source code is governed by a BSD-style license that can be |
| * found in the LICENSE file. |
| class WriterBench : public Benchmark { |
| bool isSuitableFor(Backend backend) override { |
| return backend == kNonRendering_Backend; |
| const char* onGetName() override { |
| void onDraw(int loops, SkCanvas*) override { |
| static const char gStr[] = "abcdefghimjklmnopqrstuvwxyz"; |
| static const size_t gLen = strlen(gStr); |
| for (int i = 0; i < loops; i++) { |
| for (size_t j = 0; j <= gLen; j++) { |
| writer.writeString(gStr, j); |
| typedef Benchmark INHERITED; |
| //////////////////////////////////////////////////////////////////////////////// |
| DEF_BENCH( return new WriterBench(); ) |