OLD | NEW |
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 "ProcStats.h" | 10 #include "ProcStats.h" |
11 #include "SkCommonFlags.h" | 11 #include "SkCommonFlags.h" |
12 #include "SkData.h" | 12 #include "SkData.h" |
13 #include "SkJSONCPP.h" | 13 #include "SkJSONCPP.h" |
14 #include "SkMutex.h" | 14 #include "SkMutex.h" |
15 #include "SkOSFile.h" | 15 #include "SkOSFile.h" |
16 #include "SkStream.h" | 16 #include "SkStream.h" |
17 #include "SkTArray.h" | 17 #include "SkTArray.h" |
18 | 18 |
19 namespace DM { | 19 namespace DM { |
20 | 20 |
21 SkTArray<JsonWriter::BitmapResult> gBitmapResults; | 21 SkTArray<JsonWriter::BitmapResult> gBitmapResults; |
22 SK_DECLARE_STATIC_MUTEX(gBitmapResultLock); | 22 static SkMutex gBitmapResultLock; |
23 | 23 |
24 void JsonWriter::AddBitmapResult(const BitmapResult& result) { | 24 void JsonWriter::AddBitmapResult(const BitmapResult& result) { |
25 SkAutoMutexAcquire lock(&gBitmapResultLock); | 25 SkAutoMutexAcquire lock(&gBitmapResultLock); |
26 gBitmapResults.push_back(result); | 26 gBitmapResults.push_back(result); |
27 } | 27 } |
28 | 28 |
29 SkTArray<skiatest::Failure> gFailures; | 29 SkTArray<skiatest::Failure> gFailures; |
30 SK_DECLARE_STATIC_MUTEX(gFailureLock); | 30 static SkMutex gFailureLock; |
31 | 31 |
32 void JsonWriter::AddTestFailure(const skiatest::Failure& failure) { | 32 void JsonWriter::AddTestFailure(const skiatest::Failure& failure) { |
33 SkAutoMutexAcquire lock(gFailureLock); | 33 SkAutoMutexAcquire lock(gFailureLock); |
34 gFailures.push_back(failure); | 34 gFailures.push_back(failure); |
35 } | 35 } |
36 | 36 |
37 void JsonWriter::DumpJson() { | 37 void JsonWriter::DumpJson() { |
38 if (FLAGS_writePath.isEmpty()) { | 38 if (FLAGS_writePath.isEmpty()) { |
39 return; | 39 return; |
40 } | 40 } |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 120 |
121 if (!r["key"]["source_options"].isNull()) { | 121 if (!r["key"]["source_options"].isNull()) { |
122 br.sourceOptions = r["key"]["source_options"].asCString(); | 122 br.sourceOptions = r["key"]["source_options"].asCString(); |
123 } | 123 } |
124 callback(br); | 124 callback(br); |
125 } | 125 } |
126 return true; | 126 return true; |
127 } | 127 } |
128 | 128 |
129 } // namespace DM | 129 } // namespace DM |
OLD | NEW |