ArtBitmapFactory.smali
.class public Lcom/facebook/imagepipeline/bitmaps/ArtBitmapFactory;
.super Lcom/facebook/imagepipeline/bitmaps/PlatformBitmapFactory;
.source "ArtBitmapFactory.java"
# annotations
.annotation build Landroid/annotation/TargetApi;
value = 0x15
.end annotation
.annotation build Ljavax/annotation/concurrent/ThreadSafe;
.end annotation
# instance fields
.field public final mBitmapPool:Lcom/facebook/imagepipeline/memory/BitmapPool;
.field public final mCloseableReferenceFactory:Lcom/facebook/imagepipeline/core/CloseableReferenceFactory;
# direct methods
.method static constructor <clinit>()V
.registers 1
return-void
.end method
.method public constructor <init>(Lcom/facebook/imagepipeline/memory/BitmapPool;Lcom/facebook/imagepipeline/core/CloseableReferenceFactory;)V
.registers 3
invoke-direct {p0}, Lcom/facebook/imagepipeline/bitmaps/PlatformBitmapFactory;-><init>()V
iput-object p1, p0, Lcom/facebook/imagepipeline/bitmaps/ArtBitmapFactory;->mBitmapPool:Lcom/facebook/imagepipeline/memory/BitmapPool;
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
invoke-static {p1, p2, p3}, Lcom/facebook/imageutils/BitmapUtil;->getSizeInByteForBitmap(IILandroid/graphics/Bitmap$Config;)I
move-result v0
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;
invoke-virtual {v0}, Landroid/graphics/Bitmap;->getAllocationByteCount()I
move-result v1
mul-int v2, p1, p2
invoke-static {p3}, Lcom/facebook/imageutils/BitmapUtil;->getPixelSizeForBitmapConfig(Landroid/graphics/Bitmap$Config;)I
move-result v3
mul-int v2, v2, v3
if-lt v1, v2, :cond_1c
const/4 v1, 0x1
goto :goto_1d
:cond_1c
const/4 v1, 0x0
:goto_1d
invoke-static {v1}, Lcom/facebook/common/internal/Preconditions;->checkArgument(Z)V
invoke-virtual {v0, p1, p2, p3}, Landroid/graphics/Bitmap;->reconfigure(IILandroid/graphics/Bitmap$Config;)V
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