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

Unified Diff: dm/DM.cpp

Issue 309483003: DM tweaks (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: note Created 6 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | dm/DMReporter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DM.cpp
diff --git a/dm/DM.cpp b/dm/DM.cpp
index c65e1e7c99c82b68555658580cf050386071c15e..f71a614ad780ad5051439cb0608804ecf6586009 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -182,10 +182,7 @@ static void kick_off_skps(DM::Reporter* reporter, DM::TaskRunner* tasks) {
}
}
-static void report_failures(const DM::Reporter& reporter) {
- SkTArray<SkString> failures;
- reporter.getFailures(&failures);
-
+static void report_failures(const SkTArray<SkString>& failures) {
if (failures.count() == 0) {
return;
}
@@ -194,6 +191,7 @@ static void report_failures(const DM::Reporter& reporter) {
for (int i = 0; i < failures.count(); i++) {
SkDebugf(" %s\n", failures[i].c_str());
}
+ SkDebugf("%d failures.\n", failures.count());
}
template <typename T, typename Registry>
@@ -208,7 +206,7 @@ static void append_matching_factories(Registry* head, SkTDArray<typename Registr
int tool_main(int argc, char** argv);
int tool_main(int argc, char** argv) {
- SkGraphics::Init();
+ SkAutoGraphics ag;
SkCommandLineFlags::Parse(argc, argv);
#if SK_ENABLE_INST_COUNT
gPrintInstCount = FLAGS_leaks;
@@ -260,11 +258,11 @@ int tool_main(int argc, char** argv) {
tasks.wait();
SkDebugf("\n");
- report_failures(reporter);
- SkGraphics::Term();
-
- return reporter.failed() > 0;
+ SkTArray<SkString> failures;
+ reporter.getFailures(&failures);
+ report_failures(failures);
+ return failures.count() > 0;
}
#if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL)
« no previous file with comments | « no previous file | dm/DMReporter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698