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/GrPathRendering.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/GrPathRendering.h')
-rw-r--r-- | src/gpu/GrPathRendering.h | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/gpu/GrPathRendering.h b/src/gpu/GrPathRendering.h index 8ee3d7b3e2..ca81b8f08f 100644 --- a/src/gpu/GrPathRendering.h +++ b/src/gpu/GrPathRendering.h @@ -153,17 +153,6 @@ public: this->onStencilPath(args, path); } - void drawPath(const GrPipeline& pipeline, - const GrPrimitiveProcessor& primProc, - const GrStencilSettings& stencil, - const GrPath* path) { - fGpu->handleDirtyContext(); - if (GrXferBarrierType barrierType = pipeline.xferBarrierType(*fGpu->caps())) { - fGpu->xferBarrier(pipeline.getRenderTarget(), barrierType); - } - this->onDrawPath(pipeline, primProc, stencil, path); - } - void drawPaths(const GrPipeline& pipeline, const GrPrimitiveProcessor& primProc, const GrStencilSettings& stencil, @@ -184,15 +173,23 @@ public: transformValues, transformType, count); } + void drawPaths(const GrPipeline& pipeline, + const GrPrimitiveProcessor& primProc, + const GrStencilSettings& stencil, + const GrPath* const* paths, + int count) { + fGpu->handleDirtyContext(); + if (GrXferBarrierType barrierType = pipeline.xferBarrierType(*fGpu->caps())) { + fGpu->xferBarrier(pipeline.getRenderTarget(), barrierType); + } + this->onDrawPaths(pipeline, primProc, stencil, paths, count); + } + protected: GrPathRendering(GrGpu* gpu) : fGpu(gpu) { } virtual void onStencilPath(const StencilPathArgs&, const GrPath*) = 0; - virtual void onDrawPath(const GrPipeline&, - const GrPrimitiveProcessor&, - const GrStencilSettings&, - const GrPath*) = 0; virtual void onDrawPaths(const GrPipeline&, const GrPrimitiveProcessor&, const GrStencilSettings&, @@ -202,6 +199,11 @@ protected: const float transformValues[], PathTransformType, int count) = 0; + virtual void onDrawPaths(const GrPipeline&, + const GrPrimitiveProcessor&, + const GrStencilSettings&, + const GrPath* const*, + int count) = 0; GrGpu* fGpu; private: |