Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: dm/DM.cpp

Issue 657373002: Make nanobench and dm be usable from Chromium build (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: try with dm.cpp being DM.cpp Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « bench/nanobench_main.cpp ('k') | dm/dm.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
5 #include "LazyDecodeBitmap.h" 4 #include "LazyDecodeBitmap.h"
6 #include "SkCommonFlags.h" 5 #include "SkCommonFlags.h"
7 #include "SkForceLinking.h" 6 #include "SkForceLinking.h"
8 #include "SkGraphics.h" 7 #include "SkGraphics.h"
9 #include "SkOSFile.h" 8 #include "SkOSFile.h"
10 #include "SkPicture.h" 9 #include "SkPicture.h"
11 #include "SkString.h" 10 #include "SkString.h"
12 #include "SkTaskGroup.h" 11 #include "SkTaskGroup.h"
13 #include "Test.h" 12 #include "Test.h"
14 #include "gm.h" 13 #include "gm.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 template <typename T, typename Registry> 179 template <typename T, typename Registry>
181 static void append_matching_factories(Registry* head, SkTDArray<typename Registr y::Factory>* out) { 180 static void append_matching_factories(Registry* head, SkTDArray<typename Registr y::Factory>* out) {
182 for (const Registry* reg = head; reg != NULL; reg = reg->next()) { 181 for (const Registry* reg = head; reg != NULL; reg = reg->next()) {
183 SkAutoTDelete<T> forName(reg->factory()(NULL)); 182 SkAutoTDelete<T> forName(reg->factory()(NULL));
184 if (!SkCommandLineFlags::ShouldSkip(FLAGS_match, forName->getName())) { 183 if (!SkCommandLineFlags::ShouldSkip(FLAGS_match, forName->getName())) {
185 *out->append() = reg->factory(); 184 *out->append() = reg->factory();
186 } 185 }
187 } 186 }
188 } 187 }
189 188
190 int dm_main();
191 int dm_main() { 189 int dm_main() {
192 SetupCrashHandler();
193 SkAutoGraphics ag; 190 SkAutoGraphics ag;
194 SkTaskGroup::Enabler enabled(FLAGS_threads); 191 SkTaskGroup::Enabler enabled(FLAGS_threads);
195 192
196 if (FLAGS_dryRun || FLAGS_veryVerbose) { 193 if (FLAGS_dryRun || FLAGS_veryVerbose) {
197 FLAGS_verbose = true; 194 FLAGS_verbose = true;
198 } 195 }
199 #if SK_ENABLE_INST_COUNT 196 #if SK_ENABLE_INST_COUNT
200 gPrintInstCount = FLAGS_leaks; 197 gPrintInstCount = FLAGS_leaks;
201 #endif 198 #endif
202 199
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 if (FLAGS_portableFonts && FLAGS_reportUsedChars) { 234 if (FLAGS_portableFonts && FLAGS_reportUsedChars) {
238 sk_tool_utils::report_used_chars(); 235 sk_tool_utils::report_used_chars();
239 } 236 }
240 #endif 237 #endif
241 238
242 SkTArray<SkString> failures; 239 SkTArray<SkString> failures;
243 reporter.getFailures(&failures); 240 reporter.getFailures(&failures);
244 report_failures(failures); 241 report_failures(failures);
245 return failures.count() > 0; 242 return failures.count() > 0;
246 } 243 }
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
OLDNEW
« no previous file with comments | « bench/nanobench_main.cpp ('k') | dm/dm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698