OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 #ifndef SkDiffContext_DEFINED | 8 #ifndef SkDiffContext_DEFINED |
9 #define SkDiffContext_DEFINED | 9 #define SkDiffContext_DEFINED |
10 | 10 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 }; | 117 }; |
118 | 118 |
119 struct DiffRecord { | 119 struct DiffRecord { |
120 SkString fCommonName; | 120 SkString fCommonName; |
121 SkString fDifferencePath; | 121 SkString fDifferencePath; |
122 SkString fBaselinePath; | 122 SkString fBaselinePath; |
123 SkString fTestPath; | 123 SkString fTestPath; |
124 SkTArray<DiffData> fDiffs; | 124 SkTArray<DiffData> fDiffs; |
125 }; | 125 }; |
126 | 126 |
127 // This is needed to work around a bug in the multithreaded case where the | |
128 // image decoders are crashing when large numbers of threads are invoking | |
129 // the decoder at the same time. | |
130 // see https://code.google.com/p/skia/issues/detail?id=1803 | |
131 SkMutex fImageMutex; | |
132 | |
133 // Used to protect access to fRecords and ensure only one thread is | 127 // Used to protect access to fRecords and ensure only one thread is |
134 // adding new entries at a time. | 128 // adding new entries at a time. |
135 SkMutex fRecordMutex; | 129 SkMutex fRecordMutex; |
136 | 130 |
137 // We use linked list for the records so that their pointers remain stable.
A resizable array | 131 // We use linked list for the records so that their pointers remain stable.
A resizable array |
138 // might change its pointers, which would make it harder for async diffs to
record their | 132 // might change its pointers, which would make it harder for async diffs to
record their |
139 // results. | 133 // results. |
140 SkTLList<DiffRecord> fRecords; | 134 SkTLList<DiffRecord> fRecords; |
141 | 135 |
142 SkImageDiffer** fDiffers; | 136 SkImageDiffer** fDiffers; |
143 int fDifferCount; | 137 int fDifferCount; |
144 int fThreadCount; | 138 int fThreadCount; |
145 | 139 |
146 SkString fDifferenceDir; | 140 SkString fDifferenceDir; |
147 }; | 141 }; |
148 | 142 |
149 #endif | 143 #endif |
OLD | NEW |