Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Unified Diff: include/core/SkRRect.h

Issue 1311583005: Add special case circle blur for Ganesh (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clean up Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: include/core/SkRRect.h
diff --git a/include/core/SkRRect.h b/include/core/SkRRect.h
index 37766219df3a50f182c422da76c4c33826822523..68583d0654220b11db51d4e52e40b73c631e29e7 100644
--- a/include/core/SkRRect.h
+++ b/include/core/SkRRect.h
@@ -97,7 +97,10 @@ public:
inline bool isOval() const { return kOval_Type == this->getType(); }
inline bool isSimple() const { return kSimple_Type == this->getType(); }
inline bool isSimpleCircular() const {
- return this->isSimple() && fRadii[0].fX == fRadii[0].fY;
+ return this->isSimple() && SkScalarNearlyEqual(fRadii[0].fX, fRadii[0].fY);
+ }
bsalomon 2015/09/11 13:05:46 I wonder if these should take a tolerance (just a
robertphillips 2015/09/11 15:55:35 Done. I've added a todo. Right now I only use isCi
+ inline bool isCircle() const {
+ return this->isOval() && SkScalarNearlyEqual(fRadii[0].fX, fRadii[0].fY);
}
inline bool isNinePatch() const { return kNinePatch_Type == this->getType(); }
inline bool isComplex() const { return kComplex_Type == this->getType(); }
@@ -140,6 +143,12 @@ public:
return rr;
}
+ static SkRRect MakeOval(const SkRect& oval) {
+ SkRRect rr;
+ rr.setOval(oval);
+ return rr;
+ }
+
/**
* Set this RR to match the supplied oval. All x radii will equal half the
* width and all y radii will equal half the height.

Powered by Google App Engine
This is Rietveld 408576698