Clean up shadow assert.

When drawing an analytic rrect shadow, the mask filter could pass
the devRect into the drawOp. If we have a small scale that could
make the radii less than SK_ScalarNearlyZero. We might also have
a rect that we outset by a value less than SK_ScalarNearlyZero to
the penumbra border. So the best we can check is that the the two
radii are equal.

Bug: skia:6608
Change-Id: I8bdafe089b302fbc5c9042ff30798d3688e9e781
Reviewed-on: https://skia-review.googlesource.com/16364
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This commit is contained in:
Jim Van Verth 2017-05-10 10:04:17 -04:00 committed by Skia Commit-Bot
parent ac70f84e7f
commit 05fd8cf089

View File

@ -643,9 +643,7 @@ std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color,
SkScalar insetWidth) {
// Shadow rrect ops only handle simple circular rrects.
SkASSERT(viewMatrix.isSimilarity() &&
(rrect.isSimple() || rrect.isRect() || rrect.isOval()));
SkASSERT(rrect.getSimpleRadii().fX > SK_ScalarNearlyZero &&
SkScalarNearlyEqual(rrect.getSimpleRadii().fX, rrect.getSimpleRadii().fY));
(rrect.isSimpleCircular() || rrect.isRect() || rrect.isCircle()));
// Do any matrix crunching before we reset the draw state for device coords.
const SkRect& rrectBounds = rrect.getBounds();