160 lines
5.4 KiB
Java
160 lines
5.4 KiB
Java
package c.c.a.w.b;
|
|
|
|
import android.graphics.Canvas;
|
|
import android.graphics.LinearGradient;
|
|
import android.graphics.Matrix;
|
|
import android.graphics.PointF;
|
|
import android.graphics.RadialGradient;
|
|
import android.graphics.RectF;
|
|
import android.graphics.Shader;
|
|
import androidx.annotation.Nullable;
|
|
import androidx.collection.LongSparseArray;
|
|
import c.c.a.j;
|
|
import c.c.a.o;
|
|
import c.c.a.w.c.a;
|
|
import c.c.a.w.c.p;
|
|
import c.c.a.y.l.c;
|
|
import c.c.a.y.l.e;
|
|
import c.c.a.y.m.b;
|
|
/* compiled from: GradientStrokeContent */
|
|
public class i extends a {
|
|
public final String o;
|
|
public final boolean p;
|
|
public final LongSparseArray<LinearGradient> q = new LongSparseArray<>();
|
|
public final LongSparseArray<RadialGradient> r = new LongSparseArray<>();
|
|
|
|
/* renamed from: s reason: collision with root package name */
|
|
public final RectF f280s = new RectF();
|
|
public final int t;
|
|
public final int u;
|
|
public final a<c, c> v;
|
|
public final a<PointF, PointF> w;
|
|
|
|
/* renamed from: x reason: collision with root package name */
|
|
public final a<PointF, PointF> f281x;
|
|
@Nullable
|
|
|
|
/* renamed from: y reason: collision with root package name */
|
|
public p f282y;
|
|
|
|
public i(j jVar, b bVar, e eVar) {
|
|
super(jVar, bVar, c.c.a.y.b.k(eVar.h), c.c.a.y.b.l(eVar.i), eVar.j, eVar.d, eVar.g, eVar.k, eVar.l);
|
|
this.o = eVar.a;
|
|
this.t = eVar.b;
|
|
this.p = eVar.m;
|
|
this.u = (int) (jVar.j.b() / 32.0f);
|
|
a<c, c> a = eVar.f311c.a();
|
|
this.v = a;
|
|
a.a.add(this);
|
|
bVar.e(a);
|
|
a<PointF, PointF> a2 = eVar.e.a();
|
|
this.w = a2;
|
|
a2.a.add(this);
|
|
bVar.e(a2);
|
|
a<PointF, PointF> a3 = eVar.f.a();
|
|
this.f281x = a3;
|
|
a3.a.add(this);
|
|
bVar.e(a3);
|
|
}
|
|
|
|
public final int[] e(int[] iArr) {
|
|
p pVar = this.f282y;
|
|
if (pVar != null) {
|
|
Integer[] numArr = (Integer[]) pVar.e();
|
|
int i = 0;
|
|
if (iArr.length == numArr.length) {
|
|
while (i < iArr.length) {
|
|
iArr[i] = numArr[i].intValue();
|
|
i++;
|
|
}
|
|
} else {
|
|
iArr = new int[numArr.length];
|
|
while (i < numArr.length) {
|
|
iArr[i] = numArr[i].intValue();
|
|
i++;
|
|
}
|
|
}
|
|
}
|
|
return iArr;
|
|
}
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r3v9, resolved type: androidx.collection.LongSparseArray<android.graphics.RadialGradient> */
|
|
/* JADX DEBUG: Multi-variable search result rejected for r3v14, resolved type: androidx.collection.LongSparseArray<android.graphics.LinearGradient> */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
@Override // c.c.a.w.b.a, c.c.a.w.b.e
|
|
public void f(Canvas canvas, Matrix matrix, int i) {
|
|
RadialGradient radialGradient;
|
|
if (!this.p) {
|
|
d(this.f280s, matrix, false);
|
|
if (this.t == 1) {
|
|
long h = (long) h();
|
|
radialGradient = this.q.get(h);
|
|
if (radialGradient == null) {
|
|
PointF e = this.w.e();
|
|
PointF e2 = this.f281x.e();
|
|
c e3 = this.v.e();
|
|
radialGradient = new LinearGradient(e.x, e.y, e2.x, e2.y, e(e3.b), e3.a, Shader.TileMode.CLAMP);
|
|
this.q.put(h, radialGradient);
|
|
}
|
|
} else {
|
|
long h2 = (long) h();
|
|
radialGradient = this.r.get(h2);
|
|
if (radialGradient == null) {
|
|
PointF e4 = this.w.e();
|
|
PointF e5 = this.f281x.e();
|
|
c e6 = this.v.e();
|
|
int[] e7 = e(e6.b);
|
|
float[] fArr = e6.a;
|
|
float f = e4.x;
|
|
float f2 = e4.y;
|
|
radialGradient = new RadialGradient(f, f2, (float) Math.hypot((double) (e5.x - f), (double) (e5.y - f2)), e7, fArr, Shader.TileMode.CLAMP);
|
|
this.r.put(h2, radialGradient);
|
|
}
|
|
}
|
|
radialGradient.setLocalMatrix(matrix);
|
|
this.i.setShader(radialGradient);
|
|
super.f(canvas, matrix, i);
|
|
}
|
|
}
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r0v0, resolved type: java.lang.Integer[] */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
@Override // c.c.a.w.b.a, c.c.a.y.g
|
|
public <T> void g(T t, @Nullable c.c.a.c0.c<T> cVar) {
|
|
super.g(t, cVar);
|
|
if (t == o.D) {
|
|
p pVar = this.f282y;
|
|
if (pVar != null) {
|
|
this.f.u.remove(pVar);
|
|
}
|
|
if (cVar == null) {
|
|
this.f282y = null;
|
|
return;
|
|
}
|
|
p pVar2 = new p(cVar, null);
|
|
this.f282y = pVar2;
|
|
pVar2.a.add(this);
|
|
this.f.e(this.f282y);
|
|
}
|
|
}
|
|
|
|
@Override // c.c.a.w.b.c
|
|
public String getName() {
|
|
return this.o;
|
|
}
|
|
|
|
public final int h() {
|
|
int round = Math.round(this.w.d * ((float) this.u));
|
|
int round2 = Math.round(this.f281x.d * ((float) this.u));
|
|
int round3 = Math.round(this.v.d * ((float) this.u));
|
|
int i = 17;
|
|
if (round != 0) {
|
|
i = 527 * round;
|
|
}
|
|
if (round2 != 0) {
|
|
i = i * 31 * round2;
|
|
}
|
|
return round3 != 0 ? i * 31 * round3 : i;
|
|
}
|
|
}
|