aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/flags/SkCommonFlagsConfig.h
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-08-24 10:36:00 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-24 15:22:57 +0000
commit76323bc0615044a5921afef0e19a350f3d04ffe0 (patch)
tree230a9802ad885756532c2c9ec233264b6526985a /tools/flags/SkCommonFlagsConfig.h
parent81da18c427145f48a99093323dcf311e330e676c (diff)
Threaded generation of software paths
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: I3d5a230bbd68eb35e1f0574b308485c691435790 Reviewed-on: https://skia-review.googlesource.com/36560 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tools/flags/SkCommonFlagsConfig.h')
-rw-r--r--tools/flags/SkCommonFlagsConfig.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/flags/SkCommonFlagsConfig.h b/tools/flags/SkCommonFlagsConfig.h
index 77f31c32c2..18b138c468 100644
--- a/tools/flags/SkCommonFlagsConfig.h
+++ b/tools/flags/SkCommonFlagsConfig.h
@@ -56,7 +56,8 @@ class SkCommandLineConfigGpu : public SkCommandLineConfig {
SkCommandLineConfigGpu(const SkString& tag, const SkTArray<SkString>& viaParts,
ContextType contextType, bool useNVPR, bool useInstanced, bool useDIText,
int samples, SkColorType colorType, SkAlphaType alphaType,
- sk_sp<SkColorSpace> colorSpace, bool useStencilBuffers);
+ sk_sp<SkColorSpace> colorSpace, bool useStencilBuffers,
+ bool testThreading);
const SkCommandLineConfigGpu* asConfigGpu() const override { return this; }
ContextType getContextType() const { return fContextType; }
ContextOverrides getContextOverrides() const { return fContextOverrides; }
@@ -71,6 +72,7 @@ class SkCommandLineConfigGpu : public SkCommandLineConfig {
SkColorType getColorType() const { return fColorType; }
SkAlphaType getAlphaType() const { return fAlphaType; }
SkColorSpace* getColorSpace() const { return fColorSpace.get(); }
+ bool getTestThreading() const { return fTestThreading; }
private:
ContextType fContextType;
@@ -80,6 +82,7 @@ class SkCommandLineConfigGpu : public SkCommandLineConfig {
SkColorType fColorType;
SkAlphaType fAlphaType;
sk_sp<SkColorSpace> fColorSpace;
+ bool fTestThreading;
};
#endif