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

Unified Diff: src/core/SkRect.cpp

Issue 947443003: Move clip off of draw target (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleanup Created 5 years, 10 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: src/core/SkRect.cpp
diff --git a/src/core/SkRect.cpp b/src/core/SkRect.cpp
index afd8bd8f719cfbea8814984eaf9b9fe4f5fd4f2c..05064d80c397aca59f24669a8090a1eabfdc588c 100644
--- a/src/core/SkRect.cpp
+++ b/src/core/SkRect.cpp
@@ -6,9 +6,14 @@
* found in the LICENSE file.
*/
-
#include "SkRect.h"
+bool SkIRect::contains(const SkRect& r) const {
+ return !r.isEmpty() && !this->isEmpty() && // check for empties
+ (SkScalar)fLeft <= r.fLeft && (SkScalar)fTop <= r.fTop &&
+ (SkScalar)fRight >= r.fRight && (SkScalar)fBottom >= r.fBottom;
+}
+
void SkIRect::join(int32_t left, int32_t top, int32_t right, int32_t bottom) {
// do nothing if the params are empty
if (left >= right || top >= bottom) {

Powered by Google App Engine
This is Rietveld 408576698