From 9acfc6cac2c68ab48121b321ad4e2d14f03224c7 Mon Sep 17 00:00:00 2001 From: Chris Dalton Date: Thu, 26 Jul 2018 12:34:49 -0600 Subject: Add kAAHairline to GpuPathRenderers With the upcoming ccpr stroking, this will no longer be the only path renderer that can handle hairlines. Bug: skia: Change-Id: I45b30ccd578bee1388a3a07a234af76a19768de6 Reviewed-on: https://skia-review.googlesource.com/142272 Commit-Queue: Chris Dalton Reviewed-by: Brian Osman Reviewed-by: Brian Salomon --- src/gpu/GrPathRendererChain.cpp | 7 +++---- src/gpu/GrPathRendererChain.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gpu/GrPathRendererChain.cpp b/src/gpu/GrPathRendererChain.cpp index 6301045cb7..60c935ab08 100644 --- a/src/gpu/GrPathRendererChain.cpp +++ b/src/gpu/GrPathRendererChain.cpp @@ -34,10 +34,6 @@ GrPathRendererChain::GrPathRendererChain(GrContext* context, const Options& opti fChain.push_back(std::move(pr)); } } - - // AA hairline path renderer is very specialized - no other renderer can do this job well - fChain.push_back(sk_make_sp()); - if (options.fGpuPathRenderers & GpuPathRenderers::kCoverageCounting) { using AllowCaching = GrCoverageCountingPathRenderer::AllowCaching; if (auto ccpr = GrCoverageCountingPathRenderer::CreateIfSupported( @@ -47,6 +43,9 @@ GrPathRendererChain::GrPathRendererChain(GrContext* context, const Options& opti fChain.push_back(std::move(ccpr)); } } + if (options.fGpuPathRenderers & GpuPathRenderers::kAAHairline) { + fChain.push_back(sk_make_sp()); + } if (options.fGpuPathRenderers & GpuPathRenderers::kAAConvex) { fChain.push_back(sk_make_sp()); } diff --git a/src/gpu/GrPathRendererChain.h b/src/gpu/GrPathRendererChain.h index 14200cecce..e36845034d 100644 --- a/src/gpu/GrPathRendererChain.h +++ b/src/gpu/GrPathRendererChain.h @@ -28,7 +28,7 @@ class GrPathRendererChain : public SkNoncopyable { public: struct Options { bool fAllowPathMaskCaching = false; - GpuPathRenderers fGpuPathRenderers = GpuPathRenderers::kDefault; + GpuPathRenderers fGpuPathRenderers = GpuPathRenderers::kAll; }; GrPathRendererChain(GrContext* context, const Options&); -- cgit v1.2.3