summaryrefslogtreecommitdiff
path: root/libs/hwui/Interpolator.cpp
diff options
context:
space:
mode:
authorztenghui <ztenghui@google.com>2014-08-21 13:47:54 -0700
committerztenghui <ztenghui@google.com>2014-08-22 13:51:16 -0700
commitc50a03d78aaedd0003377e98710e7038bda330e9 (patch)
treeb52044852d73bd8d7e08bec4e3cda9be89aafed2 /libs/hwui/Interpolator.cpp
parent730e9bceb746e6c50b87cc5a695eb73fea27686e (diff)
Improve the spot shadow computation.
Get rid of compuation of the intersection for penumbra and convex hull for umbra. Use simple circle / normal to compute the penumbra and simple intersection for umbra. The new way could be 2x to 4x faster from rectangle to round shape. And this part is roughly half of the shadow computation, or 2/3 of spot shadow computation. This improve the spot shadow spikeness too. b/16712006 b/14976551 Change-Id: I02911784868731369efa73f76fc915bc08248600
Diffstat (limited to 'libs/hwui/Interpolator.cpp')
-rw-r--r--libs/hwui/Interpolator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/hwui/Interpolator.cpp b/libs/hwui/Interpolator.cpp
index fc0e8a059f22..ff8ff73f030f 100644
--- a/libs/hwui/Interpolator.cpp
+++ b/libs/hwui/Interpolator.cpp
@@ -110,7 +110,7 @@ float LUTInterpolator::interpolate(float input) {
weight = modff(lutpos, &ipart);
int i1 = (int) ipart;
- int i2 = MathUtils::min(i1 + 1, mSize - 1);
+ int i2 = MathUtils::min(i1 + 1, (int) mSize - 1);
LOG_ALWAYS_FATAL_IF(i1 < 0 || i2 < 0, "negatives in interpolation!"
" i1=%d, i2=%d, input=%f, lutpos=%f, size=%zu, values=%p, ipart=%f, weight=%f",