aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrPathUtils.h
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-06-20 14:43:58 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-20 19:15:58 +0000
commit49b7b6f38fc9d6cbcfa5865db364ff79c3ed7bfe (patch)
treec4bccaca446ff6b894ba85b42fc4874ce76420ef /src/gpu/GrPathUtils.h
parent6081ebb6892e1779678b9d638f4b2a398e412f00 (diff)
Handle too many (or too large) paths in GrDefaultPathRenderer
PathGeoBuilder constructs the geometry with the same basic technique as before, but allows interrupting the process to emit multiple draws. Original test case was 2000 non-AA stroked circles, which created ~66000 vertices. That now renders, as do various tests with a single large path (as well as filled paths). Added a new set of 'AtLeast' allocators for vertex and index data. These take a minimum size and a fallback size. If the minimum size can be satisfied by an existing block, then the caller gets *all* memory in that block, otherwise they get a new block sized for the fallback amount. The previous allocation scheme wasn't a good fit for the new use-case, and because we don't usually need many verts, the flexible approach seems appropriate. TODO: I think that this could be extracted and re-used for MSAA path renderer without too much work? I need to read that code more carefully to make sure it lines up. Re-land of: https://skia-review.googlesource.com/18360 Re-land of: https://skia-review.googlesource.com/18983 Bug: skia:6695 Change-Id: I09ac1273e5af67ed0e3e886de90e2970c3d0b239 Reviewed-on: https://skia-review.googlesource.com/19480 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrPathUtils.h')
-rw-r--r--src/gpu/GrPathUtils.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gpu/GrPathUtils.h b/src/gpu/GrPathUtils.h
index 49c4ee5805..e9dee7316a 100644
--- a/src/gpu/GrPathUtils.h
+++ b/src/gpu/GrPathUtils.h
@@ -178,5 +178,8 @@ namespace GrPathUtils {
// This value was chosen to approximate the supersampling accuracy of the raster path (16
// samples, or one quarter pixel).
static const SkScalar kDefaultTolerance = SkDoubleToScalar(0.25);
+
+ // We guarantee that no quad or cubic will ever produce more than this many points
+ static const int kMaxPointsPerCurve = 1 << 10;
};
#endif