diff options
author | kkinnunen <kkinnunen@nvidia.com> | 2016-04-25 02:16:09 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-25 02:16:09 -0700 |
commit | 3c33c389e9f8d14d86756ea1ddeba2097f31ad22 (patch) | |
tree | 60ad01611125141b6abd8fff8f4ad00dabb4f9a8 /src/gpu/GrPath.h | |
parent | c4ce72fc15b109c40ad5ba46b06a17209b2a750e (diff) |
Batch multiple single NVPR draw paths to instanced draws
Batch multiple single NVPR draw paths to instanced draws.
A draw path batch can be combined to other batch if the
batches do not overlap and have same draw characteristics.
Join the batches in linked list and flatten the list to a
path list during draw time.
Replace GrPathRendering::drawPath with GrPathRendering::drawPaths.
Perf changes ARM, Shield TV device, Tegra X1 GPU:
desk_chalkboard.skp_1 21.5ms -> 17.8ms 0.83x
desk_mapsvg.skp_1 7.49ms -> 6.18ms 0.82x
Others results are more volatile.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1908433002
Review URL: https://codereview.chromium.org/1908433002
Diffstat (limited to 'src/gpu/GrPath.h')
-rw-r--r-- | src/gpu/GrPath.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gpu/GrPath.h b/src/gpu/GrPath.h index 4cb12f4325..975dad0afd 100644 --- a/src/gpu/GrPath.h +++ b/src/gpu/GrPath.h @@ -36,6 +36,18 @@ public: const SkRect& getBounds() const { return fBounds; } GrPathRendering::FillType getFillType() const { return fFillType; } + + /** + * Returns true if a path can be drawn in the same draw paths operation as the other + * path. Should return true only when the condition holds transitively with all other paths in + * the same group. + * E.g. + * canCombineDrawPathBatchWith(a) AND canCombineDrawPathBatchWith(b) + * canCombineDrawPathBatchWith(a) AND canCombineDrawPathBatchWith(c) + * implies + * canCombineDrawPathBatchWith(b) AND canCombineDrawPathBatchWith(c) + */ + virtual bool canCombineDrawPathBatchWith(const GrPath& other) const = 0; #ifdef SK_DEBUG bool isEqualTo(const SkPath& path, const GrStrokeInfo& stroke) const; #endif |