Merge "Remove a seam from media TTT ripple." into tm-qpr-dev am: 55f11aac91 am: 97cbc5302c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21308441 Change-Id: Idcd3ebfcff02f6d2cb5e51747de99b121baa9440 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
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