summaryrefslogtreecommitdiffstats
path: root/libs/hwui/Vector.h
diff options
context:
space:
mode:
authorztenghui <ztenghui@google.com>2014-01-07 10:42:55 -0800
committerztenghui <ztenghui@google.com>2014-01-10 17:18:53 -0800
commit7b4516e7ea552ad08d6e7277d311ef11bd8f12e8 (patch)
treea97549bff020af39946aabd5a5c27c1151a90539 /libs/hwui/Vector.h
parent0ffd9ca5798d6c55d2a02f453dd181899639dce2 (diff)
downloadframeworks_base-7b4516e7ea552ad08d6e7277d311ef11bd8f12e8.zip
frameworks_base-7b4516e7ea552ad08d6e7277d311ef11bd8f12e8.tar.gz
frameworks_base-7b4516e7ea552ad08d6e7277d311ef11bd8f12e8.tar.bz2
Calculate and show the shadow from a spot light.
Change-Id: Ia558852e8cde5d33866b22875eb501e4c6858819
Diffstat (limited to 'libs/hwui/Vector.h')
-rw-r--r--libs/hwui/Vector.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/hwui/Vector.h b/libs/hwui/Vector.h
index 5110272..15b9d6b 100644
--- a/libs/hwui/Vector.h
+++ b/libs/hwui/Vector.h
@@ -36,6 +36,10 @@ struct Vector2 {
x(px), y(py) {
}
+ float lengthSquared() const {
+ return x * x + y * y;
+ }
+
float length() const {
return sqrt(x * x + y * y);
}