| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 return fName.c_str(); | 65 return fName.c_str(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 virtual void onDraw(SkCanvas*) SK_OVERRIDE { | 68 virtual void onDraw(SkCanvas*) SK_OVERRIDE { |
| 69 if (fRaw) { | 69 if (fRaw) { |
| 70 for (int i = 0; i < N; ++i) { | 70 for (int i = 0; i < N; ++i) { |
| 71 SkPath::RawIter iter(fPath); | 71 SkPath::RawIter iter(fPath); |
| 72 SkPath::Verb verb; | 72 SkPath::Verb verb; |
| 73 SkPoint pts[4]; | 73 SkPoint pts[4]; |
| 74 | 74 |
| 75 while ((verb = iter.next(pts)) != SkPath::kDone_Verb); | 75 while ((verb = iter.next(pts)) != SkPath::kDone_Verb) { } |
| 76 } | 76 } |
| 77 } else { | 77 } else { |
| 78 for (int i = 0; i < N; ++i) { | 78 for (int i = 0; i < N; ++i) { |
| 79 SkPath::Iter iter(fPath, false); | 79 SkPath::Iter iter(fPath, false); |
| 80 SkPath::Verb verb; | 80 SkPath::Verb verb; |
| 81 SkPoint pts[4]; | 81 SkPoint pts[4]; |
| 82 | 82 |
| 83 while ((verb = iter.next(pts)) != SkPath::kDone_Verb); | 83 while ((verb = iter.next(pts)) != SkPath::kDone_Verb) { } |
| 84 } | 84 } |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 | 87 |
| 88 private: | 88 private: |
| 89 typedef SkBenchmark INHERITED; | 89 typedef SkBenchmark INHERITED; |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 /////////////////////////////////////////////////////////////////////////////// | 92 /////////////////////////////////////////////////////////////////////////////// |
| 93 | 93 |
| 94 static SkBenchmark* F0(void* p) { return new PathIterBench(p, false); } | 94 static SkBenchmark* F0(void* p) { return new PathIterBench(p, false); } |
| 95 static SkBenchmark* F1(void* p) { return new PathIterBench(p, true); } | 95 static SkBenchmark* F1(void* p) { return new PathIterBench(p, true); } |
| 96 | 96 |
| 97 static BenchRegistry gR0(F0); | 97 static BenchRegistry gR0(F0); |
| 98 static BenchRegistry gR1(F1); | 98 static BenchRegistry gR1(F1); |
| OLD | NEW |