summaryrefslogtreecommitdiffstats
path: root/libs/hwui/Rect.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/Rect.h')
-rw-r--r--libs/hwui/Rect.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/hwui/Rect.h b/libs/hwui/Rect.h
index b046b6f..1716cf0 100644
--- a/libs/hwui/Rect.h
+++ b/libs/hwui/Rect.h
@@ -111,6 +111,10 @@ public:
set(r.left, r.top, r.right, r.bottom);
}
+ inline void set(const SkIRect& r) {
+ set(r.left(), r.top(), r.right(), r.bottom());
+ }
+
inline float getWidth() const {
return right - left;
}
@@ -248,6 +252,14 @@ public:
bottom = fmaxf(bottom, y);
}
+ SkRect toSkRect() const {
+ return SkRect::MakeLTRB(left, top, right, bottom);
+ }
+
+ SkIRect toSkIRect() const {
+ return SkIRect::MakeLTRB(left, top, right, bottom);
+ }
+
void dump(const char* label = nullptr) const {
ALOGD("%s[l=%f t=%f r=%f b=%f]", label ? label : "Rect", left, top, right, bottom);
}