aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Jim Van Verth <jvanverth@google.com>2017-04-20 15:48:37 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-21 15:23:53 +0000
commit8f7dc9f6caabe798723d9f17aff371121369b846 (patch)
tree5062e5b6d635476d519ff6e4dd3dfef39de0ae79 /src/core
parent5e958e9291f53b81045f776a2af3a871381dd5fb (diff)
Circular shadow fixes for Flutter.
* Fix spot shadow placement for SkSpotShadowMaskFilter. * Make sure we don't try to render an oval as a plain RRect due to floating point error. * Use fast path for uncached circles. * Make sure ShadowMaskFilters can handle near-circles. Change-Id: Ia9967a00a6e1c980a1c0a7ba8248f09fde61a3b7 Reviewed-on: https://skia-review.googlesource.com/13969 Reviewed-by: Jim Van Verth <jvanverth@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkRRect.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/SkRRect.cpp b/src/core/SkRRect.cpp
index 824ee62e60..8d69f4afc6 100644
--- a/src/core/SkRRect.cpp
+++ b/src/core/SkRRect.cpp
@@ -251,11 +251,11 @@ bool SkRRect::checkCornerContainment(SkScalar x, SkScalar y) const {
return dist <= SkScalarSquare(fRadii[index].fX * fRadii[index].fY);
}
-bool SkRRect::allCornersCircular() const {
- return fRadii[0].fX == fRadii[0].fY &&
- fRadii[1].fX == fRadii[1].fY &&
- fRadii[2].fX == fRadii[2].fY &&
- fRadii[3].fX == fRadii[3].fY;
+bool SkRRect::allCornersCircular(SkScalar tolerance) const {
+ return SkScalarNearlyEqual(fRadii[0].fX, fRadii[0].fY, tolerance) &&
+ SkScalarNearlyEqual(fRadii[1].fX, fRadii[1].fY, tolerance) &&
+ SkScalarNearlyEqual(fRadii[2].fX, fRadii[2].fY, tolerance) &&
+ SkScalarNearlyEqual(fRadii[3].fX, fRadii[3].fY, tolerance);
}
bool SkRRect::contains(const SkRect& rect) const {