summaryrefslogtreecommitdiff
path: root/libs/hwui/Rect.h
diff options
context:
space:
mode:
authorztenghui <ztenghui@google.com>2014-03-18 17:25:49 -0700
committerztenghui <ztenghui@google.com>2014-03-20 15:25:47 -0700
commitaf6f7ed8dd4288a41d0a07a1f0f0be7d6d035b33 (patch)
tree1004e5d8a1120b83102fd82e0e9484f410c9d319 /libs/hwui/Rect.h
parent31dc8f701fb14e185bf1c1b35d68bd7d1a42a54a (diff)
Early rejection on shadows which are outside of the clip bound.
All the computations are estimated using bounding box. TODO: Spot shadow could have more accurate but also more expensive methods, we need more experiments to decide. Change-Id: I9c10c419576cee55daf0f9f278b0db78cb847447
Diffstat (limited to 'libs/hwui/Rect.h')
-rw-r--r--libs/hwui/Rect.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/hwui/Rect.h b/libs/hwui/Rect.h
index c2301490c26f..0083b77777c2 100644
--- a/libs/hwui/Rect.h
+++ b/libs/hwui/Rect.h
@@ -18,6 +18,7 @@
#define ANDROID_HWUI_RECT_H
#include <cmath>
+#include <SkRect.h>
#include <utils/Log.h>
@@ -68,6 +69,13 @@ public:
bottom(height) {
}
+ inline Rect(const SkRect& rect):
+ left(rect.fLeft),
+ top(rect.fTop),
+ right(rect.fRight),
+ bottom(rect.fBottom) {
+ }
+
friend int operator==(const Rect& a, const Rect& b) {
return !memcmp(&a, &b, sizeof(a));
}