3 * Copyright 2012 The Android Open Source Project
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
11 #include "SkWriter32.h"
13 class WriterBench : public Benchmark {
15 bool isSuitableFor(Backend backend) override {
16 return backend == kNonRendering_Backend;
20 const char* onGetName() override {
24 void onDraw(const int loops, SkCanvas*) override {
25 static const char gStr[] = "abcdefghimjklmnopqrstuvwxyz";
26 static const size_t gLen = strlen(gStr);
28 for (int i = 0; i < loops; i++) {
29 for (size_t j = 0; j <= gLen; j++) {
30 writer.writeString(gStr, j);
36 typedef Benchmark INHERITED;
39 ////////////////////////////////////////////////////////////////////////////////
41 DEF_BENCH( return new WriterBench(); )