279 lines
8.3 KiB
Smali
279 lines
8.3 KiB
Smali
.class public final Lcom/facebook/drawee/drawable/k;
|
|
.super Lcom/facebook/drawee/drawable/n;
|
|
.source "RoundedBitmapDrawable.java"
|
|
|
|
|
|
# instance fields
|
|
.field private final LH:Landroid/graphics/Paint;
|
|
|
|
.field private LI:Ljava/lang/ref/WeakReference;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/lang/ref/WeakReference<",
|
|
"Landroid/graphics/Bitmap;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private final mBitmap:Landroid/graphics/Bitmap;
|
|
.annotation runtime Ljavax/annotation/Nullable;
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private final mPaint:Landroid/graphics/Paint;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/content/res/Resources;Landroid/graphics/Bitmap;Landroid/graphics/Paint;)V
|
|
.locals 1
|
|
.param p2 # Landroid/graphics/Bitmap;
|
|
.annotation runtime Ljavax/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
.param p3 # Landroid/graphics/Paint;
|
|
.annotation runtime Ljavax/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
|
|
new-instance v0, Landroid/graphics/drawable/BitmapDrawable;
|
|
|
|
invoke-direct {v0, p1, p2}, Landroid/graphics/drawable/BitmapDrawable;-><init>(Landroid/content/res/Resources;Landroid/graphics/Bitmap;)V
|
|
|
|
invoke-direct {p0, v0}, Lcom/facebook/drawee/drawable/n;-><init>(Landroid/graphics/drawable/Drawable;)V
|
|
|
|
new-instance p1, Landroid/graphics/Paint;
|
|
|
|
invoke-direct {p1}, Landroid/graphics/Paint;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/facebook/drawee/drawable/k;->mPaint:Landroid/graphics/Paint;
|
|
|
|
new-instance p1, Landroid/graphics/Paint;
|
|
|
|
const/4 v0, 0x1
|
|
|
|
invoke-direct {p1, v0}, Landroid/graphics/Paint;-><init>(I)V
|
|
|
|
iput-object p1, p0, Lcom/facebook/drawee/drawable/k;->LH:Landroid/graphics/Paint;
|
|
|
|
iput-object p2, p0, Lcom/facebook/drawee/drawable/k;->mBitmap:Landroid/graphics/Bitmap;
|
|
|
|
if-eqz p3, :cond_0
|
|
|
|
iget-object p1, p0, Lcom/facebook/drawee/drawable/k;->mPaint:Landroid/graphics/Paint;
|
|
|
|
invoke-virtual {p1, p3}, Landroid/graphics/Paint;->set(Landroid/graphics/Paint;)V
|
|
|
|
:cond_0
|
|
iget-object p1, p0, Lcom/facebook/drawee/drawable/k;->mPaint:Landroid/graphics/Paint;
|
|
|
|
invoke-virtual {p1, v0}, Landroid/graphics/Paint;->setFlags(I)V
|
|
|
|
iget-object p1, p0, Lcom/facebook/drawee/drawable/k;->LH:Landroid/graphics/Paint;
|
|
|
|
sget-object p2, Landroid/graphics/Paint$Style;->STROKE:Landroid/graphics/Paint$Style;
|
|
|
|
invoke-virtual {p1, p2}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final draw(Landroid/graphics/Canvas;)V
|
|
.locals 4
|
|
|
|
invoke-static {}, Lcom/facebook/imagepipeline/i/b;->isTracing()Z
|
|
|
|
invoke-virtual {p0}, Lcom/facebook/drawee/drawable/k;->gJ()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
invoke-super {p0, p1}, Lcom/facebook/drawee/drawable/n;->draw(Landroid/graphics/Canvas;)V
|
|
|
|
invoke-static {}, Lcom/facebook/imagepipeline/i/b;->isTracing()Z
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
invoke-virtual {p0}, Lcom/facebook/drawee/drawable/k;->gM()V
|
|
|
|
invoke-virtual {p0}, Lcom/facebook/drawee/drawable/k;->gK()V
|
|
|
|
iget-object v0, p0, Lcom/facebook/drawee/drawable/k;->LI:Ljava/lang/ref/WeakReference;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-virtual {v0}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v1, p0, Lcom/facebook/drawee/drawable/k;->mBitmap:Landroid/graphics/Bitmap;
|
|
|
|
if-eq v0, v1, :cond_2
|
|
|
|
:cond_1
|
|
new-instance v0, Ljava/lang/ref/WeakReference;
|
|
|
|
iget-object v1, p0, Lcom/facebook/drawee/drawable/k;->mBitmap:Landroid/graphics/Bitmap;
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V
|
|
|
|
iput-object v0, p0, Lcom/facebook/drawee/drawable/k;->LI:Ljava/lang/ref/WeakReference;
|
|
|
|
iget-object v0, p0, Lcom/facebook/drawee/drawable/k;->mPaint:Landroid/graphics/Paint;
|
|
|
|
new-instance v1, Landroid/graphics/BitmapShader;
|
|
|
|
iget-object v2, p0, Lcom/facebook/drawee/drawable/k;->mBitmap:Landroid/graphics/Bitmap;
|
|
|
|
sget-object v3, Landroid/graphics/Shader$TileMode;->CLAMP:Landroid/graphics/Shader$TileMode;
|
|
|
|
invoke-direct {v1, v2, v3, v3}, Landroid/graphics/BitmapShader;-><init>(Landroid/graphics/Bitmap;Landroid/graphics/Shader$TileMode;Landroid/graphics/Shader$TileMode;)V
|
|
|
|
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setShader(Landroid/graphics/Shader;)Landroid/graphics/Shader;
|
|
|
|
const/4 v0, 0x1
|
|
|
|
iput-boolean v0, p0, Lcom/facebook/drawee/drawable/k;->Mf:Z
|
|
|
|
:cond_2
|
|
iget-boolean v0, p0, Lcom/facebook/drawee/drawable/k;->Mf:Z
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
iget-object v0, p0, Lcom/facebook/drawee/drawable/k;->mPaint:Landroid/graphics/Paint;
|
|
|
|
invoke-virtual {v0}, Landroid/graphics/Paint;->getShader()Landroid/graphics/Shader;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v1, p0, Lcom/facebook/drawee/drawable/k;->Mr:Landroid/graphics/Matrix;
|
|
|
|
invoke-virtual {v0, v1}, Landroid/graphics/Shader;->setLocalMatrix(Landroid/graphics/Matrix;)V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput-boolean v0, p0, Lcom/facebook/drawee/drawable/k;->Mf:Z
|
|
|
|
:cond_3
|
|
invoke-virtual {p1}, Landroid/graphics/Canvas;->save()I
|
|
|
|
move-result v0
|
|
|
|
iget-object v1, p0, Lcom/facebook/drawee/drawable/k;->Mp:Landroid/graphics/Matrix;
|
|
|
|
invoke-virtual {p1, v1}, Landroid/graphics/Canvas;->concat(Landroid/graphics/Matrix;)V
|
|
|
|
iget-object v1, p0, Lcom/facebook/drawee/drawable/k;->mPath:Landroid/graphics/Path;
|
|
|
|
iget-object v2, p0, Lcom/facebook/drawee/drawable/k;->mPaint:Landroid/graphics/Paint;
|
|
|
|
invoke-virtual {p1, v1, v2}, Landroid/graphics/Canvas;->drawPath(Landroid/graphics/Path;Landroid/graphics/Paint;)V
|
|
|
|
iget v1, p0, Lcom/facebook/drawee/drawable/k;->LN:F
|
|
|
|
const/4 v2, 0x0
|
|
|
|
cmpl-float v1, v1, v2
|
|
|
|
if-lez v1, :cond_4
|
|
|
|
iget-object v1, p0, Lcom/facebook/drawee/drawable/k;->LH:Landroid/graphics/Paint;
|
|
|
|
iget v2, p0, Lcom/facebook/drawee/drawable/k;->LN:F
|
|
|
|
invoke-virtual {v1, v2}, Landroid/graphics/Paint;->setStrokeWidth(F)V
|
|
|
|
iget-object v1, p0, Lcom/facebook/drawee/drawable/k;->LH:Landroid/graphics/Paint;
|
|
|
|
iget v2, p0, Lcom/facebook/drawee/drawable/k;->LO:I
|
|
|
|
iget-object v3, p0, Lcom/facebook/drawee/drawable/k;->mPaint:Landroid/graphics/Paint;
|
|
|
|
invoke-virtual {v3}, Landroid/graphics/Paint;->getAlpha()I
|
|
|
|
move-result v3
|
|
|
|
invoke-static {v2, v3}, Lcom/facebook/drawee/drawable/e;->j(II)I
|
|
|
|
move-result v2
|
|
|
|
invoke-virtual {v1, v2}, Landroid/graphics/Paint;->setColor(I)V
|
|
|
|
iget-object v1, p0, Lcom/facebook/drawee/drawable/k;->LQ:Landroid/graphics/Path;
|
|
|
|
iget-object v2, p0, Lcom/facebook/drawee/drawable/k;->LH:Landroid/graphics/Paint;
|
|
|
|
invoke-virtual {p1, v1, v2}, Landroid/graphics/Canvas;->drawPath(Landroid/graphics/Path;Landroid/graphics/Paint;)V
|
|
|
|
:cond_4
|
|
invoke-virtual {p1, v0}, Landroid/graphics/Canvas;->restoreToCount(I)V
|
|
|
|
invoke-static {}, Lcom/facebook/imagepipeline/i/b;->isTracing()Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method final gJ()Z
|
|
.locals 1
|
|
|
|
invoke-super {p0}, Lcom/facebook/drawee/drawable/n;->gJ()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/facebook/drawee/drawable/k;->mBitmap:Landroid/graphics/Bitmap;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public final setAlpha(I)V
|
|
.locals 1
|
|
|
|
invoke-super {p0, p1}, Lcom/facebook/drawee/drawable/n;->setAlpha(I)V
|
|
|
|
iget-object v0, p0, Lcom/facebook/drawee/drawable/k;->mPaint:Landroid/graphics/Paint;
|
|
|
|
invoke-virtual {v0}, Landroid/graphics/Paint;->getAlpha()I
|
|
|
|
move-result v0
|
|
|
|
if-eq p1, v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/facebook/drawee/drawable/k;->mPaint:Landroid/graphics/Paint;
|
|
|
|
invoke-virtual {v0, p1}, Landroid/graphics/Paint;->setAlpha(I)V
|
|
|
|
invoke-super {p0, p1}, Lcom/facebook/drawee/drawable/n;->setAlpha(I)V
|
|
|
|
invoke-virtual {p0}, Lcom/facebook/drawee/drawable/k;->invalidateSelf()V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public final setColorFilter(Landroid/graphics/ColorFilter;)V
|
|
.locals 1
|
|
|
|
invoke-super {p0, p1}, Lcom/facebook/drawee/drawable/n;->setColorFilter(Landroid/graphics/ColorFilter;)V
|
|
|
|
iget-object v0, p0, Lcom/facebook/drawee/drawable/k;->mPaint:Landroid/graphics/Paint;
|
|
|
|
invoke-virtual {v0, p1}, Landroid/graphics/Paint;->setColorFilter(Landroid/graphics/ColorFilter;)Landroid/graphics/ColorFilter;
|
|
|
|
return-void
|
|
.end method
|