Initial commit

This commit is contained in:
2025-05-13 19:24:51 +02:00
commit a950f49678
10604 changed files with 932663 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
package com.bumptech.glide.provider;
import com.bumptech.glide.load.Encoder;
import java.util.ArrayList;
import java.util.List;
/* loaded from: classes.dex */
public class EncoderRegistry {
private final List<Entry<?>> a = new ArrayList();
private static final class Entry<T> {
private final Class<T> a;
final Encoder<T> b;
Entry(Class<T> cls, Encoder<T> encoder) {
this.a = cls;
this.b = encoder;
}
boolean a(Class<?> cls) {
return this.a.isAssignableFrom(cls);
}
}
public synchronized <T> Encoder<T> a(Class<T> cls) {
for (Entry<?> entry : this.a) {
if (entry.a(cls)) {
return (Encoder<T>) entry.b;
}
}
return null;
}
public synchronized <T> void a(Class<T> cls, Encoder<T> encoder) {
this.a.add(new Entry<>(cls, encoder));
}
}

View File

@@ -0,0 +1,18 @@
package com.bumptech.glide.provider;
import com.bumptech.glide.load.ImageHeaderParser;
import java.util.ArrayList;
import java.util.List;
/* loaded from: classes.dex */
public final class ImageHeaderParserRegistry {
private final List<ImageHeaderParser> a = new ArrayList();
public synchronized List<ImageHeaderParser> a() {
return this.a;
}
public synchronized void a(ImageHeaderParser imageHeaderParser) {
this.a.add(imageHeaderParser);
}
}

View File

@@ -0,0 +1,50 @@
package com.bumptech.glide.provider;
import androidx.collection.ArrayMap;
import com.bumptech.glide.load.engine.DecodePath;
import com.bumptech.glide.load.engine.LoadPath;
import com.bumptech.glide.load.resource.transcode.UnitTranscoder;
import com.bumptech.glide.util.MultiClassKey;
import java.util.Collections;
import java.util.concurrent.atomic.AtomicReference;
/* loaded from: classes.dex */
public class LoadPathCache {
private static final LoadPath<?, ?, ?> c = new LoadPath<>(Object.class, Object.class, Object.class, Collections.singletonList(new DecodePath(Object.class, Object.class, Object.class, Collections.emptyList(), new UnitTranscoder(), null)), null);
private final ArrayMap<MultiClassKey, LoadPath<?, ?, ?>> a = new ArrayMap<>();
private final AtomicReference<MultiClassKey> b = new AtomicReference<>();
private MultiClassKey b(Class<?> cls, Class<?> cls2, Class<?> cls3) {
MultiClassKey andSet = this.b.getAndSet(null);
if (andSet == null) {
andSet = new MultiClassKey();
}
andSet.a(cls, cls2, cls3);
return andSet;
}
public boolean a(LoadPath<?, ?, ?> loadPath) {
return c.equals(loadPath);
}
public <Data, TResource, Transcode> LoadPath<Data, TResource, Transcode> a(Class<Data> cls, Class<TResource> cls2, Class<Transcode> cls3) {
LoadPath<Data, TResource, Transcode> loadPath;
MultiClassKey b = b(cls, cls2, cls3);
synchronized (this.a) {
loadPath = (LoadPath) this.a.get(b);
}
this.b.set(b);
return loadPath;
}
public void a(Class<?> cls, Class<?> cls2, Class<?> cls3, LoadPath<?, ?, ?> loadPath) {
synchronized (this.a) {
ArrayMap<MultiClassKey, LoadPath<?, ?, ?>> arrayMap = this.a;
MultiClassKey multiClassKey = new MultiClassKey(cls, cls2, cls3);
if (loadPath == null) {
loadPath = c;
}
arrayMap.put(multiClassKey, loadPath);
}
}
}

View File

