ArtBitmapFactory.smali
.class public Lcom/facebook/imagepipeline/bitmaps/ArtBitmapFactory;
.super Lcom/facebook/imagepipeline/bitmaps/PlatformBitmapFactory;
.source "SourceFile"
# annotations
.annotation build Landroid/annotation/TargetApi;
value = 0x15
.end annotation
# instance fields
.field private final mBitmapPool:Lcom/facebook/imagepipeline/memory/BitmapPool;
.field private final mCloseableReferenceFactory:Lcom/facebook/imagepipeline/core/CloseableReferenceFactory;
# direct methods
.method public constructor <init>(Lcom/facebook/imagepipeline/memory/BitmapPool;Lcom/facebook/imagepipeline/core/CloseableReferenceFactory;)V
.registers 3
.line 1
invoke-direct {p0}, Lcom/facebook/imagepipeline/bitmaps/PlatformBitmapFactory;-><init>()V
.line 2
iput-object p1, p0, Lcom/facebook/imagepipeline/bitmaps/ArtBitmapFactory;->mBitmapPool:Lcom/facebook/imagepipeline/memory/BitmapPool;
.line 3
iput-object p2, p0, Lcom/facebook/imagepipeline/bitmaps/ArtBitmapFactory;->mCloseableReferenceFactory:Lcom/facebook/imagepipeline/core/CloseableReferenceFactory;
return-void
.end method
# virtual methods
.method public createBitmapInternal(IILandroid/graphics/Bitmap$Config;)Lcom/facebook/common/references/CloseableReference;
.registers 8
.annotation system Ldalvik/annotation/Signature;
value = {
"(II",
"Landroid/graphics/Bitmap$Config;",
")",
"Lcom/facebook/common/references/CloseableReference<",
"Landroid/graphics/Bitmap;",
">;"
}
.end annotation
.line 1
invoke-static {p1, p2, p3}, Lcom/facebook/imageutils/BitmapUtil;->getSizeInByteForBitmap(IILandroid/graphics/Bitmap$Config;)I
move-result v0
.line 2
iget-object v1, p0, Lcom/facebook/imagepipeline/bitmaps/ArtBitmapFactory;->mBitmapPool:Lcom/facebook/imagepipeline/memory/BitmapPool;
invoke-interface {v1, v0}, Lcom/facebook/common/memory/Pool;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/graphics/Bitmap;
.line 3
invoke-virtual {v0}, Landroid/graphics/Bitmap;->getAllocationByteCount()I
move-result v1
mul-int v2, p1, p2
.line 4
invoke-static {p3}, Lcom/facebook/imageutils/BitmapUtil;->getPixelSizeForBitmapConfig(Landroid/graphics/Bitmap$Config;)I
move-result v3
mul-int v3, v3, v2
if-lt v1, v3, :cond_1c
const/4 v1, 0x1
goto :goto_1d
:cond_1c
const/4 v1, 0x0
.line 5
:goto_1d
invoke-static {v1}, Lcom/facebook/common/internal/Preconditions;->checkArgument(Z)V
.line 6
invoke-virtual {v0, p1, p2, p3}, Landroid/graphics/Bitmap;->reconfigure(IILandroid/graphics/Bitmap$Config;)V
.line 7
iget-object p1, p0, Lcom/facebook/imagepipeline/bitmaps/ArtBitmapFactory;->mCloseableReferenceFactory:Lcom/facebook/imagepipeline/core/CloseableReferenceFactory;
iget-object p2, p0, Lcom/facebook/imagepipeline/bitmaps/ArtBitmapFactory;->mBitmapPool:Lcom/facebook/imagepipeline/memory/BitmapPool;
invoke-virtual {p1, v0, p2}, Lcom/facebook/imagepipeline/core/CloseableReferenceFactory;->create(Ljava/lang/Object;Lcom/facebook/common/references/ResourceReleaser;)Lcom/facebook/common/references/CloseableReference;
move-result-object p1
return-object p1
.end method