I9e6f44b07a170574a905f42338282c4bb7e95f56 changed the way the light
source alphas were set for renderers - the alphas were passed as ints
between 0 and 255 before, while now they are passed as a double between
0 and 1. This CL updates SimpleRenderer, which is only used by the
magnifier, to use the API correctly. Before this CL, the incorrect usage
was causing the value validation to fail and apps to crash when the
magnifier was trigerred.
Bug:
119423778
Test: manually tested the magnifier
Change-Id: I8978ac16aca38906ec2cf4ae30a83beddfc9e941
mLightY = a.getDimension(R.styleable.Lighting_lightY, 0);
mLightZ = a.getDimension(R.styleable.Lighting_lightZ, 0);
mLightRadius = a.getDimension(R.styleable.Lighting_lightRadius, 0);
- final int ambientShadowAlpha =
- (int) (255 * a.getFloat(R.styleable.Lighting_ambientShadowAlpha, 0) + 0.5f);
- final int spotShadowAlpha =
- (int) (255 * a.getFloat(R.styleable.Lighting_spotShadowAlpha, 0) + 0.5f);
+ final float ambientShadowAlpha = a.getFloat(R.styleable.Lighting_ambientShadowAlpha, 0);
+ final float spotShadowAlpha = a.getFloat(R.styleable.Lighting_spotShadowAlpha, 0);
a.recycle();
setLightSourceAlpha(ambientShadowAlpha, spotShadowAlpha);
}