Add a simple atlas to the GPU tessellation path renderer
If a path is small and simple enough, we now try to atlas it. There
is only one atlas and it caps at 2048x2048. Once it runs out of room,
everything just draws direct. The atlas is rendered using the existing
GrTessellatePathOp. It provides alpha8 coverage even for msaa render
targets.
Change-Id: I715da9ce7347b6f1ef8e28b3e13ab47f6eade1c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268724
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrPathRendererChain.cpp b/src/gpu/GrPathRendererChain.cpp
index 34d6931..54fc45a 100644
--- a/src/gpu/GrPathRendererChain.cpp
+++ b/src/gpu/GrPathRendererChain.cpp
@@ -33,7 +33,9 @@
}
if (options.fGpuPathRenderers & GpuPathRenderers::kGpuTessellation) {
if (caps.shaderCaps()->tessellationSupport()) {
- fChain.push_back(sk_make_sp<GrGpuTessellationPathRenderer>());
+ auto gtess = sk_make_sp<GrGpuTessellationPathRenderer>(caps);
+ context->priv().addOnFlushCallbackObject(gtess.get());
+ fChain.push_back(std::move(gtess));
}
}
if (options.fGpuPathRenderers & GpuPathRenderers::kAAConvex) {