diff options
Diffstat (limited to 'tools/VisualBench/VisualSKPBench.h')
-rw-r--r-- | tools/VisualBench/VisualSKPBench.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tools/VisualBench/VisualSKPBench.h b/tools/VisualBench/VisualSKPBench.h new file mode 100644 index 0000000000..cc35deaac5 --- /dev/null +++ b/tools/VisualBench/VisualSKPBench.h @@ -0,0 +1,37 @@ +/* + * Copyright 2015 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + * + */ + +#ifndef VisualSKPBench_DEFINED +#define VisualSKPBench_DEFINED + +#include "Benchmark.h" +#include "SkCanvas.h" +#include "SkPicture.h" + +/** + * Runs an SkPicture as a benchmark by repeatedly drawing it + */ +class VisualSKPBench : public Benchmark { +public: + VisualSKPBench(const char* name, const SkPicture*); + +protected: + const char* onGetName() override; + const char* onGetUniqueName() override; + bool isSuitableFor(Backend backend) override; + void onDraw(const int loops, SkCanvas* canvas) override; + +private: + SkAutoTUnref<const SkPicture> fPic; + SkString fName; + SkString fUniqueName; + + typedef Benchmark INHERITED; +}; + +#endif |