From f9810666bd40db8fb1650e6c727c1a83b8090136 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Wed, 30 Aug 2017 10:02:10 -0400 Subject: Threaded generation of software paths Re-land of: https://skia-review.googlesource.com/36560 All information needed by the thread is captured by the prepare callback object, the lambda captures a pointer to that, and does the mask render. Once it's done, it signals the semaphore (also owned by the callback). The callback defers the semaphore wait even longer (into the ASAP upload), so the odds of waiting for the thread are REALLY low. Also did a bunch of cleanup along the way, and put in some trace markers so we can monitor how well this is working. Traces of a GM that includes GPU and SW path rendering (path-reverse): Original: https://screenshot.googleplex.com/f5BG3901tQg.png Threaded, with wait in the callback (notice pre flush callback blocking): https://screenshot.googleplex.com/htOSZFE2s04.png Current version, with wait deferred to ASAP upload function: https://screenshot.googleplex.com/GHjD0U3C34q.png Bug: skia: Change-Id: Idb92f385590749f41328a9aec65b2a93f4775079 Reviewed-on: https://skia-review.googlesource.com/40775 Reviewed-by: Brian Salomon Commit-Queue: Brian Osman --- bench/nanobench.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bench/nanobench.cpp') diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp index 95977c53cb..bd23c3e39a 100644 --- a/bench/nanobench.cpp +++ b/bench/nanobench.cpp @@ -30,6 +30,7 @@ #include "SkCodec.h" #include "SkCommonFlags.h" #include "SkCommonFlagsConfig.h" +#include "SkCommonFlagsGpuThreads.h" #include "SkCommonFlagsPathRenderer.h" #include "SkData.h" #include "SkDebugfTracer.h" @@ -1141,6 +1142,7 @@ int main(int argc, char** argv) { #if SK_SUPPORT_GPU GrContextOptions grContextOpts; grContextOpts.fGpuPathRenderers = CollectGpuPathRenderersFromFlags(); + grContextOpts.fExecutor = GpuExecutorForTools(); gGrFactory.reset(new GrContextFactory(grContextOpts)); #endif -- cgit v1.2.3