You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2288 lines
55 KiB
2288 lines
55 KiB
.class Lcom/squareup/picasso/BitmapHunter; |
|
.super Ljava/lang/Object; |
|
.source "BitmapHunter.java" |
|
|
|
# interfaces |
|
.implements Ljava/lang/Runnable; |
|
|
|
|
|
# static fields |
|
.field private static final DECODE_LOCK:Ljava/lang/Object; |
|
|
|
.field private static final ERRORING_HANDLER:Lcom/squareup/picasso/RequestHandler; |
|
|
|
.field private static final NAME_BUILDER:Ljava/lang/ThreadLocal; |
|
.annotation system Ldalvik/annotation/Signature; |
|
value = { |
|
"Ljava/lang/ThreadLocal", |
|
"<", |
|
"Ljava/lang/StringBuilder;", |
|
">;" |
|
} |
|
.end annotation |
|
.end field |
|
|
|
.field private static final SEQUENCE_GENERATOR:Ljava/util/concurrent/atomic/AtomicInteger; |
|
|
|
|
|
# instance fields |
|
.field action:Lcom/squareup/picasso/Action; |
|
|
|
.field actions:Ljava/util/List; |
|
.annotation system Ldalvik/annotation/Signature; |
|
value = { |
|
"Ljava/util/List", |
|
"<", |
|
"Lcom/squareup/picasso/Action;", |
|
">;" |
|
} |
|
.end annotation |
|
.end field |
|
|
|
.field final cache:Lcom/squareup/picasso/Cache; |
|
|
|
.field final data:Lcom/squareup/picasso/Request; |
|
|
|
.field final dispatcher:Lcom/squareup/picasso/Dispatcher; |
|
|
|
.field exception:Ljava/lang/Exception; |
|
|
|
.field exifRotation:I |
|
|
|
.field future:Ljava/util/concurrent/Future; |
|
.annotation system Ldalvik/annotation/Signature; |
|
value = { |
|
"Ljava/util/concurrent/Future", |
|
"<*>;" |
|
} |
|
.end annotation |
|
.end field |
|
|
|
.field final key:Ljava/lang/String; |
|
|
|
.field loadedFrom:Lcom/squareup/picasso/Picasso$LoadedFrom; |
|
|
|
.field final memoryPolicy:I |
|
|
|
.field networkPolicy:I |
|
|
|
.field final picasso:Lcom/squareup/picasso/Picasso; |
|
|
|
.field priority:Lcom/squareup/picasso/Picasso$Priority; |
|
|
|
.field final requestHandler:Lcom/squareup/picasso/RequestHandler; |
|
|
|
.field result:Landroid/graphics/Bitmap; |
|
|
|
.field retryCount:I |
|
|
|
.field final sequence:I |
|
|
|
.field final stats:Lcom/squareup/picasso/Stats; |
|
|
|
|
|
# direct methods |
|
.method static constructor <clinit>()V |
|
.locals 1 |
|
|
|
.prologue |
|
.line 51 |
|
new-instance v0, Ljava/lang/Object; |
|
|
|
invoke-direct {v0}, Ljava/lang/Object;-><init>()V |
|
|
|
sput-object v0, Lcom/squareup/picasso/BitmapHunter;->DECODE_LOCK:Ljava/lang/Object; |
|
|
|
.line 53 |
|
new-instance v0, Lcom/squareup/picasso/BitmapHunter$1; |
|
|
|
invoke-direct {v0}, Lcom/squareup/picasso/BitmapHunter$1;-><init>()V |
|
|
|
sput-object v0, Lcom/squareup/picasso/BitmapHunter;->NAME_BUILDER:Ljava/lang/ThreadLocal; |
|
|
|
.line 59 |
|
new-instance v0, Ljava/util/concurrent/atomic/AtomicInteger; |
|
|
|
invoke-direct {v0}, Ljava/util/concurrent/atomic/AtomicInteger;-><init>()V |
|
|
|
sput-object v0, Lcom/squareup/picasso/BitmapHunter;->SEQUENCE_GENERATOR:Ljava/util/concurrent/atomic/AtomicInteger; |
|
|
|
.line 61 |
|
new-instance v0, Lcom/squareup/picasso/BitmapHunter$2; |
|
|
|
invoke-direct {v0}, Lcom/squareup/picasso/BitmapHunter$2;-><init>()V |
|
|
|
sput-object v0, Lcom/squareup/picasso/BitmapHunter;->ERRORING_HANDLER:Lcom/squareup/picasso/RequestHandler; |
|
|
|
return-void |
|
.end method |
|
|
|
.method constructor <init>(Lcom/squareup/picasso/Picasso;Lcom/squareup/picasso/Dispatcher;Lcom/squareup/picasso/Cache;Lcom/squareup/picasso/Stats;Lcom/squareup/picasso/Action;Lcom/squareup/picasso/RequestHandler;)V |
|
.locals 1 |
|
|
|
.prologue |
|
.line 93 |
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V |
|
|
|
.line 94 |
|
sget-object v0, Lcom/squareup/picasso/BitmapHunter;->SEQUENCE_GENERATOR:Ljava/util/concurrent/atomic/AtomicInteger; |
|
|
|
invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicInteger;->incrementAndGet()I |
|
|
|
move-result v0 |
|
|
|
iput v0, p0, Lcom/squareup/picasso/BitmapHunter;->sequence:I |
|
|
|
.line 95 |
|
iput-object p1, p0, Lcom/squareup/picasso/BitmapHunter;->picasso:Lcom/squareup/picasso/Picasso; |
|
|
|
.line 96 |
|
iput-object p2, p0, Lcom/squareup/picasso/BitmapHunter;->dispatcher:Lcom/squareup/picasso/Dispatcher; |
|
|
|
.line 97 |
|
iput-object p3, p0, Lcom/squareup/picasso/BitmapHunter;->cache:Lcom/squareup/picasso/Cache; |
|
|
|
.line 98 |
|
iput-object p4, p0, Lcom/squareup/picasso/BitmapHunter;->stats:Lcom/squareup/picasso/Stats; |
|
|
|
.line 99 |
|
iput-object p5, p0, Lcom/squareup/picasso/BitmapHunter;->action:Lcom/squareup/picasso/Action; |
|
|
|
.line 100 |
|
invoke-virtual {p5}, Lcom/squareup/picasso/Action;->getKey()Ljava/lang/String; |
|
|
|
move-result-object v0 |
|
|
|
iput-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->key:Ljava/lang/String; |
|
|
|
.line 101 |
|
invoke-virtual {p5}, Lcom/squareup/picasso/Action;->getRequest()Lcom/squareup/picasso/Request; |
|
|
|
move-result-object v0 |
|
|
|
iput-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->data:Lcom/squareup/picasso/Request; |
|
|
|
.line 102 |
|
invoke-virtual {p5}, Lcom/squareup/picasso/Action;->getPriority()Lcom/squareup/picasso/Picasso$Priority; |
|
|
|
move-result-object v0 |
|
|
|
iput-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->priority:Lcom/squareup/picasso/Picasso$Priority; |
|
|
|
.line 103 |
|
invoke-virtual {p5}, Lcom/squareup/picasso/Action;->getMemoryPolicy()I |
|
|
|
move-result v0 |
|
|
|
iput v0, p0, Lcom/squareup/picasso/BitmapHunter;->memoryPolicy:I |
|
|
|
.line 104 |
|
invoke-virtual {p5}, Lcom/squareup/picasso/Action;->getNetworkPolicy()I |
|
|
|
move-result v0 |
|
|
|
iput v0, p0, Lcom/squareup/picasso/BitmapHunter;->networkPolicy:I |
|
|
|
.line 105 |
|
iput-object p6, p0, Lcom/squareup/picasso/BitmapHunter;->requestHandler:Lcom/squareup/picasso/RequestHandler; |
|
|
|
.line 106 |
|
invoke-virtual {p6}, Lcom/squareup/picasso/RequestHandler;->getRetryCount()I |
|
|
|
move-result v0 |
|
|
|
iput v0, p0, Lcom/squareup/picasso/BitmapHunter;->retryCount:I |
|
|
|
.line 107 |
|
return-void |
|
.end method |
|
|
|
.method static applyCustomTransformations(Ljava/util/List;Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap; |
|
.locals 6 |
|
.annotation system Ldalvik/annotation/Signature; |
|
value = { |
|
"(", |
|
"Ljava/util/List", |
|
"<", |
|
"Lcom/squareup/picasso/Transformation;", |
|
">;", |
|
"Landroid/graphics/Bitmap;", |
|
")", |
|
"Landroid/graphics/Bitmap;" |
|
} |
|
.end annotation |
|
|
|
.prologue |
|
const/4 v1, 0x0 |
|
|
|
.line 418 |
|
const/4 v0, 0x0 |
|
|
|
invoke-interface {p0}, Ljava/util/List;->size()I |
|
|
|
move-result v4 |
|
|
|
move v3, v0 |
|
|
|
move-object v2, p1 |
|
|
|
:goto_0 |
|
if-ge v3, v4, :cond_4 |
|
|
|
.line 419 |
|
invoke-interface {p0, v3}, Ljava/util/List;->get(I)Ljava/lang/Object; |
|
|
|
move-result-object v0 |
|
|
|
check-cast v0, Lcom/squareup/picasso/Transformation; |
|
|
|
.line 422 |
|
:try_start_0 |
|
invoke-interface {v0, v2}, Lcom/squareup/picasso/Transformation;->transform(Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap; |
|
:try_end_0 |
|
.catch Ljava/lang/RuntimeException; {:try_start_0 .. :try_end_0} :catch_0 |
|
|
|
move-result-object p1 |
|
|
|
.line 433 |
|
if-nez p1, :cond_1 |
|
|
|
.line 434 |
|
new-instance v2, Ljava/lang/StringBuilder; |
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V |
|
|
|
const-string v4, "Transformation " |
|
|
|
.line 435 |
|
invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v2 |
|
|
|
.line 436 |
|
invoke-interface {v0}, Lcom/squareup/picasso/Transformation;->key()Ljava/lang/String; |
|
|
|
move-result-object v0 |
|
|
|
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v0 |
|
|
|
const-string v2, " returned null after " |
|
|
|
.line 437 |
|
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v0 |
|
|
|
.line 438 |
|
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v0 |
|
|
|
const-string v2, " previous transformation(s).\n\nTransformation list:\n" |
|
|
|
.line 439 |
|
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v2 |
|
|
|
.line 440 |
|
invoke-interface {p0}, Ljava/util/List;->iterator()Ljava/util/Iterator; |
|
|
|
move-result-object v3 |
|
|
|
:goto_1 |
|
invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z |
|
|
|
move-result v0 |
|
|
|
if-eqz v0, :cond_0 |
|
|
|
invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object; |
|
|
|
move-result-object v0 |
|
|
|
check-cast v0, Lcom/squareup/picasso/Transformation; |
|
|
|
.line 441 |
|
invoke-interface {v0}, Lcom/squareup/picasso/Transformation;->key()Ljava/lang/String; |
|
|
|
move-result-object v0 |
|
|
|
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v0 |
|
|
|
const/16 v4, 0xa |
|
|
|
invoke-virtual {v0, v4}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder; |
|
|
|
goto :goto_1 |
|
|
|
.line 423 |
|
:catch_0 |
|
move-exception v2 |
|
|
|
.line 424 |
|
sget-object v3, Lcom/squareup/picasso/Picasso;->HANDLER:Landroid/os/Handler; |
|
|
|
new-instance v4, Lcom/squareup/picasso/BitmapHunter$3; |
|
|
|
invoke-direct {v4, v0, v2}, Lcom/squareup/picasso/BitmapHunter$3;-><init>(Lcom/squareup/picasso/Transformation;Ljava/lang/RuntimeException;)V |
|
|
|
invoke-virtual {v3, v4}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z |
|
|
|
move-object v0, v1 |
|
|
|
.line 476 |
|
:goto_2 |
|
return-object v0 |
|
|
|
.line 443 |
|
:cond_0 |
|
sget-object v0, Lcom/squareup/picasso/Picasso;->HANDLER:Landroid/os/Handler; |
|
|
|
new-instance v3, Lcom/squareup/picasso/BitmapHunter$4; |
|
|
|
invoke-direct {v3, v2}, Lcom/squareup/picasso/BitmapHunter$4;-><init>(Ljava/lang/StringBuilder;)V |
|
|
|
invoke-virtual {v0, v3}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z |
|
|
|
move-object v0, v1 |
|
|
|
.line 448 |
|
goto :goto_2 |
|
|
|
.line 451 |
|
:cond_1 |
|
if-ne p1, v2, :cond_2 |
|
|
|
invoke-virtual {v2}, Landroid/graphics/Bitmap;->isRecycled()Z |
|
|
|
move-result v5 |
|
|
|
if-eqz v5, :cond_2 |
|
|
|
.line 452 |
|
sget-object v2, Lcom/squareup/picasso/Picasso;->HANDLER:Landroid/os/Handler; |
|
|
|
new-instance v3, Lcom/squareup/picasso/BitmapHunter$5; |
|
|
|
invoke-direct {v3, v0}, Lcom/squareup/picasso/BitmapHunter$5;-><init>(Lcom/squareup/picasso/Transformation;)V |
|
|
|
invoke-virtual {v2, v3}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z |
|
|
|
move-object v0, v1 |
|
|
|
.line 459 |
|
goto :goto_2 |
|
|
|
.line 463 |
|
:cond_2 |
|
if-eq p1, v2, :cond_3 |
|
|
|
invoke-virtual {v2}, Landroid/graphics/Bitmap;->isRecycled()Z |
|
|
|
move-result v2 |
|
|
|
if-nez v2, :cond_3 |
|
|
|
.line 464 |
|
sget-object v2, Lcom/squareup/picasso/Picasso;->HANDLER:Landroid/os/Handler; |
|
|
|
new-instance v3, Lcom/squareup/picasso/BitmapHunter$6; |
|
|
|
invoke-direct {v3, v0}, Lcom/squareup/picasso/BitmapHunter$6;-><init>(Lcom/squareup/picasso/Transformation;)V |
|
|
|
invoke-virtual {v2, v3}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z |
|
|
|
move-object v0, v1 |
|
|
|
.line 471 |
|
goto :goto_2 |
|
|
|
.line 418 |
|
:cond_3 |
|
add-int/lit8 v0, v3, 0x1 |
|
|
|
move v3, v0 |
|
|
|
move-object v2, p1 |
|
|
|
goto/16 :goto_0 |
|
|
|
:cond_4 |
|
move-object v0, v2 |
|
|
|
.line 476 |
|
goto :goto_2 |
|
.end method |
|
|
|
.method private computeNewPriority()Lcom/squareup/picasso/Picasso$Priority; |
|
.locals 6 |
|
|
|
.prologue |
|
const/4 v1, 0x1 |
|
|
|
const/4 v2, 0x0 |
|
|
|
.line 299 |
|
sget-object v3, Lcom/squareup/picasso/Picasso$Priority;->LOW:Lcom/squareup/picasso/Picasso$Priority; |
|
|
|
.line 301 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->actions:Ljava/util/List; |
|
|
|
if-eqz v0, :cond_2 |
|
|
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->actions:Ljava/util/List; |
|
|
|
invoke-interface {v0}, Ljava/util/List;->isEmpty()Z |
|
|
|
move-result v0 |
|
|
|
if-nez v0, :cond_2 |
|
|
|
move v0, v1 |
|
|
|
.line 302 |
|
:goto_0 |
|
iget-object v4, p0, Lcom/squareup/picasso/BitmapHunter;->action:Lcom/squareup/picasso/Action; |
|
|
|
if-nez v4, :cond_0 |
|
|
|
if-eqz v0, :cond_3 |
|
|
|
.line 305 |
|
:cond_0 |
|
:goto_1 |
|
if-nez v1, :cond_4 |
|
|
|
move-object v1, v3 |
|
|
|
.line 323 |
|
:cond_1 |
|
return-object v1 |
|
|
|
:cond_2 |
|
move v0, v2 |
|
|
|
.line 301 |
|
goto :goto_0 |
|
|
|
:cond_3 |
|
move v1, v2 |
|
|
|
.line 302 |
|
goto :goto_1 |
|
|
|
.line 309 |
|
:cond_4 |
|
iget-object v1, p0, Lcom/squareup/picasso/BitmapHunter;->action:Lcom/squareup/picasso/Action; |
|
|
|
if-eqz v1, :cond_6 |
|
|
|
.line 310 |
|
iget-object v1, p0, Lcom/squareup/picasso/BitmapHunter;->action:Lcom/squareup/picasso/Action; |
|
|
|
invoke-virtual {v1}, Lcom/squareup/picasso/Action;->getPriority()Lcom/squareup/picasso/Picasso$Priority; |
|
|
|
move-result-object v1 |
|
|
|
.line 313 |
|
:goto_2 |
|
if-eqz v0, :cond_1 |
|
|
|
.line 315 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->actions:Ljava/util/List; |
|
|
|
invoke-interface {v0}, Ljava/util/List;->size()I |
|
|
|
move-result v3 |
|
|
|
:goto_3 |
|
if-ge v2, v3, :cond_1 |
|
|
|
.line 316 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->actions:Ljava/util/List; |
|
|
|
invoke-interface {v0, v2}, Ljava/util/List;->get(I)Ljava/lang/Object; |
|
|
|
move-result-object v0 |
|
|
|
check-cast v0, Lcom/squareup/picasso/Action; |
|
|
|
invoke-virtual {v0}, Lcom/squareup/picasso/Action;->getPriority()Lcom/squareup/picasso/Picasso$Priority; |
|
|
|
move-result-object v0 |
|
|
|
.line 317 |
|
invoke-virtual {v0}, Lcom/squareup/picasso/Picasso$Priority;->ordinal()I |
|
|
|
move-result v4 |
|
|
|
invoke-virtual {v1}, Lcom/squareup/picasso/Picasso$Priority;->ordinal()I |
|
|
|
move-result v5 |
|
|
|
if-le v4, v5, :cond_5 |
|
|
|
.line 315 |
|
:goto_4 |
|
add-int/lit8 v2, v2, 0x1 |
|
|
|
move-object v1, v0 |
|
|
|
goto :goto_3 |
|
|
|
:cond_5 |
|
move-object v0, v1 |
|
|
|
goto :goto_4 |
|
|
|
:cond_6 |
|
move-object v1, v3 |
|
|
|
goto :goto_2 |
|
.end method |
|
|
|
.method static decodeStream(Ljava/io/InputStream;Lcom/squareup/picasso/Request;)Landroid/graphics/Bitmap; |
|
.locals 2 |
|
|
|
.prologue |
|
.line 115 |
|
const-wide/16 v0, -0x1 |
|
|
|
invoke-static {p0, p1, v0, v1}, Lcom/squareup/picasso/BitmapHunter;->decodeStream(Ljava/io/InputStream;Lcom/squareup/picasso/Request;J)Landroid/graphics/Bitmap; |
|
|
|
move-result-object v0 |
|
|
|
return-object v0 |
|
.end method |
|
|
|
.method static decodeStream(Ljava/io/InputStream;Lcom/squareup/picasso/Request;J)Landroid/graphics/Bitmap; |
|
.locals 6 |
|
|
|
.prologue |
|
const/4 v4, 0x0 |
|
|
|
.line 119 |
|
invoke-static {p0}, Lcom/squareup/picasso/Utils;->toByteArray(Ljava/io/InputStream;)[B |
|
|
|
move-result-object v0 |
|
|
|
.line 120 |
|
invoke-static {v0}, Lcom/squareup/picasso/Utils;->isWebPFile([B)Z |
|
|
|
move-result v1 |
|
|
|
.line 124 |
|
if-nez v1, :cond_0 |
|
|
|
const-wide/16 v2, 0x0 |
|
|
|
cmp-long v1, p2, v2 |
|
|
|
if-lez v1, :cond_0 |
|
|
|
array-length v1, v0 |
|
|
|
int-to-long v2, v1 |
|
|
|
cmp-long v1, v2, p2 |
|
|
|
if-eqz v1, :cond_0 |
|
|
|
.line 125 |
|
new-instance v1, Ljava/io/IOException; |
|
|
|
new-instance v2, Ljava/lang/StringBuilder; |
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V |
|
|
|
const-string v3, "Failed to decode bitmap as bad length: " |
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v2 |
|
|
|
array-length v0, v0 |
|
|
|
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v0 |
|
|
|
const-string v2, "/" |
|
|
|
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v0 |
|
|
|
invoke-virtual {v0, p2, p3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v0 |
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; |
|
|
|
move-result-object v0 |
|
|
|
invoke-direct {v1, v0}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V |
|
|
|
throw v1 |
|
|
|
.line 128 |
|
:cond_0 |
|
invoke-static {p1}, Lcom/squareup/picasso/RequestHandler;->createBitmapOptions(Lcom/squareup/picasso/Request;)Landroid/graphics/BitmapFactory$Options; |
|
|
|
move-result-object v1 |
|
|
|
.line 129 |
|
invoke-static {v1}, Lcom/squareup/picasso/RequestHandler;->requiresInSampleSize(Landroid/graphics/BitmapFactory$Options;)Z |
|
|
|
move-result v2 |
|
|
|
.line 130 |
|
if-eqz v2, :cond_1 |
|
|
|
.line 131 |
|
array-length v2, v0 |
|
|
|
invoke-static {v0, v4, v2, v1}, Landroid/graphics/BitmapFactory;->decodeByteArray([BIILandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap; |
|
|
|
.line 132 |
|
iget v2, p1, Lcom/squareup/picasso/Request;->targetWidth:I |
|
|
|
iget v3, p1, Lcom/squareup/picasso/Request;->targetHeight:I |
|
|
|
invoke-static {v2, v3, v1, p1}, Lcom/squareup/picasso/RequestHandler;->calculateInSampleSize(IILandroid/graphics/BitmapFactory$Options;Lcom/squareup/picasso/Request;)V |
|
|
|
.line 135 |
|
:cond_1 |
|
array-length v2, v0 |
|
|
|
invoke-static {v0, v4, v2, v1}, Landroid/graphics/BitmapFactory;->decodeByteArray([BIILandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap; |
|
|
|
move-result-object v0 |
|
|
|
.line 136 |
|
if-nez v0, :cond_2 |
|
|
|
.line 138 |
|
new-instance v0, Ljava/io/IOException; |
|
|
|
const-string v1, "Failed to decode stream." |
|
|
|
invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V |
|
|
|
throw v0 |
|
|
|
.line 140 |
|
:cond_2 |
|
return-object v0 |
|
.end method |
|
|
|
.method static forRequest(Lcom/squareup/picasso/Picasso;Lcom/squareup/picasso/Dispatcher;Lcom/squareup/picasso/Cache;Lcom/squareup/picasso/Stats;Lcom/squareup/picasso/Action;)Lcom/squareup/picasso/BitmapHunter; |
|
.locals 7 |
|
|
|
.prologue |
|
.line 402 |
|
invoke-virtual {p4}, Lcom/squareup/picasso/Action;->getRequest()Lcom/squareup/picasso/Request; |
|
|
|
move-result-object v1 |
|
|
|
.line 403 |
|
invoke-virtual {p0}, Lcom/squareup/picasso/Picasso;->getRequestHandlers()Ljava/util/List; |
|
|
|
move-result-object v2 |
|
|
|
.line 407 |
|
const/4 v0, 0x0 |
|
|
|
invoke-interface {v2}, Ljava/util/List;->size()I |
|
|
|
move-result v3 |
|
|
|
:goto_0 |
|
if-ge v0, v3, :cond_1 |
|
|
|
.line 408 |
|
invoke-interface {v2, v0}, Ljava/util/List;->get(I)Ljava/lang/Object; |
|
|
|
move-result-object v6 |
|
|
|
check-cast v6, Lcom/squareup/picasso/RequestHandler; |
|
|
|
.line 409 |
|
invoke-virtual {v6, v1}, Lcom/squareup/picasso/RequestHandler;->canHandleRequest(Lcom/squareup/picasso/Request;)Z |
|
|
|
move-result v4 |
|
|
|
if-eqz v4, :cond_0 |
|
|
|
.line 410 |
|
new-instance v0, Lcom/squareup/picasso/BitmapHunter; |
|
|
|
move-object v1, p0 |
|
|
|
move-object v2, p1 |
|
|
|
move-object v3, p2 |
|
|
|
move-object v4, p3 |
|
|
|
move-object v5, p4 |
|
|
|
invoke-direct/range {v0 .. v6}, Lcom/squareup/picasso/BitmapHunter;-><init>(Lcom/squareup/picasso/Picasso;Lcom/squareup/picasso/Dispatcher;Lcom/squareup/picasso/Cache;Lcom/squareup/picasso/Stats;Lcom/squareup/picasso/Action;Lcom/squareup/picasso/RequestHandler;)V |
|
|
|
.line 414 |
|
:goto_1 |
|
return-object v0 |
|
|
|
.line 407 |
|
:cond_0 |
|
add-int/lit8 v0, v0, 0x1 |
|
|
|
goto :goto_0 |
|
|
|
.line 414 |
|
:cond_1 |
|
new-instance v0, Lcom/squareup/picasso/BitmapHunter; |
|
|
|
sget-object v6, Lcom/squareup/picasso/BitmapHunter;->ERRORING_HANDLER:Lcom/squareup/picasso/RequestHandler; |
|
|
|
move-object v1, p0 |
|
|
|
move-object v2, p1 |
|
|
|
move-object v3, p2 |
|
|
|
move-object v4, p3 |
|
|
|
move-object v5, p4 |
|
|
|
invoke-direct/range {v0 .. v6}, Lcom/squareup/picasso/BitmapHunter;-><init>(Lcom/squareup/picasso/Picasso;Lcom/squareup/picasso/Dispatcher;Lcom/squareup/picasso/Cache;Lcom/squareup/picasso/Stats;Lcom/squareup/picasso/Action;Lcom/squareup/picasso/RequestHandler;)V |
|
|
|
goto :goto_1 |
|
.end method |
|
|
|
.method private static shouldResize(ZIIII)Z |
|
.locals 1 |
|
|
|
.prologue |
|
.line 562 |
|
if-eqz p0, :cond_0 |
|
|
|
if-gt p1, p3, :cond_0 |
|
|
|
if-le p2, p4, :cond_1 |
|
|
|
:cond_0 |
|
const/4 v0, 0x1 |
|
|
|
:goto_0 |
|
return v0 |
|
|
|
:cond_1 |
|
const/4 v0, 0x0 |
|
|
|
goto :goto_0 |
|
.end method |
|
|
|
.method static transformResult(Lcom/squareup/picasso/Request;Landroid/graphics/Bitmap;I)Landroid/graphics/Bitmap; |
|
.locals 16 |
|
|
|
.prologue |
|
.line 480 |
|
invoke-virtual/range {p1 .. p1}, Landroid/graphics/Bitmap;->getWidth()I |
|
|
|
move-result v8 |
|
|
|
.line 481 |
|
invoke-virtual/range {p1 .. p1}, Landroid/graphics/Bitmap;->getHeight()I |
|
|
|
move-result v5 |
|
|
|
.line 482 |
|
move-object/from16 v0, p0 |
|
|
|
iget-boolean v11, v0, Lcom/squareup/picasso/Request;->onlyScaleDown:Z |
|
|
|
.line 484 |
|
const/4 v9, 0x0 |
|
|
|
.line 485 |
|
const/4 v6, 0x0 |
|
|
|
.line 489 |
|
new-instance v7, Landroid/graphics/Matrix; |
|
|
|
invoke-direct {v7}, Landroid/graphics/Matrix;-><init>()V |
|
|
|
.line 491 |
|
invoke-virtual/range {p0 .. p0}, Lcom/squareup/picasso/Request;->needsMatrixTransform()Z |
|
|
|
move-result v2 |
|
|
|
if-eqz v2, :cond_c |
|
|
|
.line 492 |
|
move-object/from16 v0, p0 |
|
|
|
iget v12, v0, Lcom/squareup/picasso/Request;->targetWidth:I |
|
|
|
.line 493 |
|
move-object/from16 v0, p0 |
|
|
|
iget v13, v0, Lcom/squareup/picasso/Request;->targetHeight:I |
|
|
|
.line 495 |
|
move-object/from16 v0, p0 |
|
|
|
iget v2, v0, Lcom/squareup/picasso/Request;->rotationDegrees:F |
|
|
|
.line 496 |
|
const/4 v3, 0x0 |
|
|
|
cmpl-float v3, v2, v3 |
|
|
|
if-eqz v3, :cond_0 |
|
|
|
.line 497 |
|
move-object/from16 v0, p0 |
|
|
|
iget-boolean v3, v0, Lcom/squareup/picasso/Request;->hasRotationPivot:Z |
|
|
|
if-eqz v3, :cond_4 |
|
|
|
.line 498 |
|
move-object/from16 v0, p0 |
|
|
|
iget v3, v0, Lcom/squareup/picasso/Request;->rotationPivotX:F |
|
|
|
move-object/from16 v0, p0 |
|
|
|
iget v4, v0, Lcom/squareup/picasso/Request;->rotationPivotY:F |
|
|
|
invoke-virtual {v7, v2, v3, v4}, Landroid/graphics/Matrix;->setRotate(FFF)V |
|
|
|
.line 504 |
|
:cond_0 |
|
:goto_0 |
|
move-object/from16 v0, p0 |
|
|
|
iget-boolean v2, v0, Lcom/squareup/picasso/Request;->centerCrop:Z |
|
|
|
if-eqz v2, :cond_6 |
|
|
|
.line 505 |
|
int-to-float v2, v12 |
|
|
|
int-to-float v3, v8 |
|
|
|
div-float v3, v2, v3 |
|
|
|
.line 506 |
|
int-to-float v2, v13 |
|
|
|
int-to-float v4, v5 |
|
|
|
div-float/2addr v2, v4 |
|
|
|
.line 508 |
|
cmpl-float v4, v3, v2 |
|
|
|
if-lez v4, :cond_5 |
|
|
|
.line 509 |
|
int-to-float v4, v5 |
|
|
|
div-float/2addr v2, v3 |
|
|
|
mul-float/2addr v2, v4 |
|
|
|
float-to-double v14, v2 |
|
|
|
invoke-static {v14, v15}, Ljava/lang/Math;->ceil(D)D |
|
|
|
move-result-wide v14 |
|
|
|
double-to-int v4, v14 |
|
|
|
.line 510 |
|
sub-int v2, v5, v4 |
|
|
|
div-int/lit8 v6, v2, 0x2 |
|
|
|
.line 513 |
|
int-to-float v2, v13 |
|
|
|
int-to-float v10, v4 |
|
|
|
div-float/2addr v2, v10 |
|
|
|
move v10, v9 |
|
|
|
move v9, v6 |
|
|
|
move v6, v8 |
|
|
|
.line 521 |
|
:goto_1 |
|
invoke-static {v11, v8, v5, v12, v13}, Lcom/squareup/picasso/BitmapHunter;->shouldResize(ZIIII)Z |
|
|
|
move-result v5 |
|
|
|
if-eqz v5, :cond_1 |
|
|
|
.line 522 |
|
invoke-virtual {v7, v3, v2}, Landroid/graphics/Matrix;->preScale(FF)Z |
|
|
|
:cond_1 |
|
move v5, v6 |
|
|
|
move v3, v10 |
|
|
|
move v6, v4 |
|
|
|
move v4, v9 |
|
|
|
.line 546 |
|
:goto_2 |
|
if-eqz p2, :cond_2 |
|
|
|
.line 547 |
|
move/from16 v0, p2 |
|
|
|
int-to-float v2, v0 |
|
|
|
invoke-virtual {v7, v2}, Landroid/graphics/Matrix;->preRotate(F)Z |
|
|
|
.line 550 |
|
:cond_2 |
|
const/4 v8, 0x1 |
|
|
|
move-object/from16 v2, p1 |
|
|
|
.line 551 |
|
invoke-static/range {v2 .. v8}, Landroid/graphics/Bitmap;->createBitmap(Landroid/graphics/Bitmap;IIIILandroid/graphics/Matrix;Z)Landroid/graphics/Bitmap; |
|
|
|
move-result-object v2 |
|
|
|
.line 552 |
|
move-object/from16 v0, p1 |
|
|
|
if-eq v2, v0, :cond_3 |
|
|
|
.line 553 |
|
invoke-virtual/range {p1 .. p1}, Landroid/graphics/Bitmap;->recycle()V |
|
|
|
move-object/from16 p1, v2 |
|
|
|
.line 557 |
|
:cond_3 |
|
return-object p1 |
|
|
|
.line 500 |
|
:cond_4 |
|
invoke-virtual {v7, v2}, Landroid/graphics/Matrix;->setRotate(F)V |
|
|
|
goto :goto_0 |
|
|
|
.line 515 |
|
:cond_5 |
|
int-to-float v4, v8 |
|
|
|
div-float/2addr v3, v2 |
|
|
|
mul-float/2addr v3, v4 |
|
|
|
float-to-double v14, v3 |
|
|
|
invoke-static {v14, v15}, Ljava/lang/Math;->ceil(D)D |
|
|
|
move-result-wide v14 |
|
|
|
double-to-int v4, v14 |
|
|
|
.line 516 |
|
sub-int v3, v8, v4 |
|
|
|
div-int/lit8 v9, v3, 0x2 |
|
|
|
.line 518 |
|
int-to-float v3, v12 |
|
|
|
int-to-float v10, v4 |
|
|
|
div-float/2addr v3, v10 |
|
|
|
move v10, v9 |
|
|
|
move v9, v6 |
|
|
|
move v6, v4 |
|
|
|
move v4, v5 |
|
|
|
.line 519 |
|
goto :goto_1 |
|
|
|
.line 524 |
|
:cond_6 |
|
move-object/from16 v0, p0 |
|
|
|
iget-boolean v2, v0, Lcom/squareup/picasso/Request;->centerInside:Z |
|
|
|
if-eqz v2, :cond_9 |
|
|
|
.line 525 |
|
int-to-float v2, v12 |
|
|
|
int-to-float v3, v8 |
|
|
|
div-float/2addr v2, v3 |
|
|
|
.line 526 |
|
int-to-float v3, v13 |
|
|
|
int-to-float v4, v5 |
|
|
|
div-float/2addr v3, v4 |
|
|
|
.line 527 |
|
cmpg-float v4, v2, v3 |
|
|
|
if-gez v4, :cond_8 |
|
|
|
.line 528 |
|
:goto_3 |
|
invoke-static {v11, v8, v5, v12, v13}, Lcom/squareup/picasso/BitmapHunter;->shouldResize(ZIIII)Z |
|
|
|
move-result v3 |
|
|
|
if-eqz v3, :cond_7 |
|
|
|
.line 529 |
|
invoke-virtual {v7, v2, v2}, Landroid/graphics/Matrix;->preScale(FF)Z |
|
|
|
:cond_7 |
|
move v4, v6 |
|
|
|
move v3, v9 |
|
|
|
move v6, v5 |
|
|
|
move v5, v8 |
|
|
|
.line 531 |
|
goto :goto_2 |
|
|
|
:cond_8 |
|
move v2, v3 |
|
|
|
.line 527 |
|
goto :goto_3 |
|
|
|
.line 531 |
|
:cond_9 |
|
if-nez v12, :cond_a |
|
|
|
if-eqz v13, :cond_c |
|
|
|
:cond_a |
|
if-ne v12, v8, :cond_b |
|
|
|
if-eq v13, v5, :cond_c |
|
|
|
.line 536 |
|
:cond_b |
|
if-eqz v12, :cond_d |
|
|
|
int-to-float v2, v12 |
|
|
|
int-to-float v3, v8 |
|
|
|
div-float/2addr v2, v3 |
|
|
|
move v3, v2 |
|
|
|
.line 538 |
|
:goto_4 |
|
if-eqz v13, :cond_e |
|
|
|
int-to-float v2, v13 |
|
|
|
int-to-float v4, v5 |
|
|
|
div-float/2addr v2, v4 |
|
|
|
.line 540 |
|
:goto_5 |
|
invoke-static {v11, v8, v5, v12, v13}, Lcom/squareup/picasso/BitmapHunter;->shouldResize(ZIIII)Z |
|
|
|
move-result v4 |
|
|
|
if-eqz v4, :cond_c |
|
|
|
.line 541 |
|
invoke-virtual {v7, v3, v2}, Landroid/graphics/Matrix;->preScale(FF)Z |
|
|
|
:cond_c |
|
move v4, v6 |
|
|
|
move v3, v9 |
|
|
|
move v6, v5 |
|
|
|
move v5, v8 |
|
|
|
goto :goto_2 |
|
|
|
.line 536 |
|
:cond_d |
|
int-to-float v2, v13 |
|
|
|
int-to-float v3, v5 |
|
|
|
div-float/2addr v2, v3 |
|
|
|
move v3, v2 |
|
|
|
goto :goto_4 |
|
|
|
.line 538 |
|
:cond_e |
|
int-to-float v2, v12 |
|
|
|
int-to-float v4, v8 |
|
|
|
div-float/2addr v2, v4 |
|
|
|
goto :goto_5 |
|
.end method |
|
|
|
.method static updateThreadName(Lcom/squareup/picasso/Request;)V |
|
.locals 4 |
|
|
|
.prologue |
|
.line 391 |
|
invoke-virtual {p0}, Lcom/squareup/picasso/Request;->getName()Ljava/lang/String; |
|
|
|
move-result-object v1 |
|
|
|
.line 393 |
|
sget-object v0, Lcom/squareup/picasso/BitmapHunter;->NAME_BUILDER:Ljava/lang/ThreadLocal; |
|
|
|
invoke-virtual {v0}, Ljava/lang/ThreadLocal;->get()Ljava/lang/Object; |
|
|
|
move-result-object v0 |
|
|
|
check-cast v0, Ljava/lang/StringBuilder; |
|
|
|
.line 394 |
|
const-string v2, "Picasso-" |
|
|
|
invoke-virtual {v2}, Ljava/lang/String;->length()I |
|
|
|
move-result v2 |
|
|
|
invoke-virtual {v1}, Ljava/lang/String;->length()I |
|
|
|
move-result v3 |
|
|
|
add-int/2addr v2, v3 |
|
|
|
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->ensureCapacity(I)V |
|
|
|
.line 395 |
|
const-string v2, "Picasso-" |
|
|
|
invoke-virtual {v2}, Ljava/lang/String;->length()I |
|
|
|
move-result v2 |
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->length()I |
|
|
|
move-result v3 |
|
|
|
invoke-virtual {v0, v2, v3, v1}, Ljava/lang/StringBuilder;->replace(IILjava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
.line 397 |
|
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread; |
|
|
|
move-result-object v1 |
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; |
|
|
|
move-result-object v0 |
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/Thread;->setName(Ljava/lang/String;)V |
|
|
|
.line 398 |
|
return-void |
|
.end method |
|
|
|
|
|
# virtual methods |
|
.method attach(Lcom/squareup/picasso/Action;)V |
|
.locals 4 |
|
|
|
.prologue |
|
.line 247 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->picasso:Lcom/squareup/picasso/Picasso; |
|
|
|
iget-boolean v0, v0, Lcom/squareup/picasso/Picasso;->loggingEnabled:Z |
|
|
|
.line 248 |
|
iget-object v1, p1, Lcom/squareup/picasso/Action;->request:Lcom/squareup/picasso/Request; |
|
|
|
.line 250 |
|
iget-object v2, p0, Lcom/squareup/picasso/BitmapHunter;->action:Lcom/squareup/picasso/Action; |
|
|
|
if-nez v2, :cond_3 |
|
|
|
.line 251 |
|
iput-object p1, p0, Lcom/squareup/picasso/BitmapHunter;->action:Lcom/squareup/picasso/Action; |
|
|
|
.line 252 |
|
if-eqz v0, :cond_1 |
|
|
|
.line 253 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->actions:Ljava/util/List; |
|
|
|
if-eqz v0, :cond_0 |
|
|
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->actions:Ljava/util/List; |
|
|
|
invoke-interface {v0}, Ljava/util/List;->isEmpty()Z |
|
|
|
move-result v0 |
|
|
|
if-eqz v0, :cond_2 |
|
|
|
.line 254 |
|
:cond_0 |
|
const-string v0, "Hunter" |
|
|
|
const-string v2, "joined" |
|
|
|
invoke-virtual {v1}, Lcom/squareup/picasso/Request;->logId()Ljava/lang/String; |
|
|
|
move-result-object v1 |
|
|
|
const-string v3, "to empty hunter" |
|
|
|
invoke-static {v0, v2, v1, v3}, Lcom/squareup/picasso/Utils;->log(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V |
|
|
|
.line 276 |
|
:cond_1 |
|
:goto_0 |
|
return-void |
|
|
|
.line 256 |
|
:cond_2 |
|
const-string v0, "Hunter" |
|
|
|
const-string v2, "joined" |
|
|
|
invoke-virtual {v1}, Lcom/squareup/picasso/Request;->logId()Ljava/lang/String; |
|
|
|
move-result-object v1 |
|
|
|
const-string v3, "to " |
|
|
|
invoke-static {p0, v3}, Lcom/squareup/picasso/Utils;->getLogIdsForHunter(Lcom/squareup/picasso/BitmapHunter;Ljava/lang/String;)Ljava/lang/String; |
|
|
|
move-result-object v3 |
|
|
|
invoke-static {v0, v2, v1, v3}, Lcom/squareup/picasso/Utils;->log(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V |
|
|
|
goto :goto_0 |
|
|
|
.line 262 |
|
:cond_3 |
|
iget-object v2, p0, Lcom/squareup/picasso/BitmapHunter;->actions:Ljava/util/List; |
|
|
|
if-nez v2, :cond_4 |
|
|
|
.line 263 |
|
new-instance v2, Ljava/util/ArrayList; |
|
|
|
const/4 v3, 0x3 |
|
|
|
invoke-direct {v2, v3}, Ljava/util/ArrayList;-><init>(I)V |
|
|
|
iput-object v2, p0, Lcom/squareup/picasso/BitmapHunter;->actions:Ljava/util/List; |
|
|
|
.line 266 |
|
:cond_4 |
|
iget-object v2, p0, Lcom/squareup/picasso/BitmapHunter;->actions:Ljava/util/List; |
|
|
|
invoke-interface {v2, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z |
|
|
|
.line 268 |
|
if-eqz v0, :cond_5 |
|
|
|
.line 269 |
|
const-string v0, "Hunter" |
|
|
|
const-string v2, "joined" |
|
|
|
invoke-virtual {v1}, Lcom/squareup/picasso/Request;->logId()Ljava/lang/String; |
|
|
|
move-result-object v1 |
|
|
|
const-string v3, "to " |
|
|
|
invoke-static {p0, v3}, Lcom/squareup/picasso/Utils;->getLogIdsForHunter(Lcom/squareup/picasso/BitmapHunter;Ljava/lang/String;)Ljava/lang/String; |
|
|
|
move-result-object v3 |
|
|
|
invoke-static {v0, v2, v1, v3}, Lcom/squareup/picasso/Utils;->log(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V |
|
|
|
.line 272 |
|
:cond_5 |
|
invoke-virtual {p1}, Lcom/squareup/picasso/Action;->getPriority()Lcom/squareup/picasso/Picasso$Priority; |
|
|
|
move-result-object v0 |
|
|
|
.line 273 |
|
invoke-virtual {v0}, Lcom/squareup/picasso/Picasso$Priority;->ordinal()I |
|
|
|
move-result v1 |
|
|
|
iget-object v2, p0, Lcom/squareup/picasso/BitmapHunter;->priority:Lcom/squareup/picasso/Picasso$Priority; |
|
|
|
invoke-virtual {v2}, Lcom/squareup/picasso/Picasso$Priority;->ordinal()I |
|
|
|
move-result v2 |
|
|
|
if-le v1, v2, :cond_1 |
|
|
|
.line 274 |
|
iput-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->priority:Lcom/squareup/picasso/Picasso$Priority; |
|
|
|
goto :goto_0 |
|
.end method |
|
|
|
.method cancel()Z |
|
.locals 2 |
|
|
|
.prologue |
|
const/4 v0, 0x0 |
|
|
|
.line 327 |
|
iget-object v1, p0, Lcom/squareup/picasso/BitmapHunter;->action:Lcom/squareup/picasso/Action; |
|
|
|
if-nez v1, :cond_1 |
|
|
|
iget-object v1, p0, Lcom/squareup/picasso/BitmapHunter;->actions:Ljava/util/List; |
|
|
|
if-eqz v1, :cond_0 |
|
|
|
iget-object v1, p0, Lcom/squareup/picasso/BitmapHunter;->actions:Ljava/util/List; |
|
|
|
.line 328 |
|
invoke-interface {v1}, Ljava/util/List;->isEmpty()Z |
|
|
|
move-result v1 |
|
|
|
if-eqz v1, :cond_1 |
|
|
|
:cond_0 |
|
iget-object v1, p0, Lcom/squareup/picasso/BitmapHunter;->future:Ljava/util/concurrent/Future; |
|
|
|
if-eqz v1, :cond_1 |
|
|
|
iget-object v1, p0, Lcom/squareup/picasso/BitmapHunter;->future:Ljava/util/concurrent/Future; |
|
|
|
.line 330 |
|
invoke-interface {v1, v0}, Ljava/util/concurrent/Future;->cancel(Z)Z |
|
|
|
move-result v1 |
|
|
|
if-eqz v1, :cond_1 |
|
|
|
const/4 v0, 0x1 |
|
|
|
.line 327 |
|
:cond_1 |
|
return v0 |
|
.end method |
|
|
|
.method detach(Lcom/squareup/picasso/Action;)V |
|
.locals 4 |
|
|
|
.prologue |
|
.line 279 |
|
const/4 v0, 0x0 |
|
|
|
.line 280 |
|
iget-object v1, p0, Lcom/squareup/picasso/BitmapHunter;->action:Lcom/squareup/picasso/Action; |
|
|
|
if-ne v1, p1, :cond_3 |
|
|
|
.line 281 |
|
const/4 v0, 0x0 |
|
|
|
iput-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->action:Lcom/squareup/picasso/Action; |
|
|
|
.line 282 |
|
const/4 v0, 0x1 |
|
|
|
.line 289 |
|
:cond_0 |
|
:goto_0 |
|
if-eqz v0, :cond_1 |
|
|
|
invoke-virtual {p1}, Lcom/squareup/picasso/Action;->getPriority()Lcom/squareup/picasso/Picasso$Priority; |
|
|
|
move-result-object v0 |
|
|
|
iget-object v1, p0, Lcom/squareup/picasso/BitmapHunter;->priority:Lcom/squareup/picasso/Picasso$Priority; |
|
|
|
if-ne v0, v1, :cond_1 |
|
|
|
.line 290 |
|
invoke-direct {p0}, Lcom/squareup/picasso/BitmapHunter;->computeNewPriority()Lcom/squareup/picasso/Picasso$Priority; |
|
|
|
move-result-object v0 |
|
|
|
iput-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->priority:Lcom/squareup/picasso/Picasso$Priority; |
|
|
|
.line 293 |
|
:cond_1 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->picasso:Lcom/squareup/picasso/Picasso; |
|
|
|
iget-boolean v0, v0, Lcom/squareup/picasso/Picasso;->loggingEnabled:Z |
|
|
|
if-eqz v0, :cond_2 |
|
|
|
.line 294 |
|
const-string v0, "Hunter" |
|
|
|
const-string v1, "removed" |
|
|
|
iget-object v2, p1, Lcom/squareup/picasso/Action;->request:Lcom/squareup/picasso/Request; |
|
|
|
invoke-virtual {v2}, Lcom/squareup/picasso/Request;->logId()Ljava/lang/String; |
|
|
|
move-result-object v2 |
|
|
|
const-string v3, "from " |
|
|
|
invoke-static {p0, v3}, Lcom/squareup/picasso/Utils;->getLogIdsForHunter(Lcom/squareup/picasso/BitmapHunter;Ljava/lang/String;)Ljava/lang/String; |
|
|
|
move-result-object v3 |
|
|
|
invoke-static {v0, v1, v2, v3}, Lcom/squareup/picasso/Utils;->log(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V |
|
|
|
.line 296 |
|
:cond_2 |
|
return-void |
|
|
|
.line 283 |
|
:cond_3 |
|
iget-object v1, p0, Lcom/squareup/picasso/BitmapHunter;->actions:Ljava/util/List; |
|
|
|
if-eqz v1, :cond_0 |
|
|
|
.line 284 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->actions:Ljava/util/List; |
|
|
|
invoke-interface {v0, p1}, Ljava/util/List;->remove(Ljava/lang/Object;)Z |
|
|
|
move-result v0 |
|
|
|
goto :goto_0 |
|
.end method |
|
|
|
.method getAction()Lcom/squareup/picasso/Action; |
|
.locals 1 |
|
|
|
.prologue |
|
.line 367 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->action:Lcom/squareup/picasso/Action; |
|
|
|
return-object v0 |
|
.end method |
|
|
|
.method getActions()Ljava/util/List; |
|
.locals 1 |
|
.annotation system Ldalvik/annotation/Signature; |
|
value = { |
|
"()", |
|
"Ljava/util/List", |
|
"<", |
|
"Lcom/squareup/picasso/Action;", |
|
">;" |
|
} |
|
.end annotation |
|
|
|
.prologue |
|
.line 375 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->actions:Ljava/util/List; |
|
|
|
return-object v0 |
|
.end method |
|
|
|
.method getData()Lcom/squareup/picasso/Request; |
|
.locals 1 |
|
|
|
.prologue |
|
.line 363 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->data:Lcom/squareup/picasso/Request; |
|
|
|
return-object v0 |
|
.end method |
|
|
|
.method getException()Ljava/lang/Exception; |
|
.locals 1 |
|
|
|
.prologue |
|
.line 379 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->exception:Ljava/lang/Exception; |
|
|
|
return-object v0 |
|
.end method |
|
|
|
.method getKey()Ljava/lang/String; |
|
.locals 1 |
|
|
|
.prologue |
|
.line 355 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->key:Ljava/lang/String; |
|
|
|
return-object v0 |
|
.end method |
|
|
|
.method getLoadedFrom()Lcom/squareup/picasso/Picasso$LoadedFrom; |
|
.locals 1 |
|
|
|
.prologue |
|
.line 383 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->loadedFrom:Lcom/squareup/picasso/Picasso$LoadedFrom; |
|
|
|
return-object v0 |
|
.end method |
|
|
|
.method getMemoryPolicy()I |
|
.locals 1 |
|
|
|
.prologue |
|
.line 359 |
|
iget v0, p0, Lcom/squareup/picasso/BitmapHunter;->memoryPolicy:I |
|
|
|
return v0 |
|
.end method |
|
|
|
.method getPicasso()Lcom/squareup/picasso/Picasso; |
|
.locals 1 |
|
|
|
.prologue |
|
.line 371 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->picasso:Lcom/squareup/picasso/Picasso; |
|
|
|
return-object v0 |
|
.end method |
|
|
|
.method getPriority()Lcom/squareup/picasso/Picasso$Priority; |
|
.locals 1 |
|
|
|
.prologue |
|
.line 387 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->priority:Lcom/squareup/picasso/Picasso$Priority; |
|
|
|
return-object v0 |
|
.end method |
|
|
|
.method getResult()Landroid/graphics/Bitmap; |
|
.locals 1 |
|
|
|
.prologue |
|
.line 351 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->result:Landroid/graphics/Bitmap; |
|
|
|
return-object v0 |
|
.end method |
|
|
|
.method hunt()Landroid/graphics/Bitmap; |
|
.locals 6 |
|
|
|
.prologue |
|
.line 183 |
|
const/4 v0, 0x0 |
|
|
|
.line 185 |
|
iget v1, p0, Lcom/squareup/picasso/BitmapHunter;->memoryPolicy:I |
|
|
|
invoke-static {v1}, Lcom/squareup/picasso/MemoryPolicy;->shouldReadFromMemoryCache(I)Z |
|
|
|
move-result v1 |
|
|
|
if-eqz v1, :cond_1 |
|
|
|
.line 186 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->cache:Lcom/squareup/picasso/Cache; |
|
|
|
iget-object v1, p0, Lcom/squareup/picasso/BitmapHunter;->key:Ljava/lang/String; |
|
|
|
invoke-interface {v0, v1}, Lcom/squareup/picasso/Cache;->get(Ljava/lang/String;)Landroid/graphics/Bitmap; |
|
|
|
move-result-object v0 |
|
|
|
.line 187 |
|
if-eqz v0, :cond_1 |
|
|
|
.line 188 |
|
iget-object v1, p0, Lcom/squareup/picasso/BitmapHunter;->stats:Lcom/squareup/picasso/Stats; |
|
|
|
invoke-virtual {v1}, Lcom/squareup/picasso/Stats;->dispatchCacheHit()V |
|
|
|
.line 189 |
|
sget-object v1, Lcom/squareup/picasso/Picasso$LoadedFrom;->MEMORY:Lcom/squareup/picasso/Picasso$LoadedFrom; |
|
|
|
iput-object v1, p0, Lcom/squareup/picasso/BitmapHunter;->loadedFrom:Lcom/squareup/picasso/Picasso$LoadedFrom; |
|
|
|
.line 190 |
|
iget-object v1, p0, Lcom/squareup/picasso/BitmapHunter;->picasso:Lcom/squareup/picasso/Picasso; |
|
|
|
iget-boolean v1, v1, Lcom/squareup/picasso/Picasso;->loggingEnabled:Z |
|
|
|
if-eqz v1, :cond_0 |
|
|
|
.line 191 |
|
const-string v1, "Hunter" |
|
|
|
const-string v2, "decoded" |
|
|
|
iget-object v3, p0, Lcom/squareup/picasso/BitmapHunter;->data:Lcom/squareup/picasso/Request; |
|
|
|
invoke-virtual {v3}, Lcom/squareup/picasso/Request;->logId()Ljava/lang/String; |
|
|
|
move-result-object v3 |
|
|
|
const-string v4, "from cache" |
|
|
|
invoke-static {v1, v2, v3, v4}, Lcom/squareup/picasso/Utils;->log(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V |
|
|
|
.line 243 |
|
:cond_0 |
|
:goto_0 |
|
return-object v0 |
|
|
|
.line 197 |
|
:cond_1 |
|
iget-object v2, p0, Lcom/squareup/picasso/BitmapHunter;->data:Lcom/squareup/picasso/Request; |
|
|
|
iget v1, p0, Lcom/squareup/picasso/BitmapHunter;->retryCount:I |
|
|
|
if-nez v1, :cond_8 |
|
|
|
sget-object v1, Lcom/squareup/picasso/NetworkPolicy;->OFFLINE:Lcom/squareup/picasso/NetworkPolicy; |
|
|
|
iget v1, v1, Lcom/squareup/picasso/NetworkPolicy;->index:I |
|
|
|
:goto_1 |
|
iput v1, v2, Lcom/squareup/picasso/Request;->networkPolicy:I |
|
|
|
.line 198 |
|
iget-object v1, p0, Lcom/squareup/picasso/BitmapHunter;->requestHandler:Lcom/squareup/picasso/RequestHandler; |
|
|
|
iget-object v2, p0, Lcom/squareup/picasso/BitmapHunter;->data:Lcom/squareup/picasso/Request; |
|
|
|
iget v3, p0, Lcom/squareup/picasso/BitmapHunter;->networkPolicy:I |
|
|
|
invoke-virtual {v1, v2, v3}, Lcom/squareup/picasso/RequestHandler;->load(Lcom/squareup/picasso/Request;I)Lcom/squareup/picasso/RequestHandler$Result; |
|
|
|
move-result-object v1 |
|
|
|
.line 199 |
|
if-eqz v1, :cond_2 |
|
|
|
.line 200 |
|
invoke-virtual {v1}, Lcom/squareup/picasso/RequestHandler$Result;->getLoadedFrom()Lcom/squareup/picasso/Picasso$LoadedFrom; |
|
|
|
move-result-object v0 |
|
|
|
iput-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->loadedFrom:Lcom/squareup/picasso/Picasso$LoadedFrom; |
|
|
|
.line 201 |
|
invoke-virtual {v1}, Lcom/squareup/picasso/RequestHandler$Result;->getExifOrientation()I |
|
|
|
move-result v0 |
|
|
|
iput v0, p0, Lcom/squareup/picasso/BitmapHunter;->exifRotation:I |
|
|
|
.line 203 |
|
invoke-virtual {v1}, Lcom/squareup/picasso/RequestHandler$Result;->getBitmap()Landroid/graphics/Bitmap; |
|
|
|
move-result-object v0 |
|
|
|
.line 206 |
|
if-nez v0, :cond_2 |
|
|
|
.line 207 |
|
invoke-virtual {v1}, Lcom/squareup/picasso/RequestHandler$Result;->getStream()Ljava/io/InputStream; |
|
|
|
move-result-object v2 |
|
|
|
.line 209 |
|
:try_start_0 |
|
invoke-virtual {v1}, Lcom/squareup/picasso/RequestHandler$Result;->getResponse()Lcom/squareup/picasso/Downloader$Response; |
|
|
|
move-result-object v0 |
|
|
|
.line 210 |
|
iget-object v3, p0, Lcom/squareup/picasso/BitmapHunter;->data:Lcom/squareup/picasso/Request; |
|
|
|
if-eqz v0, :cond_9 |
|
|
|
invoke-virtual {v0}, Lcom/squareup/picasso/Downloader$Response;->getContentLength()J |
|
|
|
move-result-wide v0 |
|
|
|
:goto_2 |
|
invoke-static {v2, v3, v0, v1}, Lcom/squareup/picasso/BitmapHunter;->decodeStream(Ljava/io/InputStream;Lcom/squareup/picasso/Request;J)Landroid/graphics/Bitmap; |
|
:try_end_0 |
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0 |
|
|
|
move-result-object v0 |
|
|
|
.line 212 |
|
invoke-static {v2}, Lcom/squareup/picasso/Utils;->closeQuietly(Ljava/io/InputStream;)V |
|
|
|
.line 217 |
|
:cond_2 |
|
if-eqz v0, :cond_0 |
|
|
|
.line 218 |
|
iget-object v1, p0, Lcom/squareup/picasso/BitmapHunter;->picasso:Lcom/squareup/picasso/Picasso; |
|
|
|
iget-boolean v1, v1, Lcom/squareup/picasso/Picasso;->loggingEnabled:Z |
|
|
|
if-eqz v1, :cond_3 |
|
|
|
.line 219 |
|
const-string v1, "Hunter" |
|
|
|
const-string v2, "decoded" |
|
|
|
iget-object v3, p0, Lcom/squareup/picasso/BitmapHunter;->data:Lcom/squareup/picasso/Request; |
|
|
|
invoke-virtual {v3}, Lcom/squareup/picasso/Request;->logId()Ljava/lang/String; |
|
|
|
move-result-object v3 |
|
|
|
invoke-static {v1, v2, v3}, Lcom/squareup/picasso/Utils;->log(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V |
|
|
|
.line 221 |
|
:cond_3 |
|
iget-object v1, p0, Lcom/squareup/picasso/BitmapHunter;->stats:Lcom/squareup/picasso/Stats; |
|
|
|
invoke-virtual {v1, v0}, Lcom/squareup/picasso/Stats;->dispatchBitmapDecoded(Landroid/graphics/Bitmap;)V |
|
|
|
.line 222 |
|
iget-object v1, p0, Lcom/squareup/picasso/BitmapHunter;->data:Lcom/squareup/picasso/Request; |
|
|
|
invoke-virtual {v1}, Lcom/squareup/picasso/Request;->needsTransformation()Z |
|
|
|
move-result v1 |
|
|
|
if-nez v1, :cond_4 |
|
|
|
iget v1, p0, Lcom/squareup/picasso/BitmapHunter;->exifRotation:I |
|
|
|
if-eqz v1, :cond_0 |
|
|
|
.line 223 |
|
:cond_4 |
|
sget-object v1, Lcom/squareup/picasso/BitmapHunter;->DECODE_LOCK:Ljava/lang/Object; |
|
|
|
monitor-enter v1 |
|
|
|
.line 224 |
|
:try_start_1 |
|
iget-object v2, p0, Lcom/squareup/picasso/BitmapHunter;->data:Lcom/squareup/picasso/Request; |
|
|
|
invoke-virtual {v2}, Lcom/squareup/picasso/Request;->needsMatrixTransform()Z |
|
|
|
move-result v2 |
|
|
|
if-nez v2, :cond_5 |
|
|
|
iget v2, p0, Lcom/squareup/picasso/BitmapHunter;->exifRotation:I |
|
|
|
if-eqz v2, :cond_6 |
|
|
|
.line 225 |
|
:cond_5 |
|
iget-object v2, p0, Lcom/squareup/picasso/BitmapHunter;->data:Lcom/squareup/picasso/Request; |
|
|
|
iget v3, p0, Lcom/squareup/picasso/BitmapHunter;->exifRotation:I |
|
|
|
invoke-static {v2, v0, v3}, Lcom/squareup/picasso/BitmapHunter;->transformResult(Lcom/squareup/picasso/Request;Landroid/graphics/Bitmap;I)Landroid/graphics/Bitmap; |
|
|
|
move-result-object v0 |
|
|
|
.line 226 |
|
iget-object v2, p0, Lcom/squareup/picasso/BitmapHunter;->picasso:Lcom/squareup/picasso/Picasso; |
|
|
|
iget-boolean v2, v2, Lcom/squareup/picasso/Picasso;->loggingEnabled:Z |
|
|
|
if-eqz v2, :cond_6 |
|
|
|
.line 227 |
|
const-string v2, "Hunter" |
|
|
|
const-string v3, "transformed" |
|
|
|
iget-object v4, p0, Lcom/squareup/picasso/BitmapHunter;->data:Lcom/squareup/picasso/Request; |
|
|
|
invoke-virtual {v4}, Lcom/squareup/picasso/Request;->logId()Ljava/lang/String; |
|
|
|
move-result-object v4 |
|
|
|
invoke-static {v2, v3, v4}, Lcom/squareup/picasso/Utils;->log(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V |
|
|
|
.line 230 |
|
:cond_6 |
|
iget-object v2, p0, Lcom/squareup/picasso/BitmapHunter;->data:Lcom/squareup/picasso/Request; |
|
|
|
invoke-virtual {v2}, Lcom/squareup/picasso/Request;->hasCustomTransformations()Z |
|
|
|
move-result v2 |
|
|
|
if-eqz v2, :cond_7 |
|
|
|
.line 231 |
|
iget-object v2, p0, Lcom/squareup/picasso/BitmapHunter;->data:Lcom/squareup/picasso/Request; |
|
|
|
iget-object v2, v2, Lcom/squareup/picasso/Request;->transformations:Ljava/util/List; |
|
|
|
invoke-static {v2, v0}, Lcom/squareup/picasso/BitmapHunter;->applyCustomTransformations(Ljava/util/List;Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap; |
|
|
|
move-result-object v0 |
|
|
|
.line 232 |
|
iget-object v2, p0, Lcom/squareup/picasso/BitmapHunter;->picasso:Lcom/squareup/picasso/Picasso; |
|
|
|
iget-boolean v2, v2, Lcom/squareup/picasso/Picasso;->loggingEnabled:Z |
|
|
|
if-eqz v2, :cond_7 |
|
|
|
.line 233 |
|
const-string v2, "Hunter" |
|
|
|
const-string v3, "transformed" |
|
|
|
iget-object v4, p0, Lcom/squareup/picasso/BitmapHunter;->data:Lcom/squareup/picasso/Request; |
|
|
|
invoke-virtual {v4}, Lcom/squareup/picasso/Request;->logId()Ljava/lang/String; |
|
|
|
move-result-object v4 |
|
|
|
const-string v5, "from custom transformations" |
|
|
|
invoke-static {v2, v3, v4, v5}, Lcom/squareup/picasso/Utils;->log(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V |
|
|
|
.line 236 |
|
:cond_7 |
|
monitor-exit v1 |
|
:try_end_1 |
|
.catchall {:try_start_1 .. :try_end_1} :catchall_1 |
|
|
|
.line 237 |
|
if-eqz v0, :cond_0 |
|
|
|
.line 238 |
|
iget-object v1, p0, Lcom/squareup/picasso/BitmapHunter;->stats:Lcom/squareup/picasso/Stats; |
|
|
|
invoke-virtual {v1, v0}, Lcom/squareup/picasso/Stats;->dispatchBitmapTransformed(Landroid/graphics/Bitmap;)V |
|
|
|
goto/16 :goto_0 |
|
|
|
.line 197 |
|
:cond_8 |
|
iget v1, p0, Lcom/squareup/picasso/BitmapHunter;->networkPolicy:I |
|
|
|
goto/16 :goto_1 |
|
|
|
.line 210 |
|
:cond_9 |
|
const-wide/16 v0, -0x1 |
|
|
|
goto/16 :goto_2 |
|
|
|
.line 212 |
|
:catchall_0 |
|
move-exception v0 |
|
|
|
invoke-static {v2}, Lcom/squareup/picasso/Utils;->closeQuietly(Ljava/io/InputStream;)V |
|
|
|
throw v0 |
|
|
|
.line 236 |
|
:catchall_1 |
|
move-exception v0 |
|
|
|
:try_start_2 |
|
monitor-exit v1 |
|
:try_end_2 |
|
.catchall {:try_start_2 .. :try_end_2} :catchall_1 |
|
|
|
throw v0 |
|
.end method |
|
|
|
.method isCancelled()Z |
|
.locals 1 |
|
|
|
.prologue |
|
.line 334 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->future:Ljava/util/concurrent/Future; |
|
|
|
if-eqz v0, :cond_0 |
|
|
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->future:Ljava/util/concurrent/Future; |
|
|
|
invoke-interface {v0}, Ljava/util/concurrent/Future;->isCancelled()Z |
|
|
|
move-result v0 |
|
|
|
if-eqz v0, :cond_0 |
|
|
|
const/4 v0, 0x1 |
|
|
|
:goto_0 |
|
return v0 |
|
|
|
:cond_0 |
|
const/4 v0, 0x0 |
|
|
|
goto :goto_0 |
|
.end method |
|
|
|
.method public run()V |
|
.locals 4 |
|
|
|
.prologue |
|
.line 145 |
|
:try_start_0 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->data:Lcom/squareup/picasso/Request; |
|
|
|
invoke-static {v0}, Lcom/squareup/picasso/BitmapHunter;->updateThreadName(Lcom/squareup/picasso/Request;)V |
|
|
|
.line 147 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->picasso:Lcom/squareup/picasso/Picasso; |
|
|
|
iget-boolean v0, v0, Lcom/squareup/picasso/Picasso;->loggingEnabled:Z |
|
|
|
if-eqz v0, :cond_0 |
|
|
|
.line 148 |
|
const-string v0, "Hunter" |
|
|
|
const-string v1, "executing" |
|
|
|
invoke-static {p0}, Lcom/squareup/picasso/Utils;->getLogIdsForHunter(Lcom/squareup/picasso/BitmapHunter;)Ljava/lang/String; |
|
|
|
move-result-object v2 |
|
|
|
invoke-static {v0, v1, v2}, Lcom/squareup/picasso/Utils;->log(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V |
|
|
|
.line 151 |
|
:cond_0 |
|
invoke-virtual {p0}, Lcom/squareup/picasso/BitmapHunter;->hunt()Landroid/graphics/Bitmap; |
|
|
|
move-result-object v0 |
|
|
|
iput-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->result:Landroid/graphics/Bitmap; |
|
|
|
.line 153 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->result:Landroid/graphics/Bitmap; |
|
|
|
if-nez v0, :cond_1 |
|
|
|
.line 154 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->dispatcher:Lcom/squareup/picasso/Dispatcher; |
|
|
|
invoke-virtual {v0, p0}, Lcom/squareup/picasso/Dispatcher;->dispatchFailed(Lcom/squareup/picasso/BitmapHunter;)V |
|
:try_end_0 |
|
.catch Lcom/squareup/picasso/Downloader$ResponseException; {:try_start_0 .. :try_end_0} :catch_0 |
|
.catch Lcom/squareup/picasso/NetworkRequestHandler$ContentLengthException; {:try_start_0 .. :try_end_0} :catch_1 |
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_2 |
|
.catch Ljava/lang/OutOfMemoryError; {:try_start_0 .. :try_end_0} :catch_3 |
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_4 |
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0 |
|
|
|
.line 178 |
|
:goto_0 |
|
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread; |
|
|
|
move-result-object v0 |
|
|
|
const-string v1, "Picasso-Idle" |
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/Thread;->setName(Ljava/lang/String;)V |
|
|
|
.line 180 |
|
:goto_1 |
|
return-void |
|
|
|
.line 156 |
|
:cond_1 |
|
:try_start_1 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->dispatcher:Lcom/squareup/picasso/Dispatcher; |
|
|
|
invoke-virtual {v0, p0}, Lcom/squareup/picasso/Dispatcher;->dispatchComplete(Lcom/squareup/picasso/BitmapHunter;)V |
|
:try_end_1 |
|
.catch Lcom/squareup/picasso/Downloader$ResponseException; {:try_start_1 .. :try_end_1} :catch_0 |
|
.catch Lcom/squareup/picasso/NetworkRequestHandler$ContentLengthException; {:try_start_1 .. :try_end_1} :catch_1 |
|
.catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_2 |
|
.catch Ljava/lang/OutOfMemoryError; {:try_start_1 .. :try_end_1} :catch_3 |
|
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_4 |
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0 |
|
|
|
goto :goto_0 |
|
|
|
.line 158 |
|
:catch_0 |
|
move-exception v0 |
|
|
|
.line 159 |
|
:try_start_2 |
|
iget-boolean v1, v0, Lcom/squareup/picasso/Downloader$ResponseException;->localCacheOnly:Z |
|
|
|
if-eqz v1, :cond_2 |
|
|
|
iget v1, v0, Lcom/squareup/picasso/Downloader$ResponseException;->responseCode:I |
|
|
|
const/16 v2, 0x1f8 |
|
|
|
if-eq v1, v2, :cond_3 |
|
|
|
.line 160 |
|
:cond_2 |
|
iput-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->exception:Ljava/lang/Exception; |
|
|
|
.line 162 |
|
:cond_3 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->dispatcher:Lcom/squareup/picasso/Dispatcher; |
|
|
|
invoke-virtual {v0, p0}, Lcom/squareup/picasso/Dispatcher;->dispatchFailed(Lcom/squareup/picasso/BitmapHunter;)V |
|
:try_end_2 |
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0 |
|
|
|
.line 178 |
|
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread; |
|
|
|
move-result-object v0 |
|
|
|
const-string v1, "Picasso-Idle" |
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/Thread;->setName(Ljava/lang/String;)V |
|
|
|
goto :goto_1 |
|
|
|
.line 163 |
|
:catch_1 |
|
move-exception v0 |
|
|
|
.line 164 |
|
:try_start_3 |
|
iput-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->exception:Ljava/lang/Exception; |
|
|
|
.line 165 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->dispatcher:Lcom/squareup/picasso/Dispatcher; |
|
|
|
invoke-virtual {v0, p0}, Lcom/squareup/picasso/Dispatcher;->dispatchRetry(Lcom/squareup/picasso/BitmapHunter;)V |
|
:try_end_3 |
|
.catchall {:try_start_3 .. :try_end_3} :catchall_0 |
|
|
|
.line 178 |
|
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread; |
|
|
|
move-result-object v0 |
|
|
|
const-string v1, "Picasso-Idle" |
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/Thread;->setName(Ljava/lang/String;)V |
|
|
|
goto :goto_1 |
|
|
|
.line 166 |
|
:catch_2 |
|
move-exception v0 |
|
|
|
.line 167 |
|
:try_start_4 |
|
iput-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->exception:Ljava/lang/Exception; |
|
|
|
.line 168 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->dispatcher:Lcom/squareup/picasso/Dispatcher; |
|
|
|
invoke-virtual {v0, p0}, Lcom/squareup/picasso/Dispatcher;->dispatchRetry(Lcom/squareup/picasso/BitmapHunter;)V |
|
:try_end_4 |
|
.catchall {:try_start_4 .. :try_end_4} :catchall_0 |
|
|
|
.line 178 |
|
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread; |
|
|
|
move-result-object v0 |
|
|
|
const-string v1, "Picasso-Idle" |
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/Thread;->setName(Ljava/lang/String;)V |
|
|
|
goto :goto_1 |
|
|
|
.line 169 |
|
:catch_3 |
|
move-exception v0 |
|
|
|
.line 170 |
|
:try_start_5 |
|
new-instance v1, Ljava/io/StringWriter; |
|
|
|
invoke-direct {v1}, Ljava/io/StringWriter;-><init>()V |
|
|
|
.line 171 |
|
iget-object v2, p0, Lcom/squareup/picasso/BitmapHunter;->stats:Lcom/squareup/picasso/Stats; |
|
|
|
invoke-virtual {v2}, Lcom/squareup/picasso/Stats;->createSnapshot()Lcom/squareup/picasso/StatsSnapshot; |
|
|
|
move-result-object v2 |
|
|
|
new-instance v3, Ljava/io/PrintWriter; |
|
|
|
invoke-direct {v3, v1}, Ljava/io/PrintWriter;-><init>(Ljava/io/Writer;)V |
|
|
|
invoke-virtual {v2, v3}, Lcom/squareup/picasso/StatsSnapshot;->dump(Ljava/io/PrintWriter;)V |
|
|
|
.line 172 |
|
new-instance v2, Ljava/lang/RuntimeException; |
|
|
|
invoke-virtual {v1}, Ljava/io/StringWriter;->toString()Ljava/lang/String; |
|
|
|
move-result-object v1 |
|
|
|
invoke-direct {v2, v1, v0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V |
|
|
|
iput-object v2, p0, Lcom/squareup/picasso/BitmapHunter;->exception:Ljava/lang/Exception; |
|
|
|
.line 173 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->dispatcher:Lcom/squareup/picasso/Dispatcher; |
|
|
|
invoke-virtual {v0, p0}, Lcom/squareup/picasso/Dispatcher;->dispatchFailed(Lcom/squareup/picasso/BitmapHunter;)V |
|
:try_end_5 |
|
.catchall {:try_start_5 .. :try_end_5} :catchall_0 |
|
|
|
.line 178 |
|
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread; |
|
|
|
move-result-object v0 |
|
|
|
const-string v1, "Picasso-Idle" |
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/Thread;->setName(Ljava/lang/String;)V |
|
|
|
goto :goto_1 |
|
|
|
.line 174 |
|
:catch_4 |
|
move-exception v0 |
|
|
|
.line 175 |
|
:try_start_6 |
|
iput-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->exception:Ljava/lang/Exception; |
|
|
|
.line 176 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->dispatcher:Lcom/squareup/picasso/Dispatcher; |
|
|
|
invoke-virtual {v0, p0}, Lcom/squareup/picasso/Dispatcher;->dispatchFailed(Lcom/squareup/picasso/BitmapHunter;)V |
|
:try_end_6 |
|
.catchall {:try_start_6 .. :try_end_6} :catchall_0 |
|
|
|
.line 178 |
|
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread; |
|
|
|
move-result-object v0 |
|
|
|
const-string v1, "Picasso-Idle" |
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/Thread;->setName(Ljava/lang/String;)V |
|
|
|
goto/16 :goto_1 |
|
|
|
:catchall_0 |
|
move-exception v0 |
|
|
|
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread; |
|
|
|
move-result-object v1 |
|
|
|
const-string v2, "Picasso-Idle" |
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/Thread;->setName(Ljava/lang/String;)V |
|
|
|
throw v0 |
|
.end method |
|
|
|
.method shouldRetry(ZLandroid/net/NetworkInfo;)Z |
|
.locals 2 |
|
|
|
.prologue |
|
const/4 v0, 0x0 |
|
|
|
.line 338 |
|
iget v1, p0, Lcom/squareup/picasso/BitmapHunter;->retryCount:I |
|
|
|
if-lez v1, :cond_0 |
|
|
|
const/4 v1, 0x1 |
|
|
|
.line 339 |
|
:goto_0 |
|
if-nez v1, :cond_1 |
|
|
|
.line 343 |
|
:goto_1 |
|
return v0 |
|
|
|
:cond_0 |
|
move v1, v0 |
|
|
|
.line 338 |
|
goto :goto_0 |
|
|
|
.line 342 |
|
:cond_1 |
|
iget v0, p0, Lcom/squareup/picasso/BitmapHunter;->retryCount:I |
|
|
|
add-int/lit8 v0, v0, -0x1 |
|
|
|
iput v0, p0, Lcom/squareup/picasso/BitmapHunter;->retryCount:I |
|
|
|
.line 343 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->requestHandler:Lcom/squareup/picasso/RequestHandler; |
|
|
|
invoke-virtual {v0, p1, p2}, Lcom/squareup/picasso/RequestHandler;->shouldRetry(ZLandroid/net/NetworkInfo;)Z |
|
|
|
move-result v0 |
|
|
|
goto :goto_1 |
|
.end method |
|
|
|
.method supportsReplay()Z |
|
.locals 1 |
|
|
|
.prologue |
|
.line 347 |
|
iget-object v0, p0, Lcom/squareup/picasso/BitmapHunter;->requestHandler:Lcom/squareup/picasso/RequestHandler; |
|
|
|
invoke-virtual {v0}, Lcom/squareup/picasso/RequestHandler;->supportsReplay()Z |
|
|
|
move-result v0 |
|
|
|
return v0 |
|
.end method
|
|
|