diff options
author | 2017-02-16 10:01:46 -0500 | |
---|---|---|
committer | 2017-02-16 15:37:53 +0000 | |
commit | d25cc9b54842271a14450f81c238ea6d27abdd90 (patch) | |
tree | 12b101b8edd18ffffc75d964107e0868844337a0 /src | |
parent | 3befb84efc3deba472849d76af96c6f56060b918 (diff) |
Fix DistanceFieldPathRenderer assert.
If there's a reflection in the matrix, the scales
could be negative.
BUG=chromium:682918
Change-Id: Ifde42c3bc8b1f2938009b47d3a8380cf871448e9
Reviewed-on: https://skia-review.googlesource.com/8541
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/ops/GrAADistanceFieldPathRenderer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp b/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp index 7131e18a46..17cd24421e 100644 --- a/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp +++ b/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp @@ -119,8 +119,8 @@ bool GrAADistanceFieldPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) c SkRect bounds = args.fShape->styledBounds(); SkScalar minDim = SkMinScalar(bounds.width(), bounds.height()); SkScalar maxDim = SkMaxScalar(bounds.width(), bounds.height()); - SkScalar minSize = minDim * scaleFactors[0]; - SkScalar maxSize = maxDim * scaleFactors[1]; + SkScalar minSize = minDim * SkScalarAbs(scaleFactors[0]); + SkScalar maxSize = maxDim * SkScalarAbs(scaleFactors[1]); return maxDim <= kMaxDim && kMinSize <= minSize && maxSize <= kMaxSize; } @@ -245,7 +245,7 @@ private: const Entry& args = fShapes[i]; // get mip level - SkScalar maxScale = this->viewMatrix().getMaxScale(); + SkScalar maxScale = SkScalarAbs(this->viewMatrix().getMaxScale()); const SkRect& bounds = args.fShape.bounds(); SkScalar maxDim = SkMaxScalar(bounds.width(), bounds.height()); // We try to create the DF at a power of two scaled path resolution (1/2, 1, 2, 4, etc) |