Index: tools/skpdiff/SkDifferentPixelsMetric_cpu.cpp |
diff --git a/tools/skpdiff/SkDifferentPixelsMetric_cpu.cpp b/tools/skpdiff/SkDifferentPixelsMetric_cpu.cpp |
index 4e5e93969c3f743ecc6024bbba9576a06a3791ef..ddc36eae21ab4ed078e8bfb6e847f6c389afb5bf 100644 |
--- a/tools/skpdiff/SkDifferentPixelsMetric_cpu.cpp |
+++ b/tools/skpdiff/SkDifferentPixelsMetric_cpu.cpp |
@@ -24,8 +24,14 @@ const char* SkDifferentPixelsMetric::getName() { |
int SkDifferentPixelsMetric::queueDiff(SkBitmap* baseline, SkBitmap* test) { |
double startTime = get_seconds(); |
+ |
+ // since we currently synchronously do the diff within queueDiff we only need |
+ // to protect the createion of the ID and queuedDiff object. |
+ SkAutoMutexAcquire queueLock(fQueueMutex); |
int diffID = fQueuedDiffs.count(); |
QueuedDiff* diff = fQueuedDiffs.push(); |
+ queueLock.release(); |
+ |
SkTDArray<SkIPoint>* poi = diff->poi = new SkTDArray<SkIPoint>(); |
// If we never end up running the kernel, include some safe defaults in the result. |