diff options
author | ztenghui <ztenghui@google.com> | 2014-10-03 11:21:11 -0700 |
---|---|---|
committer | ztenghui <ztenghui@google.com> | 2014-10-03 15:30:53 -0700 |
commit | 9122b1b168d2a74d51517ed7282f4d6a8adea367 (patch) | |
tree | f31aaadd1c18fe15ab9a63ba221693fb77507161 /libs/hwui/SpotShadow.h | |
parent | 2298938cef8d5aa2211ef08e27553354918e5554 (diff) | |
download | frameworks_base-9122b1b168d2a74d51517ed7282f4d6a8adea367.zip frameworks_base-9122b1b168d2a74d51517ed7282f4d6a8adea367.tar.gz frameworks_base-9122b1b168d2a74d51517ed7282f4d6a8adea367.tar.bz2 |
Use float instead of double to increase spot shadow perf
This is helping spot shadow for 15%-20% increase.
With the new algorithm, we are less sensitive to the floating point error.
b/16712006
Change-Id: Ie30a6ce01e73d56054a0cf65a84549454339a7fd
Diffstat (limited to 'libs/hwui/SpotShadow.h')
-rw-r--r-- | libs/hwui/SpotShadow.h | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/libs/hwui/SpotShadow.h b/libs/hwui/SpotShadow.h index 23fdca9..6fa2028 100644 --- a/libs/hwui/SpotShadow.h +++ b/libs/hwui/SpotShadow.h @@ -35,8 +35,6 @@ private: static float projectCasterToOutline(Vector2& outline, const Vector3& lightCenter, const Vector3& polyVertex); - static int calculateOccludedUmbra(const Vector2* umbra, int umbraLength, - const Vector3* poly, int polyLength, Vector2* occludedUmbra); static int setupAngleList(VertexAngleData* angleDataList, int polyLength, const Vector2* polygon, const Vector2& centroid, @@ -81,8 +79,7 @@ private: static void xsort(Vector2* points, int pointsLength); static int hull(Vector2* points, int pointsLength, Vector2* retPoly); - static bool ccw(double ax, double ay, double bx, double by, double cx, double cy); - static int intersection(const Vector2* poly1, int poly1length, Vector2* poly2, int poly2length); + static bool ccw(float ax, float ay, float bx, float by, float cx, float cy); static void sort(Vector2* poly, int polyLength, const Vector2& center); static void swap(Vector2* points, int i, int j); @@ -92,8 +89,6 @@ private: static bool testPointInsidePolygon(const Vector2 testPoint, const Vector2* poly, int len); static void makeClockwise(Vector2* polygon, int len); static void reverse(Vector2* polygon, int len); - static inline bool lineIntersection(double x1, double y1, double x2, double y2, - double x3, double y3, double x4, double y4, Vector2& ret); static void generateTriangleStrip(bool isCasterOpaque, float shadowStrengthScale, Vector2* penumbra, int penumbraLength, Vector2* umbra, int umbraLength, |