A better looking and faster spot shadow.
1. This improve the looking, the star shape (spike) on long action bar is gone.
Shadow is more smooth now.
2. The performance is better, too. For averaging around rect, round rect and
circle, the spot shadow itself is 3 times faster. On N7 v1, it could be less than
0.1 ms.
b/14976551
b/16712006
Change-Id: I61ed546ee56e7c8dbe504dfcaef12d084904b4b8
diff --git a/libs/hwui/Vector.h b/libs/hwui/Vector.h
index d033ed9..aa6acc9 100644
--- a/libs/hwui/Vector.h
+++ b/libs/hwui/Vector.h
@@ -99,6 +99,10 @@
return x * v.x + y * v.y;
}
+ float cross(const Vector2& v) const {
+ return x * v.y - y * v.x;
+ }
+
void dump() {
ALOGD("Vector2[%.2f, %.2f]", x, y);
}