joshualitt | 962cc98 | 2015-06-30 07:43:14 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | * |
| 7 | */ |
| 8 | |
| 9 | #ifndef VisualSKPBench_DEFINED |
| 10 | #define VisualSKPBench_DEFINED |
| 11 | |
| 12 | #include "Benchmark.h" |
| 13 | #include "SkCanvas.h" |
| 14 | #include "SkPicture.h" |
| 15 | |
| 16 | /** |
| 17 | * Runs an SkPicture as a benchmark by repeatedly drawing it |
| 18 | */ |
| 19 | class VisualSKPBench : public Benchmark { |
| 20 | public: |
| 21 | VisualSKPBench(const char* name, const SkPicture*); |
| 22 | |
| 23 | protected: |
| 24 | const char* onGetName() override; |
| 25 | const char* onGetUniqueName() override; |
| 26 | bool isSuitableFor(Backend backend) override; |
cdalton | 0f6cca8 | 2015-11-24 08:54:29 -0800 | [diff] [blame] | 27 | SkIPoint onGetSize() override; |
mtklein | a1ebeb2 | 2015-10-01 09:43:39 -0700 | [diff] [blame] | 28 | void onDraw(int loops, SkCanvas* canvas) override; |
joshualitt | 962cc98 | 2015-06-30 07:43:14 -0700 | [diff] [blame] | 29 | |
| 30 | private: |
| 31 | SkAutoTUnref<const SkPicture> fPic; |
cdalton | 0f6cca8 | 2015-11-24 08:54:29 -0800 | [diff] [blame] | 32 | SkIRect fCullRect; |
joshualitt | 962cc98 | 2015-06-30 07:43:14 -0700 | [diff] [blame] | 33 | SkString fName; |
| 34 | SkString fUniqueName; |
| 35 | |
| 36 | typedef Benchmark INHERITED; |
| 37 | }; |
| 38 | |
| 39 | #endif |