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 <VisualBench/VisualBenchmarkStream.h> | 9 #include <VisualBench/VisualBenchmarkStream.h> |
10 #include "GMBench.h" | 10 #include "GMBench.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 } | 86 } |
87 bench->unref(); | 87 bench->unref(); |
88 } | 88 } |
89 | 89 |
90 while (fGMs) { | 90 while (fGMs) { |
91 SkAutoTDelete<skiagm::GM> gm(fGMs->factory()(NULL)); | 91 SkAutoTDelete<skiagm::GM> gm(fGMs->factory()(NULL)); |
92 fGMs = fGMs->next(); | 92 fGMs = fGMs->next(); |
93 if (gm->runAsBench()) { | 93 if (gm->runAsBench()) { |
94 fSourceType = "gm"; | 94 fSourceType = "gm"; |
95 fBenchType = "micro"; | 95 fBenchType = "micro"; |
96 return SkNEW_ARGS(GMBench, (gm.detach())); | 96 return new GMBench(gm.detach()); |
97 } | 97 } |
98 } | 98 } |
99 | 99 |
100 // Render skps | 100 // Render skps |
101 while (fCurrentSKP < fSKPs.count()) { | 101 while (fCurrentSKP < fSKPs.count()) { |
102 const SkString& path = fSKPs[fCurrentSKP++]; | 102 const SkString& path = fSKPs[fCurrentSKP++]; |
103 SkAutoTUnref<SkPicture> pic; | 103 SkAutoTUnref<SkPicture> pic; |
104 if (!ReadPicture(path.c_str(), &pic)) { | 104 if (!ReadPicture(path.c_str(), &pic)) { |
105 continue; | 105 continue; |
106 } | 106 } |
107 | 107 |
108 SkString name = SkOSPath::Basename(path.c_str()); | 108 SkString name = SkOSPath::Basename(path.c_str()); |
109 fSourceType = "skp"; | 109 fSourceType = "skp"; |
110 fBenchType = "playback"; | 110 fBenchType = "playback"; |
111 return SkNEW_ARGS(VisualSKPBench, (name.c_str(), pic.get())); | 111 return new VisualSKPBench(name.c_str(), pic.get()); |
112 } | 112 } |
113 | 113 |
114 return NULL; | 114 return NULL; |
115 } | 115 } |
OLD | NEW |