OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 #include "SkBenchmark.h" | 7 #include "SkBenchmark.h" |
8 #include "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkColor.h" | 9 #include "SkColor.h" |
10 #include "SkPaint.h" | 10 #include "SkPaint.h" |
11 #include "SkPicture.h" | 11 #include "SkPicture.h" |
12 #include "SkPoint.h" | 12 #include "SkPoint.h" |
13 #include "SkRandom.h" | 13 #include "SkRandom.h" |
14 #include "SkRect.h" | 14 #include "SkRect.h" |
15 #include "SkString.h" | 15 #include "SkString.h" |
16 | 16 |
17 class PictureRecordBench : public SkBenchmark { | 17 class PictureRecordBench : public SkBenchmark { |
18 public: | 18 public: |
19 PictureRecordBench(const char name[]) { | 19 PictureRecordBench(const char name[]) { |
20 fName.printf("picture_record_%s", name); | 20 fName.printf("picture_record_%s", name); |
21 fIsRendering = false; | 21 } |
| 22 |
| 23 virtual bool isSuitableFor(Backend backend) SK_OVERRIDE { |
| 24 return backend == kNonRendering_Backend; |
22 } | 25 } |
23 | 26 |
24 enum { | 27 enum { |
25 PICTURE_WIDTH = 1000, | 28 PICTURE_WIDTH = 1000, |
26 PICTURE_HEIGHT = 4000, | 29 PICTURE_HEIGHT = 4000, |
27 }; | 30 }; |
28 protected: | 31 protected: |
29 virtual const char* onGetName() SK_OVERRIDE { | 32 virtual const char* onGetName() SK_OVERRIDE { |
30 return fName.c_str(); | 33 return fName.c_str(); |
31 } | 34 } |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 private: | 168 private: |
166 SkPaint fPaint [ObjCount]; | 169 SkPaint fPaint [ObjCount]; |
167 typedef PictureRecordBench INHERITED; | 170 typedef PictureRecordBench INHERITED; |
168 }; | 171 }; |
169 | 172 |
170 /////////////////////////////////////////////////////////////////////////////// | 173 /////////////////////////////////////////////////////////////////////////////// |
171 | 174 |
172 DEF_BENCH( return new DictionaryRecordBench(); ) | 175 DEF_BENCH( return new DictionaryRecordBench(); ) |
173 DEF_BENCH( return new UniquePaintDictionaryRecordBench(); ) | 176 DEF_BENCH( return new UniquePaintDictionaryRecordBench(); ) |
174 DEF_BENCH( return new RecurringPaintDictionaryRecordBench(); ) | 177 DEF_BENCH( return new RecurringPaintDictionaryRecordBench(); ) |
OLD | NEW |