diff options
author | Brian Osman <brianosman@google.com> | 2017-05-09 16:36:41 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-09 20:58:41 +0000 |
commit | 25294d76b1c5ca34ba6cc7033ee42af6484b046b (patch) | |
tree | 61ba4d5a8b44f8cb1221703281b0f633e2544c92 /src/gpu/GrPathUtils.h | |
parent | fdf31035a9639c2d377bdf2ddb404d269f8ca42a (diff) |
Pre-clamp path tolerance
GrDefaultPathRenderer was using GrPathUtils::worstCasePointCount, which
clamped the tolerance. Then it built geometry with the unclamped value,
leading to vertex overflow (found by canvas fuzzer). The new rule is if
you use GrPathUtils, your tolerance must come from scaleToleranceToSrc.
Bug: skia:6569
Change-Id: I851519db8e569e570c717033d697f3d4d3d787fb
Reviewed-on: https://skia-review.googlesource.com/16234
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.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/gpu/GrPathUtils.h b/src/gpu/GrPathUtils.h index 7dea3a1353..fdfd375427 100644 --- a/src/gpu/GrPathUtils.h +++ b/src/gpu/GrPathUtils.h @@ -18,18 +18,16 @@ class SkMatrix; * Utilities for evaluating paths. */ namespace GrPathUtils { + // Very small tolerances will be increased to a minimum threshold value, to avoid division + // problems in subsequent math. SkScalar scaleToleranceToSrc(SkScalar devTol, const SkMatrix& viewM, const SkRect& pathBounds); - /// Since we divide by tol if we're computing exact worst-case bounds, - /// very small tolerances will be increased to gMinCurveTol. int worstCasePointCount(const SkPath&, int* subpaths, SkScalar tol); - /// Since we divide by tol if we're computing exact worst-case bounds, - /// very small tolerances will be increased to gMinCurveTol. uint32_t quadraticPointCount(const SkPoint points[], SkScalar tol); uint32_t generateQuadraticPoints(const SkPoint& p0, @@ -39,8 +37,6 @@ namespace GrPathUtils { SkPoint** points, uint32_t pointsLeft); - /// Since we divide by tol if we're computing exact worst-case bounds, - /// very small tolerances will be increased to gMinCurveTol. uint32_t cubicPointCount(const SkPoint points[], SkScalar tol); uint32_t generateCubicPoints(const SkPoint& p0, |