OLD | NEW |
1 // Main binary for DM. | 1 // Main binary for DM. |
2 // For a high-level overview, please see dm/README. | 2 // For a high-level overview, please see dm/README. |
3 | 3 |
| 4 #include "CrashHandler.h" |
4 #include "LazyDecodeBitmap.h" | 5 #include "LazyDecodeBitmap.h" |
5 #include "SkCommonFlags.h" | 6 #include "SkCommonFlags.h" |
6 #include "SkForceLinking.h" | 7 #include "SkForceLinking.h" |
7 #include "SkGraphics.h" | 8 #include "SkGraphics.h" |
8 #include "SkOSFile.h" | 9 #include "SkOSFile.h" |
9 #include "SkPicture.h" | 10 #include "SkPicture.h" |
10 #include "SkString.h" | 11 #include "SkString.h" |
11 #include "SkTaskGroup.h" | 12 #include "SkTaskGroup.h" |
12 #include "Test.h" | 13 #include "Test.h" |
13 #include "gm.h" | 14 #include "gm.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 template <typename T, typename Registry> | 180 template <typename T, typename Registry> |
180 static void append_matching_factories(Registry* head, SkTDArray<typename Registr
y::Factory>* out) { | 181 static void append_matching_factories(Registry* head, SkTDArray<typename Registr
y::Factory>* out) { |
181 for (const Registry* reg = head; reg != NULL; reg = reg->next()) { | 182 for (const Registry* reg = head; reg != NULL; reg = reg->next()) { |
182 SkAutoTDelete<T> forName(reg->factory()(NULL)); | 183 SkAutoTDelete<T> forName(reg->factory()(NULL)); |
183 if (!SkCommandLineFlags::ShouldSkip(FLAGS_match, forName->getName())) { | 184 if (!SkCommandLineFlags::ShouldSkip(FLAGS_match, forName->getName())) { |
184 *out->append() = reg->factory(); | 185 *out->append() = reg->factory(); |
185 } | 186 } |
186 } | 187 } |
187 } | 188 } |
188 | 189 |
| 190 int dm_main(); |
189 int dm_main() { | 191 int dm_main() { |
| 192 SetupCrashHandler(); |
190 SkAutoGraphics ag; | 193 SkAutoGraphics ag; |
191 SkTaskGroup::Enabler enabled(FLAGS_threads); | 194 SkTaskGroup::Enabler enabled(FLAGS_threads); |
192 | 195 |
193 if (FLAGS_dryRun || FLAGS_veryVerbose) { | 196 if (FLAGS_dryRun || FLAGS_veryVerbose) { |
194 FLAGS_verbose = true; | 197 FLAGS_verbose = true; |
195 } | 198 } |
196 #if SK_ENABLE_INST_COUNT | 199 #if SK_ENABLE_INST_COUNT |
197 gPrintInstCount = FLAGS_leaks; | 200 gPrintInstCount = FLAGS_leaks; |
198 #endif | 201 #endif |
199 | 202 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 if (FLAGS_portableFonts && FLAGS_reportUsedChars) { | 237 if (FLAGS_portableFonts && FLAGS_reportUsedChars) { |
235 sk_tool_utils::report_used_chars(); | 238 sk_tool_utils::report_used_chars(); |
236 } | 239 } |
237 #endif | 240 #endif |
238 | 241 |
239 SkTArray<SkString> failures; | 242 SkTArray<SkString> failures; |
240 reporter.getFailures(&failures); | 243 reporter.getFailures(&failures); |
241 report_failures(failures); | 244 report_failures(failures); |
242 return failures.count() > 0; | 245 return failures.count() > 0; |
243 } | 246 } |
| 247 |
| 248 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
| 249 int main(int argc, char** argv) { |
| 250 SkCommandLineFlags::Parse(argc, argv); |
| 251 return dm_main(); |
| 252 } |
| 253 #endif |
OLD | NEW |