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

Unified Diff: include/core/SkRegion.h

Issue 1893433002: In SkDraw::drawRect, use SkPath for huge rects. Base URL: https://skia.googlesource.com/skia@fixed-assert
Patch Set: Created 4 years, 8 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/SkRect.h ('k') | include/core/SkScalar.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkRegion.h
diff --git a/include/core/SkRegion.h b/include/core/SkRegion.h
index eb0f1367aba4a6b14bca770525bda848bcbbe9c9..254329f9211b04622a16de8e18da61859bbf1d8b 100644
--- a/include/core/SkRegion.h
+++ b/include/core/SkRegion.h
@@ -203,6 +203,17 @@ public:
}
/**
+ * Same as above, but works for rectangles outside of the range of int32_t.
+ */
+ bool quickContains(const SkRect& r) const {
+ SkASSERT(this->isEmpty() == fBounds.isEmpty()); // valid region
+
+ return !r.isEmpty() &&
+ fRunHead == SkRegion_gRectRunHeadPtr && // this->isRect()
+ fBounds.contains(r);
+ }
+
+ /**
* Return true if this region is empty, or if the specified rectangle does
* not intersect the region. Returning false is not a guarantee that they
* intersect, but returning true is a guarantee that they do not.
« no previous file with comments | « include/core/SkRect.h ('k') | include/core/SkScalar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698