59 lines
2.2 KiB
Java
59 lines
2.2 KiB
Java
package com.bumptech.glide.load.engine;
|
|
|
|
import androidx.core.util.Pools$Pool;
|
|
import com.bumptech.glide.load.Options;
|
|
import com.bumptech.glide.load.data.DataRewinder;
|
|
import com.bumptech.glide.load.engine.DecodePath;
|
|
import com.bumptech.glide.util.Preconditions;
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class LoadPath<Data, ResourceType, Transcode> {
|
|
private final Pools$Pool<List<Throwable>> a;
|
|
private final List<? extends DecodePath<Data, ResourceType, Transcode>> b;
|
|
private final String c;
|
|
|
|
public LoadPath(Class<Data> cls, Class<ResourceType> cls2, Class<Transcode> cls3, List<DecodePath<Data, ResourceType, Transcode>> list, Pools$Pool<List<Throwable>> pools$Pool) {
|
|
this.a = pools$Pool;
|
|
Preconditions.a(list);
|
|
this.b = list;
|
|
this.c = "Failed LoadPath{" + cls.getSimpleName() + "->" + cls2.getSimpleName() + "->" + cls3.getSimpleName() + "}";
|
|
}
|
|
|
|
public Resource<Transcode> a(DataRewinder<Data> dataRewinder, Options options, int i, int i2, DecodePath.DecodeCallback<ResourceType> decodeCallback) throws GlideException {
|
|
List<Throwable> a = this.a.a();
|
|
Preconditions.a(a);
|
|
List<Throwable> list = a;
|
|
try {
|
|
return a(dataRewinder, options, i, i2, decodeCallback, list);
|
|
} finally {
|
|
this.a.a(list);
|
|
}
|
|
}
|
|
|
|
public String toString() {
|
|
return "LoadPath{decodePaths=" + Arrays.toString(this.b.toArray()) + '}';
|
|
}
|
|
|
|
private Resource<Transcode> a(DataRewinder<Data> dataRewinder, Options options, int i, int i2, DecodePath.DecodeCallback<ResourceType> decodeCallback, List<Throwable> list) throws GlideException {
|
|
int size = this.b.size();
|
|
Resource<Transcode> resource = null;
|
|
for (int i3 = 0; i3 < size; i3++) {
|
|
try {
|
|
resource = this.b.get(i3).a(dataRewinder, i, i2, options, decodeCallback);
|
|
} catch (GlideException e) {
|
|
list.add(e);
|
|
}
|
|
if (resource != null) {
|
|
break;
|
|
}
|
|
}
|
|
if (resource != null) {
|
|
return resource;
|
|
}
|
|
throw new GlideException(this.c, new ArrayList(list));
|
|
}
|
|
}
|