OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 */ | 7 */ |
8 | 8 |
9 #include "VisualSKPBench.h" | 9 #include "VisualSKPBench.h" |
10 | 10 |
11 VisualSKPBench::VisualSKPBench(const char* name, const SkPicture* pic) | 11 VisualSKPBench::VisualSKPBench(const char* name, const SkPicture* pic) |
12 : fPic(SkRef(pic)) | 12 : fPic(SkRef(pic)) |
13 , fName(name) { | 13 , fName(name) { |
14 fUniqueName.printf("%s", name); | 14 fUniqueName.printf("%s", name); |
15 } | 15 } |
16 | 16 |
17 const char* VisualSKPBench::onGetName() { | 17 const char* VisualSKPBench::onGetName() { |
18 return fName.c_str(); | 18 return fName.c_str(); |
19 } | 19 } |
20 | 20 |
21 const char* VisualSKPBench::onGetUniqueName() { | 21 const char* VisualSKPBench::onGetUniqueName() { |
22 return fUniqueName.c_str(); | 22 return fUniqueName.c_str(); |
23 } | 23 } |
24 | 24 |
25 bool VisualSKPBench::isSuitableFor(Backend backend) { | 25 bool VisualSKPBench::isSuitableFor(Backend backend) { |
26 return backend != kNonRendering_Backend; | 26 return backend != kNonRendering_Backend; |
27 } | 27 } |
28 | 28 |
29 void VisualSKPBench::onDraw(const int loops, SkCanvas* canvas) { | 29 void VisualSKPBench::onDraw(int loops, SkCanvas* canvas) { |
30 for (int i = 0; i < loops; i++) { | 30 for (int i = 0; i < loops; i++) { |
31 canvas->drawPicture(fPic); | 31 canvas->drawPicture(fPic); |
32 } | 32 } |
33 } | 33 } |
OLD | NEW |