Clean up shadow assert.
authorJim Van Verth <jvanverth@google.com>
Wed, 10 May 2017 14:04:17 +0000 (10:04 -0400)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Wed, 10 May 2017 14:51:37 +0000 (14:51 +0000)
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>

src/gpu/ops/GrShadowRRectOp.cpp

index fc99b6d..77cd5ef 100644 (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();