GrTessellator: add a #define for max aa verb count.

We'd like to increase the maximum verb count for the edge-AA
tessellating path renderer. In order to protect clients from this
change, we allow them to set their own value.

Bug:805031
Change-Id: I5d41059a217f059998d418d51fcc8c88464ef4da
Reviewed-on: https://skia-review.googlesource.com/98886
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This commit is contained in:
Stephen White 2018-01-23 15:35:05 -05:00 committed by Skia Commit-Bot
parent 37834c85b8
commit a7701e032b

View File

@ -24,6 +24,10 @@
#include <stdio.h>
#ifndef GR_AA_TESSELLATOR_MAX_VERB_COUNT
#define GR_AA_TESSELLATOR_MAX_VERB_COUNT 10
#endif
/*
* This path renderer tessellates the path into triangles using GrTessellator, uploads the
* triangles to a vertex buffer, and renders them with a single draw call. It can do screenspace
@ -147,7 +151,7 @@ GrTessellatingPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
if (GrAAType::kCoverage == args.fAAType) {
SkPath path;
args.fShape->asPath(&path);
if (path.countVerbs() > 10) {
if (path.countVerbs() > GR_AA_TESSELLATOR_MAX_VERB_COUNT) {
return CanDrawPath::kNo;
}
} else if (!args.fShape->hasUnstyledKey()) {