191 lines
5.4 KiB
Smali
191 lines
5.4 KiB
Smali
.class public final Lcom/discord/utilities/images/MGImagesBitmap$CirclePostProcessor;
|
|
.super Le/j/j/p/a;
|
|
.source "MGImagesBitmap.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/utilities/images/MGImagesBitmap;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "CirclePostProcessor"
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public final height:I
|
|
|
|
.field public final width:I
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(II)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Le/j/j/p/a;-><init>()V
|
|
|
|
iput p1, p0, Lcom/discord/utilities/images/MGImagesBitmap$CirclePostProcessor;->width:I
|
|
|
|
iput p2, p0, Lcom/discord/utilities/images/MGImagesBitmap$CirclePostProcessor;->height:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final getHeight()I
|
|
.locals 1
|
|
|
|
iget v0, p0, Lcom/discord/utilities/images/MGImagesBitmap$CirclePostProcessor;->height:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public final getWidth()I
|
|
.locals 1
|
|
|
|
iget v0, p0, Lcom/discord/utilities/images/MGImagesBitmap$CirclePostProcessor;->width:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public process(Landroid/graphics/Bitmap;Lcom/facebook/imagepipeline/bitmaps/PlatformBitmapFactory;)Lcom/facebook/common/references/CloseableReference;
|
|
.locals 7
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Landroid/graphics/Bitmap;",
|
|
"Lcom/facebook/imagepipeline/bitmaps/PlatformBitmapFactory;",
|
|
")",
|
|
"Lcom/facebook/common/references/CloseableReference<",
|
|
"Landroid/graphics/Bitmap;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
iget v0, p0, Lcom/discord/utilities/images/MGImagesBitmap$CirclePostProcessor;->width:I
|
|
|
|
iget v1, p0, Lcom/discord/utilities/images/MGImagesBitmap$CirclePostProcessor;->height:I
|
|
|
|
invoke-virtual {p2, v0, v1}, Lcom/facebook/imagepipeline/bitmaps/PlatformBitmapFactory;->a(II)Lcom/facebook/common/references/CloseableReference;
|
|
|
|
move-result-object p2
|
|
|
|
:try_start_0
|
|
invoke-virtual {p2}, Lcom/facebook/common/references/CloseableReference;->b()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/graphics/Bitmap;
|
|
|
|
new-instance v1, Landroid/graphics/Canvas;
|
|
|
|
invoke-direct {v1, v0}, Landroid/graphics/Canvas;-><init>(Landroid/graphics/Bitmap;)V
|
|
|
|
const v0, -0xbdbdbe
|
|
|
|
new-instance v2, Landroid/graphics/Paint;
|
|
|
|
invoke-direct {v2}, Landroid/graphics/Paint;-><init>()V
|
|
|
|
const/4 v3, 0x1
|
|
|
|
invoke-virtual {v2, v3}, Landroid/graphics/Paint;->setAntiAlias(Z)V
|
|
|
|
const/4 v3, 0x0
|
|
|
|
invoke-virtual {v1, v3, v3, v3, v3}, Landroid/graphics/Canvas;->drawARGB(IIII)V
|
|
|
|
invoke-virtual {v2, v0}, Landroid/graphics/Paint;->setColor(I)V
|
|
|
|
iget v0, p0, Lcom/discord/utilities/images/MGImagesBitmap$CirclePostProcessor;->width:I
|
|
|
|
int-to-float v0, v0
|
|
|
|
const/high16 v4, 0x40000000 # 2.0f
|
|
|
|
div-float/2addr v0, v4
|
|
|
|
iget v5, p0, Lcom/discord/utilities/images/MGImagesBitmap$CirclePostProcessor;->height:I
|
|
|
|
int-to-float v5, v5
|
|
|
|
div-float/2addr v5, v4
|
|
|
|
iget v6, p0, Lcom/discord/utilities/images/MGImagesBitmap$CirclePostProcessor;->width:I
|
|
|
|
int-to-float v6, v6
|
|
|
|
div-float/2addr v6, v4
|
|
|
|
invoke-virtual {v1, v0, v5, v6, v2}, Landroid/graphics/Canvas;->drawCircle(FFFLandroid/graphics/Paint;)V
|
|
|
|
new-instance v0, Landroid/graphics/PorterDuffXfermode;
|
|
|
|
sget-object v4, Landroid/graphics/PorterDuff$Mode;->SRC_IN:Landroid/graphics/PorterDuff$Mode;
|
|
|
|
invoke-direct {v0, v4}, Landroid/graphics/PorterDuffXfermode;-><init>(Landroid/graphics/PorterDuff$Mode;)V
|
|
|
|
invoke-virtual {v2, v0}, Landroid/graphics/Paint;->setXfermode(Landroid/graphics/Xfermode;)Landroid/graphics/Xfermode;
|
|
|
|
new-instance v0, Landroid/graphics/Rect;
|
|
|
|
invoke-virtual {p1}, Landroid/graphics/Bitmap;->getWidth()I
|
|
|
|
move-result v4
|
|
|
|
invoke-virtual {p1}, Landroid/graphics/Bitmap;->getHeight()I
|
|
|
|
move-result v5
|
|
|
|
invoke-direct {v0, v3, v3, v4, v5}, Landroid/graphics/Rect;-><init>(IIII)V
|
|
|
|
new-instance v4, Landroid/graphics/Rect;
|
|
|
|
iget v5, p0, Lcom/discord/utilities/images/MGImagesBitmap$CirclePostProcessor;->width:I
|
|
|
|
iget v6, p0, Lcom/discord/utilities/images/MGImagesBitmap$CirclePostProcessor;->height:I
|
|
|
|
invoke-direct {v4, v3, v3, v5, v6}, Landroid/graphics/Rect;-><init>(IIII)V
|
|
|
|
invoke-virtual {v1, p1, v0, v4, v2}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Paint;)V
|
|
|
|
invoke-static {p2}, Lcom/facebook/common/references/CloseableReference;->a(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;->b(Lcom/facebook/common/references/CloseableReference;)V
|
|
|
|
return-object p1
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
invoke-static {p2}, Lcom/facebook/common/references/CloseableReference;->b(Lcom/facebook/common/references/CloseableReference;)V
|
|
|
|
throw p1
|
|
|
|
:cond_0
|
|
const-string p1, "bitmapFactory"
|
|
|
|
invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
const-string p1, "sourceBitmap"
|
|
|
|
invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|