@@ -0,0 +1,33 @@
package com.bumptech.glide.provider;
import androidx.collection.ArrayMap;
import com.bumptech.glide.util.MultiClassKey;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
/* loaded from: classes.dex */
public class ModelToResourceClassCache {
private final AtomicReference<MultiClassKey> a = new AtomicReference<>();
private final ArrayMap<MultiClassKey, List<Class<?>>> b = new ArrayMap<>();
public List<Class<?>> a(Class<?> cls, Class<?> cls2) {
List<Class<?>> list;
MultiClassKey andSet = this.a.getAndSet(null);
if (andSet == null) {
andSet = new MultiClassKey(cls, cls2);
} else {
andSet.a(cls, cls2);
}
synchronized (this.b) {
list = this.b.get(andSet);
}
this.a.set(andSet);
return list;
}
public void a(Class<?> cls, Class<?> cls2, List<Class<?>> list) {
synchronized (this.b) {
this.b.put(new MultiClassKey(cls, cls2), list);
}
}
}

View File

@@ -0,0 +1,92 @@
package com.bumptech.glide.provider;
import com.bumptech.glide.load.ResourceDecoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/* loaded from: classes.dex */
public class ResourceDecoderRegistry {
private final List<String> a = new ArrayList();
private final Map<String, List<Entry<?, ?>>> b = new HashMap();
private static class Entry<T, R> {
private final Class<T> a;
final Class<R> b;
final ResourceDecoder<T, R> c;
public Entry(Class<T> cls, Class<R> cls2, ResourceDecoder<T, R> resourceDecoder) {
this.a = cls;
this.b = cls2;
this.c = resourceDecoder;
}
public boolean a(Class<?> cls, Class<?> cls2) {
return this.a.isAssignableFrom(cls) && cls2.isAssignableFrom(this.b);
}
}
public synchronized void a(List<String> list) {
ArrayList<String> arrayList = new ArrayList(this.a);
this.a.clear();
this.a.addAll(list);
for (String str : arrayList) {
if (!list.contains(str)) {
this.a.add(str);
}
}
}
public synchronized <T, R> List<Class<R>> b(Class<T> cls, Class<R> cls2) {
ArrayList arrayList;
arrayList = new ArrayList();
Iterator<String> it = this.a.iterator();
while (it.hasNext()) {
List<Entry<?, ?>> list = this.b.get(it.next());
if (list != null) {
for (Entry<?, ?> entry : list) {
if (entry.a(cls, cls2) && !arrayList.contains(entry.b)) {
arrayList.add(entry.b);
}
}
}
}
return arrayList;
}
public synchronized <T, R> List<ResourceDecoder<T, R>> a(Class<T> cls, Class<R> cls2) {
ArrayList arrayList;
arrayList = new ArrayList();
Iterator<String> it = this.a.iterator();
while (it.hasNext()) {
List<Entry<?, ?>> list = this.b.get(it.next());
if (list != null) {
for (Entry<?, ?> entry : list) {
if (entry.a(cls, cls2)) {
arrayList.add(entry.c);
}
}
}
}
return arrayList;
}
public synchronized <T, R> void a(String str, ResourceDecoder<T, R> resourceDecoder, Class<T> cls, Class<R> cls2) {
a(str).add(new Entry<>(cls, cls2, resourceDecoder));
}
private synchronized List<Entry<?, ?>> a(String str) {
List<Entry<?, ?>> list;
if (!this.a.contains(str)) {
this.a.add(str);
}
list = this.b.get(str);
if (list == null) {
list = new ArrayList<>();
this.b.put(str, list);
}
return list;
}
}

View File

@@ -0,0 +1,39 @@
package com.bumptech.glide.provider;
import com.bumptech.glide.load.ResourceEncoder;
import java.util.ArrayList;
import java.util.List;
/* loaded from: classes.dex */
public class ResourceEncoderRegistry {
private final List<Entry<?>> a = new ArrayList();
private static final class Entry<T> {
private final Class<T> a;
final ResourceEncoder<T> b;
Entry(Class<T> cls, ResourceEncoder<T> resourceEncoder) {
this.a = cls;
this.b = resourceEncoder;
}
boolean a(Class<?> cls) {
return this.a.isAssignableFrom(cls);
}
}
public synchronized <Z> void a(Class<Z> cls, ResourceEncoder<Z> resourceEncoder) {
this.a.add(new Entry<>(cls, resourceEncoder));
}
public synchronized <Z> ResourceEncoder<Z> a(Class<Z> cls) {
int size = this.a.size();
for (int i = 0; i < size; i++) {
Entry<?> entry = this.a.get(i);
if (entry.a(cls)) {
return (ResourceEncoder<Z>) entry.b;
}
}
return null;
}
}