Fix LUTInterpolator lookup table position calc
BUG: 32830741 Test: running progress bar at 5x duration scale, no flickering Change-Id: Ie484bdbfdf18bacc4586e36c5142e4523d08bdaa
This commit is contained in:
@@ -97,7 +97,8 @@ LUTInterpolator::~LUTInterpolator() {
|
||||
}
|
||||
|
||||
float LUTInterpolator::interpolate(float input) {
|
||||
float lutpos = input * mSize;
|
||||
// lut position should only be at the end of the table when input is 1f.
|
||||
float lutpos = input * (mSize - 1);
|
||||
if (lutpos >= (mSize - 1)) {
|
||||
return mValues[mSize - 1];
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ public class NativeInterpolatorFactoryHelper_Delegate {
|
||||
|
||||
@Override
|
||||
public float getInterpolation(float input) {
|
||||
float lutpos = input * mSize;
|
||||
float lutpos = input * (mSize - 1);
|
||||
if (lutpos >= (mSize - 1)) {
|
||||
return mValues[mSize - 1];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user