discord-jadx/app/src/main/java/com/facebook/fresco/animation/factory/AnimatedFactoryV2Impl.java

130 lines
4.7 KiB
Java

package com.facebook.fresco.animation.factory;
import android.content.Context;
import android.graphics.Bitmap;
import c.f.d.b.f;
import c.f.d.d.c;
import c.f.j.a.b.d;
import c.f.j.c.m;
import c.f.j.e.e;
import c.f.j.j.i;
import com.facebook.cache.common.CacheKey;
import com.facebook.common.memory.PooledByteBuffer;
import com.facebook.common.references.CloseableReference;
import com.facebook.common.time.RealtimeSinceBootClock;
import com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory;
import java.util.Objects;
@c
public class AnimatedFactoryV2Impl implements c.f.j.a.b.a {
public final PlatformBitmapFactory a;
public final e b;
/* renamed from: c reason: collision with root package name */
public final m<CacheKey, c.f.j.j.c> f2190c;
public final boolean d;
public d e;
public c.f.j.a.c.b f;
public c.f.j.a.d.a g;
public c.f.j.i.a h;
public class a implements c.f.j.h.b {
public final /* synthetic */ Bitmap.Config a;
public a(Bitmap.Config config) {
this.a = config;
}
@Override // c.f.j.h.b
public c.f.j.j.c a(c.f.j.j.e eVar, int i, i iVar, c.f.j.d.b bVar) {
AnimatedFactoryV2Impl animatedFactoryV2Impl = AnimatedFactoryV2Impl.this;
if (animatedFactoryV2Impl.e == null) {
animatedFactoryV2Impl.e = new c.f.j.a.b.e(new c.f.h.a.d.d(animatedFactoryV2Impl), animatedFactoryV2Impl.a);
}
d dVar = animatedFactoryV2Impl.e;
Bitmap.Config config = this.a;
c.f.j.a.b.e eVar2 = (c.f.j.a.b.e) dVar;
Objects.requireNonNull(eVar2);
if (c.f.j.a.b.e.a != null) {
CloseableReference<PooledByteBuffer> c2 = eVar.c();
Objects.requireNonNull(c2);
try {
PooledByteBuffer w = c2.w();
return eVar2.a(bVar, w.getByteBuffer() != null ? c.f.j.a.b.e.a.c(w.getByteBuffer(), bVar) : c.f.j.a.b.e.a.g(w.k(), w.size(), bVar), config);
} finally {
c2.close();
}
} else {
throw new UnsupportedOperationException("To encode animated gif please add the dependency to the animated-gif module");
}
}
}
public class b implements c.f.j.h.b {
public final /* synthetic */ Bitmap.Config a;
public b(Bitmap.Config config) {
this.a = config;
}
@Override // c.f.j.h.b
public c.f.j.j.c a(c.f.j.j.e eVar, int i, i iVar, c.f.j.d.b bVar) {
AnimatedFactoryV2Impl animatedFactoryV2Impl = AnimatedFactoryV2Impl.this;
if (animatedFactoryV2Impl.e == null) {
animatedFactoryV2Impl.e = new c.f.j.a.b.e(new c.f.h.a.d.d(animatedFactoryV2Impl), animatedFactoryV2Impl.a);
}
d dVar = animatedFactoryV2Impl.e;
Bitmap.Config config = this.a;
c.f.j.a.b.e eVar2 = (c.f.j.a.b.e) dVar;
Objects.requireNonNull(eVar2);
if (c.f.j.a.b.e.b != null) {
CloseableReference<PooledByteBuffer> c2 = eVar.c();
Objects.requireNonNull(c2);
try {
PooledByteBuffer w = c2.w();
return eVar2.a(bVar, w.getByteBuffer() != null ? c.f.j.a.b.e.b.c(w.getByteBuffer(), bVar) : c.f.j.a.b.e.b.g(w.k(), w.size(), bVar), config);
} finally {
c2.close();
}
} else {
throw new UnsupportedOperationException("To encode animated webp please add the dependency to the animated-webp module");
}
}
}
@c
public AnimatedFactoryV2Impl(PlatformBitmapFactory platformBitmapFactory, e eVar, m<CacheKey, c.f.j.j.c> mVar, boolean z2) {
this.a = platformBitmapFactory;
this.b = eVar;
this.f2190c = mVar;
this.d = z2;
}
@Override // c.f.j.a.b.a
public c.f.j.i.a a(Context context) {
if (this.h == null) {
c.f.h.a.d.a aVar = new c.f.h.a.d.a(this);
c.f.d.b.c cVar = new c.f.d.b.c(this.b.a());
c.f.h.a.d.b bVar = new c.f.h.a.d.b(this);
if (this.f == null) {
this.f = new c.f.h.a.d.c(this);
}
c.f.j.a.c.b bVar2 = this.f;
if (f.j == null) {
f.j = new f();
}
this.h = new c.f.h.a.d.e(bVar2, f.j, cVar, RealtimeSinceBootClock.get(), this.a, this.f2190c, aVar, bVar);
}
return this.h;
}
@Override // c.f.j.a.b.a
public c.f.j.h.b b(Bitmap.Config config) {
return new a(config);
}
@Override // c.f.j.a.b.a
public c.f.j.h.b c(Bitmap.Config config) {
return new b(config);
}
}