Remove a seam from media TTT ripple.
1. Match the sizes of center fill and base ring 2. Match fadeout timing Please find the recordings and adb commands in the bug linked. https://b.corp.google.com/issues/265326983#comment8 Bug: 265326983 Test: adb commands in the bug Change-Id: I10669cd8373b6ebbaec5bde995a20c87f03a2cf9
This commit is contained in:
@@ -82,7 +82,7 @@ class RippleShader(rippleShape: RippleShape = RippleShape.CIRCLE) :
|
||||
vec2 p_distorted = distort(p, in_time, in_distort_radial, in_distort_xy);
|
||||
float radius = in_size.x * 0.5;
|
||||
float sparkleRing = soften(circleRing(p_distorted-in_center, radius), in_blur);
|
||||
float inside = soften(sdCircle(p_distorted-in_center, radius * 1.2), in_blur);
|
||||
float inside = soften(sdCircle(p_distorted-in_center, radius * 1.25), in_blur);
|
||||
float sparkle = sparkles(p - mod(p, in_pixelDensity * 0.8), in_time * 0.00175)
|
||||
* (1.-sparkleRing) * in_fadeSparkle;
|
||||
|
||||
|
||||
@@ -119,13 +119,19 @@ class ReceiverChipRippleView(context: Context?, attrs: AttributeSet?) : RippleVi
|
||||
|
||||
private fun removeRippleFill() {
|
||||
with(rippleShader) {
|
||||
// Set back to default because we modified them in [setupRippleFadeParams].
|
||||
baseRingFadeParams.fadeOutStart = RippleShader.DEFAULT_BASE_RING_FADE_OUT_START
|
||||
baseRingFadeParams.fadeOutEnd = RippleShader.DEFAULT_FADE_OUT_END
|
||||
|
||||
centerFillFadeParams.fadeInStart = RippleShader.DEFAULT_FADE_IN_START
|
||||
centerFillFadeParams.fadeInEnd = RippleShader.DEFAULT_CENTER_FILL_FADE_IN_END
|
||||
centerFillFadeParams.fadeOutStart = RippleShader.DEFAULT_CENTER_FILL_FADE_OUT_START
|
||||
centerFillFadeParams.fadeOutEnd = RippleShader.DEFAULT_CENTER_FILL_FADE_OUT_END
|
||||
|
||||
// To avoid a seam showing up, we should match either:
|
||||
// 1. baseRingFadeParams#fadeInEnd and centerFillFadeParams#fadeOutStart
|
||||
// 2. baseRingFadeParams#fadeOutStart and centerFillFadeOutStart
|
||||
// Here we go with 1 to fade in the centerFill faster.
|
||||
centerFillFadeParams.fadeOutStart = baseRingFadeParams.fadeInEnd
|
||||
centerFillFadeParams.fadeOutEnd = RippleShader.DEFAULT_FADE_OUT_END
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user