00b621cfc0
This should be a drop-in replacement for most for-loops to make them run in parallel: for (int i = 0; i < N; i++) { code... } ~~~> sk_parallel_for(N, [&](int i) { code... }); This is just syntax sugar over SkTaskGroup to make this use case really easy to write. There's no more overhead that we weren't already forced to add using an interface like batch(), and no extra heap allocations. I've replaced 3 uses of SkTaskGroup with sk_parallel_for: 1) My unit tests for SkOnce. 2) Cary's path fuzzer. 3) SkMultiPictureDraw. Performance should be the same. Please compare left and right for readability. :) BUG=skia: No public API changes. TBR=reed@google.com Review URL: https://codereview.chromium.org/1184373003 |
||
---|---|---|
.. | ||
diff_viewer.js | ||
generate_pmetric_tables.py | ||
README | ||
SkCLImageDiffer.cpp | ||
SkCLImageDiffer.h | ||
SkDiffContext.cpp | ||
SkDiffContext.h | ||
SkDifferentPixelsMetric_cpu.cpp | ||
SkDifferentPixelsMetric_opencl.cpp | ||
SkDifferentPixelsMetric.h | ||
SkImageDiffer.cpp | ||
SkImageDiffer.h | ||
skpdiff_main.cpp | ||
skpdiff_server.py | ||
skpdiff_util.cpp | ||
skpdiff_util.h | ||
SkPMetric.cpp | ||
SkPMetric.h | ||
SkPMetricUtil_generated.h | ||
viewer_style.css | ||
viewer.html |
Some example invocations: Note how the asterisks are not expanded inside the shell because of the quotes out/Debug/skpdiff -p \ "/usr/local/google/home/zachr/Downloads/gm/*_8888.png" \ "/usr/local/google/home/zachr/Downloads/gm/*_gpu.png" out/Debug/skpdiff --differs different_pixels -f \ "/usr/local/google/home/zachr/Downloads/diffs/baseline" \ "/usr/local/google/home/zachr/Downloads/diffs/test"