| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 #include "SkBenchmark.h" | 8 #include "SkBenchmark.h" |
| 9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 fPath.lineTo(pts[1]); | 47 fPath.lineTo(pts[1]); |
| 48 break; | 48 break; |
| 49 case 3: | 49 case 3: |
| 50 fPath.quadTo(pts[1], pts[2]); | 50 fPath.quadTo(pts[1], pts[2]); |
| 51 break; | 51 break; |
| 52 case 4: | 52 case 4: |
| 53 fPath.cubicTo(pts[1], pts[2], pts[3]); | 53 fPath.cubicTo(pts[1], pts[2], pts[3]); |
| 54 break; | 54 break; |
| 55 } | 55 } |
| 56 } | 56 } |
| 57 } |
| 57 | 58 |
| 58 fIsRendering = false; | 59 virtual bool isSuitableFor(Backend backend) SK_OVERRIDE { |
| 60 return backend == kNonRendering_Backend; |
| 59 } | 61 } |
| 60 | 62 |
| 61 protected: | 63 protected: |
| 62 virtual const char* onGetName() SK_OVERRIDE { | 64 virtual const char* onGetName() SK_OVERRIDE { |
| 63 return fName.c_str(); | 65 return fName.c_str(); |
| 64 } | 66 } |
| 65 | 67 |
| 66 virtual void onDraw(SkCanvas*) SK_OVERRIDE { | 68 virtual void onDraw(SkCanvas*) SK_OVERRIDE { |
| 67 if (fRaw) { | 69 if (fRaw) { |
| 68 for (int i = 0; i < this->getLoops(); ++i) { | 70 for (int i = 0; i < this->getLoops(); ++i) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 84 } | 86 } |
| 85 | 87 |
| 86 private: | 88 private: |
| 87 typedef SkBenchmark INHERITED; | 89 typedef SkBenchmark INHERITED; |
| 88 }; | 90 }; |
| 89 | 91 |
| 90 /////////////////////////////////////////////////////////////////////////////// | 92 /////////////////////////////////////////////////////////////////////////////// |
| 91 | 93 |
| 92 DEF_BENCH( return new PathIterBench(false); ) | 94 DEF_BENCH( return new PathIterBench(false); ) |
| 93 DEF_BENCH( return new PathIterBench(true); ) | 95 DEF_BENCH( return new PathIterBench(true); ) |
| OLD | NEW |