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

Unified Diff: include/core/SkRect.h

Issue 26371002: Change SkImageFilter's cropRect from SkIRect to a CropRect struct (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Alternate version, using a single fFlags member. Created 7 years, 2 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
« no previous file with comments | « include/core/SkImageFilter.h ('k') | include/effects/SkBlurImageFilter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkRect.h
diff --git a/include/core/SkRect.h b/include/core/SkRect.h
index d8919ae5d6b888d3195cc57ce7346bc905cf2a8c..c615603d7e85b1d7adb645c20390a402f0c8f908 100644
--- a/include/core/SkRect.h
+++ b/include/core/SkRect.h
@@ -371,6 +371,12 @@ struct SK_API SkRect {
return r;
}
+ static SkRect SK_WARN_UNUSED_RESULT MakeLargest() {
+ SkRect r;
+ r.setLargest();
+ return r;
+ }
+
static SkRect SK_WARN_UNUSED_RESULT MakeWH(SkScalar w, SkScalar h) {
SkRect r;
r.set(0, 0, w, h);
@@ -419,6 +425,11 @@ struct SK_API SkRect {
*/
bool isEmpty() const { return fLeft >= fRight || fTop >= fBottom; }
+ bool isLargest() const { return SK_ScalarMin == fLeft &&
+ SK_ScalarMin == fTop &&
+ SK_ScalarMax == fRight &&
+ SK_ScalarMax == fBottom; }
+
/**
* Returns true iff all values in the rect are finite. If any are
* infinite or NaN (or SK_FixedNaN when SkScalar is fixed) then this
« no previous file with comments | « include/core/SkImageFilter.h ('k') | include/effects/SkBlurImageFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698