Chromium Code Reviews| Index: tools/skpdiff/SkDifferentPixelsMetric_opencl.cpp |
| diff --git a/tools/skpdiff/SkDifferentPixelsMetric_opencl.cpp b/tools/skpdiff/SkDifferentPixelsMetric_opencl.cpp |
| index b3f5d2d7e0b00c70fb813e5b73ca4df3b5b9430d..2fe5999b734cfc2438d21db1324fe93482718ab4 100644 |
| --- a/tools/skpdiff/SkDifferentPixelsMetric_opencl.cpp |
| +++ b/tools/skpdiff/SkDifferentPixelsMetric_opencl.cpp |
| @@ -52,9 +52,14 @@ bool SkDifferentPixelsMetric::enablePOIAlphaMask() { |
| } |
| int SkDifferentPixelsMetric::queueDiff(SkBitmap* baseline, SkBitmap* test) { |
| - int diffID = fQueuedDiffs.count(); |
| 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. |
|
scroggo
2013/11/07 21:43:23
creation*
|
| + SkAutoMutexAcquire queueLock(fQueueMutex); |
| + int diffID = fQueuedDiffs.count(); |
| QueuedDiff* diff = fQueuedDiffs.push(); |
| + queueLock.release(); |
| // If we never end up running the kernel, include some safe defaults in the result. |
| diff->finished = false; |