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

Side by Side Diff: dm/DMJsonWriter.cpp

Issue 788243008: Sketch DM refactor. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: better failure messages, disable a few things temporarily to try to go green Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « dm/DMJsonWriter.h ('k') | dm/DMPDFRasterizeTask.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 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 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 #include "DMJsonWriter.h" 8 #include "DMJsonWriter.h"
9 9
10 #include "SkCommonFlags.h" 10 #include "SkCommonFlags.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 for (int i = 1; i < FLAGS_key.count(); i += 2) { 45 for (int i = 1; i < FLAGS_key.count(); i += 2) {
46 root["key"][FLAGS_key[i-1]] = FLAGS_key[i]; 46 root["key"][FLAGS_key[i-1]] = FLAGS_key[i];
47 } 47 }
48 48
49 { 49 {
50 SkAutoMutexAcquire lock(&gBitmapResultLock); 50 SkAutoMutexAcquire lock(&gBitmapResultLock);
51 for (int i = 0; i < gBitmapResults.count(); i++) { 51 for (int i = 0; i < gBitmapResults.count(); i++) {
52 Json::Value result; 52 Json::Value result;
53 result["key"]["name"] = gBitmapResults[i].name.c_str(); 53 result["key"]["name"] = gBitmapResults[i].name.c_str();
54 result["key"]["config"] = gBitmapResults[i].config.c_str(); 54 result["key"]["config"] = gBitmapResults[i].config.c_str();
55 result["key"]["mode"] = gBitmapResults[i].mode.c_str();
56 result["key"]["source_type"] = gBitmapResults[i].sourceType.c_str(); 55 result["key"]["source_type"] = gBitmapResults[i].sourceType.c_str();
56 result["ext"] = gBitmapResults[i].ext.c_str();
57 result["md5"] = gBitmapResults[i].md5.c_str(); 57 result["md5"] = gBitmapResults[i].md5.c_str();
58 58
59 root["results"].append(result); 59 root["results"].append(result);
60 } 60 }
61 } 61 }
62 62
63 { 63 {
64 SkAutoMutexAcquire lock(gFailureLock); 64 SkAutoMutexAcquire lock(gFailureLock);
65 for (int i = 0; i < gFailures.count(); i++) { 65 for (int i = 0; i < gFailures.count(); i++) {
66 Json::Value result; 66 Json::Value result;
67 result["file_name"] = gFailures[i].fileName; 67 result["file_name"] = gFailures[i].fileName;
68 result["line_no"] = gFailures[i].lineNo; 68 result["line_no"] = gFailures[i].lineNo;
69 result["condition"] = gFailures[i].condition; 69 result["condition"] = gFailures[i].condition;
70 result["message"] = gFailures[i].message.c_str(); 70 result["message"] = gFailures[i].message.c_str();
71 71
72 root["test_results"]["failures"].append(result); 72 root["test_results"]["failures"].append(result);
73 } 73 }
74 } 74 }
75 75
76 SkString path = SkOSPath::Join(FLAGS_writePath[0], "dm.json"); 76 SkString path = SkOSPath::Join(FLAGS_writePath[0], "dm.json");
77 SkFILEWStream stream(path.c_str()); 77 SkFILEWStream stream(path.c_str());
78 stream.writeText(Json::StyledWriter().write(root).c_str()); 78 stream.writeText(Json::StyledWriter().write(root).c_str());
79 stream.flush(); 79 stream.flush();
80 } 80 }
81 81
82 } // namespace DM 82 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DMJsonWriter.h ('k') | dm/DMPDFRasterizeTask.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698