253 lines
6.7 KiB
Smali
253 lines
6.7 KiB
Smali
.class public abstract Lf/g/j/r/a;
|
|
.super Ljava/lang/Object;
|
|
.source "BasePostprocessor.java"
|
|
|
|
# interfaces
|
|
.implements Lf/g/j/r/b;
|
|
|
|
|
|
# static fields
|
|
.field public static final FALLBACK_BITMAP_CONFIGURATION:Landroid/graphics/Bitmap$Config;
|
|
|
|
.field public static sCopyBitmap:Ljava/lang/reflect/Method;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
sget-object v0, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;
|
|
|
|
sput-object v0, Lf/g/j/r/a;->FALLBACK_BITMAP_CONFIGURATION:Landroid/graphics/Bitmap$Config;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static internalCopyBitmap(Landroid/graphics/Bitmap;Landroid/graphics/Bitmap;)V
|
|
.locals 9
|
|
|
|
const-string v0, "Wrong Native code setup, reflection failed."
|
|
|
|
sget-boolean v1, Lf/g/j/e/n;->a:Z
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
invoke-virtual {p0}, Landroid/graphics/Bitmap;->getConfig()Landroid/graphics/Bitmap$Config;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {p1}, Landroid/graphics/Bitmap;->getConfig()Landroid/graphics/Bitmap$Config;
|
|
|
|
move-result-object v3
|
|
|
|
if-ne v1, v3, :cond_1
|
|
|
|
:try_start_0
|
|
sget-object v1, Lf/g/j/r/a;->sCopyBitmap:Ljava/lang/reflect/Method;
|
|
|
|
const/4 v3, 0x1
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x2
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
const-string v1, "com.facebook.imagepipeline.nativecode.Bitmaps"
|
|
|
|
invoke-static {v1}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v6, "copyBitmap"
|
|
|
|
new-array v7, v5, [Ljava/lang/Class;
|
|
|
|
const-class v8, Landroid/graphics/Bitmap;
|
|
|
|
aput-object v8, v7, v4
|
|
|
|
const-class v8, Landroid/graphics/Bitmap;
|
|
|
|
aput-object v8, v7, v3
|
|
|
|
invoke-virtual {v1, v6, v7}, Ljava/lang/Class;->getDeclaredMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
|
|
|
move-result-object v1
|
|
|
|
sput-object v1, Lf/g/j/r/a;->sCopyBitmap:Ljava/lang/reflect/Method;
|
|
|
|
:cond_0
|
|
sget-object v1, Lf/g/j/r/a;->sCopyBitmap:Ljava/lang/reflect/Method;
|
|
|
|
new-array v5, v5, [Ljava/lang/Object;
|
|
|
|
aput-object p0, v5, v4
|
|
|
|
aput-object p1, v5, v3
|
|
|
|
invoke-virtual {v1, v2, v5}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
|
|
:try_end_0
|
|
.catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_3
|
|
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_2
|
|
.catch Ljava/lang/NoSuchMethodException; {:try_start_0 .. :try_end_0} :catch_1
|
|
.catch Ljava/lang/reflect/InvocationTargetException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-void
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
new-instance p1, Ljava/lang/RuntimeException;
|
|
|
|
invoke-direct {p1, v0, p0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
throw p1
|
|
|
|
:catch_1
|
|
move-exception p0
|
|
|
|
new-instance p1, Ljava/lang/RuntimeException;
|
|
|
|
invoke-direct {p1, v0, p0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
throw p1
|
|
|
|
:catch_2
|
|
move-exception p0
|
|
|
|
new-instance p1, Ljava/lang/RuntimeException;
|
|
|
|
invoke-direct {p1, v0, p0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
throw p1
|
|
|
|
:catch_3
|
|
move-exception p0
|
|
|
|
new-instance p1, Ljava/lang/RuntimeException;
|
|
|
|
invoke-direct {p1, v0, p0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
throw p1
|
|
|
|
:cond_1
|
|
new-instance v0, Landroid/graphics/Canvas;
|
|
|
|
invoke-direct {v0, p0}, Landroid/graphics/Canvas;-><init>(Landroid/graphics/Bitmap;)V
|
|
|
|
const/4 p0, 0x0
|
|
|
|
invoke-virtual {v0, p1, p0, p0, v2}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;FFLandroid/graphics/Paint;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public getName()Ljava/lang/String;
|
|
.locals 1
|
|
|
|
const-string v0, "Unknown postprocessor"
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public getPostprocessorCacheKey()Lcom/facebook/cache/common/CacheKey;
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public process(Landroid/graphics/Bitmap;Lcom/facebook/imagepipeline/bitmaps/PlatformBitmapFactory;)Lcom/facebook/common/references/CloseableReference;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Landroid/graphics/Bitmap;",
|
|
"Lcom/facebook/imagepipeline/bitmaps/PlatformBitmapFactory;",
|
|
")",
|
|
"Lcom/facebook/common/references/CloseableReference<",
|
|
"Landroid/graphics/Bitmap;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p1}, Landroid/graphics/Bitmap;->getConfig()Landroid/graphics/Bitmap$Config;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1}, Landroid/graphics/Bitmap;->getWidth()I
|
|
|
|
move-result v1
|
|
|
|
invoke-virtual {p1}, Landroid/graphics/Bitmap;->getHeight()I
|
|
|
|
move-result v2
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
sget-object v0, Lf/g/j/r/a;->FALLBACK_BITMAP_CONFIGURATION:Landroid/graphics/Bitmap$Config;
|
|
|
|
:goto_0
|
|
invoke-virtual {p2, v1, v2, v0}, Lcom/facebook/imagepipeline/bitmaps/PlatformBitmapFactory;->b(IILandroid/graphics/Bitmap$Config;)Lcom/facebook/common/references/CloseableReference;
|
|
|
|
move-result-object p2
|
|
|
|
:try_start_0
|
|
invoke-virtual {p2}, Lcom/facebook/common/references/CloseableReference;->j()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/graphics/Bitmap;
|
|
|
|
invoke-virtual {p0, v0, p1}, Lf/g/j/r/a;->process(Landroid/graphics/Bitmap;Landroid/graphics/Bitmap;)V
|
|
|
|
invoke-static {p2}, Lcom/facebook/common/references/CloseableReference;->d(Lcom/facebook/common/references/CloseableReference;)Lcom/facebook/common/references/CloseableReference;
|
|
|
|
move-result-object p1
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
invoke-static {p2}, Lcom/facebook/common/references/CloseableReference;->f(Lcom/facebook/common/references/CloseableReference;)V
|
|
|
|
return-object p1
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
invoke-static {p2}, Lcom/facebook/common/references/CloseableReference;->f(Lcom/facebook/common/references/CloseableReference;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public process(Landroid/graphics/Bitmap;)V
|
|
.locals 0
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public process(Landroid/graphics/Bitmap;Landroid/graphics/Bitmap;)V
|
|
.locals 0
|
|
|
|
invoke-static {p1, p2}, Lf/g/j/r/a;->internalCopyBitmap(Landroid/graphics/Bitmap;Landroid/graphics/Bitmap;)V
|
|
|
|
invoke-virtual {p0, p1}, Lf/g/j/r/a;->process(Landroid/graphics/Bitmap;)V
|
|
|
|
return-void
|
|
.end method
|