StandardGifDecoder.smali
.class public Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Lcom/bumptech/glide/gifdecoder/GifDecoder;
# static fields
.field private static final BYTES_PER_INTEGER:I = 0x4
.field private static final COLOR_TRANSPARENT_BLACK:I = 0x0
.field private static final INITIAL_FRAME_POINTER:I = -0x1
.field private static final MASK_INT_LOWEST_BYTE:I = 0xff
.field private static final MAX_STACK_SIZE:I = 0x1000
.field private static final NULL_CODE:I = -0x1
.field private static final TAG:Ljava/lang/String; = "StandardGifDecoder"
# instance fields
.field private act:[I
.field private bitmapConfig:Landroid/graphics/Bitmap$Config;
.field private final bitmapProvider:Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;
.field private block:[B
.field private downsampledHeight:I
.field private downsampledWidth:I
.field private framePointer:I
.field private header:Lcom/bumptech/glide/gifdecoder/GifHeader;
.field private isFirstFrameTransparent:Ljava/lang/Boolean;
.field private mainPixels:[B
.field private mainScratch:[I
.field private parser:Lcom/bumptech/glide/gifdecoder/GifHeaderParser;
.field private final pct:[I
.field private pixelStack:[B
.field private prefix:[S
.field private previousImage:Landroid/graphics/Bitmap;
.field private rawData:Ljava/nio/ByteBuffer;
.field private sampleSize:I
.field private savePrevious:Z
.field private status:I
.field private suffix:[B
# direct methods
.method public constructor <init>(Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;)V
.registers 3
.line 4
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
const/16 v0, 0x100
new-array v0, v0, [I
.line 5
iput-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->pct:[I
.line 6
sget-object v0, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;
iput-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->bitmapConfig:Landroid/graphics/Bitmap$Config;
.line 7
iput-object p1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->bitmapProvider:Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;
.line 8
new-instance p1, Lcom/bumptech/glide/gifdecoder/GifHeader;
invoke-direct {p1}, Lcom/bumptech/glide/gifdecoder/GifHeader;-><init>()V
iput-object p1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->header:Lcom/bumptech/glide/gifdecoder/GifHeader;
return-void
.end method
.method public constructor <init>(Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;Lcom/bumptech/glide/gifdecoder/GifHeader;Ljava/nio/ByteBuffer;)V
.registers 5
const/4 v0, 0x1
.line 1
invoke-direct {p0, p1, p2, p3, v0}, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;-><init>(Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;Lcom/bumptech/glide/gifdecoder/GifHeader;Ljava/nio/ByteBuffer;I)V
return-void
.end method
.method public constructor <init>(Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;Lcom/bumptech/glide/gifdecoder/GifHeader;Ljava/nio/ByteBuffer;I)V
.registers 5
.line 2
invoke-direct {p0, p1}, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;-><init>(Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;)V
.line 3
invoke-virtual {p0, p2, p3, p4}, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->setData(Lcom/bumptech/glide/gifdecoder/GifHeader;Ljava/nio/ByteBuffer;I)V
return-void
.end method
.method private averageColorsNear(III)I
.registers 13
const/4 v0, 0x0
move v1, p1
const/4 v2, 0x0
const/4 v3, 0x0
const/4 v4, 0x0
const/4 v5, 0x0
const/4 v6, 0x0
.line 1
:goto_7
iget v7, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->sampleSize:I
add-int/2addr v7, p1
if-ge v1, v7, :cond_34
iget-object v7, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->mainPixels:[B
array-length v8, v7
if-ge v1, v8, :cond_34
if-ge v1, p2, :cond_34
.line 2
aget-byte v7, v7, v1
and-int/lit16 v7, v7, 0xff
.line 3
iget-object v8, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->act:[I
aget v7, v8, v7
if-eqz v7, :cond_31
shr-int/lit8 v8, v7, 0x18
and-int/lit16 v8, v8, 0xff
add-int/2addr v2, v8
shr-int/lit8 v8, v7, 0x10
and-int/lit16 v8, v8, 0xff
add-int/2addr v3, v8
shr-int/lit8 v8, v7, 0x8
and-int/lit16 v8, v8, 0xff
add-int/2addr v4, v8
and-int/lit16 v7, v7, 0xff
add-int/2addr v5, v7
add-int/lit8 v6, v6, 0x1
:cond_31
add-int/lit8 v1, v1, 0x1
goto :goto_7
:cond_34
add-int/2addr p1, p3
move p3, p1
.line 4
:goto_36
iget v1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->sampleSize:I
add-int/2addr v1, p1
if-ge p3, v1, :cond_63
iget-object v1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->mainPixels:[B
array-length v7, v1
if-ge p3, v7, :cond_63
if-ge p3, p2, :cond_63
.line 5
aget-byte v1, v1, p3
and-int/lit16 v1, v1, 0xff
.line 6
iget-object v7, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->act:[I
aget v1, v7, v1
if-eqz v1, :cond_60
shr-int/lit8 v7, v1, 0x18
and-int/lit16 v7, v7, 0xff
add-int/2addr v2, v7
shr-int/lit8 v7, v1, 0x10
and-int/lit16 v7, v7, 0xff
add-int/2addr v3, v7
shr-int/lit8 v7, v1, 0x8
and-int/lit16 v7, v7, 0xff
add-int/2addr v4, v7
and-int/lit16 v1, v1, 0xff
add-int/2addr v5, v1
add-int/lit8 v6, v6, 0x1
:cond_60
add-int/lit8 p3, p3, 0x1
goto :goto_36
:cond_63
if-nez v6, :cond_66
return v0
.line 7
:cond_66
div-int/2addr v2, v6
shl-int/lit8 p1, v2, 0x18
div-int/2addr v3, v6
shl-int/lit8 p2, v3, 0x10
or-int/2addr p1, p2
div-int/2addr v4, v6
shl-int/lit8 p2, v4, 0x8
or-int/2addr p1, p2
div-int/2addr v5, v6
or-int/2addr p1, v5
return p1
.end method
.method private copyCopyIntoScratchRobust(Lcom/bumptech/glide/gifdecoder/GifFrame;)V
.registers 26
move-object/from16 v0, p0
move-object/from16 v1, p1
.line 1
iget-object v2, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->mainScratch:[I
.line 2
iget v3, v1, Lcom/bumptech/glide/gifdecoder/GifFrame;->ih:I
iget v4, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->sampleSize:I
div-int/2addr v3, v4
.line 3
iget v5, v1, Lcom/bumptech/glide/gifdecoder/GifFrame;->iy:I
div-int/2addr v5, v4
.line 4
iget v6, v1, Lcom/bumptech/glide/gifdecoder/GifFrame;->iw:I
div-int/2addr v6, v4
.line 5
iget v7, v1, Lcom/bumptech/glide/gifdecoder/GifFrame;->ix:I
div-int/2addr v7, v4
.line 6
iget v8, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->framePointer:I
if-nez v8, :cond_1a
const/4 v8, 0x1
goto :goto_1b
:cond_1a
const/4 v8, 0x0
.line 7
:goto_1b
iget v9, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->downsampledWidth:I
.line 8
iget v10, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->downsampledHeight:I
.line 9
iget-object v11, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->mainPixels:[B
.line 10
iget-object v12, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->act:[I
.line 11
iget-object v13, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->isFirstFrameTransparent:Ljava/lang/Boolean;
const/16 v14, 0x8
const/4 v15, 0x0
const/16 v16, 0x0
const/16 v17, 0x1
const/4 v14, 0x0
const/16 v16, 0x8
:goto_2f
if-ge v15, v3, :cond_db
move-object/from16 v18, v13
.line 12
iget-boolean v13, v1, Lcom/bumptech/glide/gifdecoder/GifFrame;->interlace:Z
if-eqz v13, :cond_5e
const/4 v13, 0x2
if-lt v14, v3, :cond_59
move/from16 v19, v3
add-int/lit8 v3, v17, 0x1
if-eq v3, v13, :cond_55
const/4 v13, 0x3
if-eq v3, v13, :cond_4e
const/4 v13, 0x4
if-eq v3, v13, :cond_47
goto :goto_56
:cond_47
const/4 v14, 0x1
const/4 v13, 0x2
move/from16 v17, v3
const/16 v16, 0x2
goto :goto_5b
:cond_4e
const/4 v14, 0x2
const/4 v13, 0x4
move/from16 v17, v3
const/16 v16, 0x4
goto :goto_5b
:cond_55
const/4 v14, 0x4
:goto_56
move/from16 v17, v3
goto :goto_5b
:cond_59
move/from16 v19, v3
:goto_5b
add-int v3, v14, v16
goto :goto_62
:cond_5e
move/from16 v19, v3
move v3, v14
move v14, v15
:goto_62
add-int/2addr v14, v5
const/4 v13, 0x1
if-ne v4, v13, :cond_68
const/4 v13, 0x1
goto :goto_69
:cond_68
const/4 v13, 0x0
:goto_69
if-ge v14, v10, :cond_c7
mul-int v14, v14, v9
add-int v20, v14, v7
move/from16 v21, v3
add-int v3, v20, v6
add-int/2addr v14, v9
if-ge v14, v3, :cond_77
move v3, v14
:cond_77
mul-int v14, v15, v4
move/from16 v22, v5
.line 13
iget v5, v1, Lcom/bumptech/glide/gifdecoder/GifFrame;->iw:I
mul-int v14, v14, v5
if-eqz v13, :cond_a0
move-object/from16 v13, v18
move/from16 v5, v20
:goto_85
move/from16 v23, v6
if-ge v5, v3, :cond_cf
.line 14
aget-byte v6, v11, v14
and-int/lit16 v6, v6, 0xff
.line 15
aget v6, v12, v6
if-eqz v6, :cond_94
.line 16
aput v6, v2, v5
goto :goto_9a
:cond_94
if-eqz v8, :cond_9a
if-nez v13, :cond_9a
.line 17
sget-object v13, Ljava/lang/Boolean;->TRUE:Ljava/lang/Boolean;
:cond_9a
:goto_9a
add-int/2addr v14, v4
add-int/lit8 v5, v5, 0x1
move/from16 v6, v23
goto :goto_85
:cond_a0
move/from16 v23, v6
sub-int v5, v3, v20
mul-int v5, v5, v4
add-int/2addr v5, v14
move-object/from16 v13, v18
move/from16 v6, v20
:goto_ab
if-ge v6, v3, :cond_cf
move/from16 v20, v3
.line 18
iget v3, v1, Lcom/bumptech/glide/gifdecoder/GifFrame;->iw:I
invoke-direct {v0, v14, v5, v3}, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->averageColorsNear(III)I
move-result v3
if-eqz v3, :cond_ba
.line 19
aput v3, v2, v6
goto :goto_c1
:cond_ba
if-eqz v8, :cond_c1
if-nez v13, :cond_c1
.line 20
sget-object v3, Ljava/lang/Boolean;->TRUE:Ljava/lang/Boolean;
move-object v13, v3
:cond_c1
:goto_c1
add-int/2addr v14, v4
add-int/lit8 v6, v6, 0x1
move/from16 v3, v20
goto :goto_ab
:cond_c7
move/from16 v21, v3
move/from16 v22, v5
move/from16 v23, v6
move-object/from16 v13, v18
:cond_cf
add-int/lit8 v15, v15, 0x1
move/from16 v3, v19
move/from16 v14, v21
move/from16 v5, v22
move/from16 v6, v23
goto/16 :goto_2f
:cond_db
move-object/from16 v18, v13
.line 21
iget-object v1, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->isFirstFrameTransparent:Ljava/lang/Boolean;
if-nez v1, :cond_ef
if-nez v18, :cond_e5
const/4 v1, 0x0
goto :goto_e9
.line 22
:cond_e5
invoke-virtual/range {v18 .. v18}, Ljava/lang/Boolean;->booleanValue()Z
move-result v1
.line 23
:goto_e9
invoke-static {v1}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v1
iput-object v1, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->isFirstFrameTransparent:Ljava/lang/Boolean;
:cond_ef
return-void
.end method
.method private copyIntoScratchFast(Lcom/bumptech/glide/gifdecoder/GifFrame;)V
.registers 20
move-object/from16 v0, p0
move-object/from16 v1, p1
.line 1
iget-object v2, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->mainScratch:[I
.line 2
iget v3, v1, Lcom/bumptech/glide/gifdecoder/GifFrame;->ih:I
.line 3
iget v4, v1, Lcom/bumptech/glide/gifdecoder/GifFrame;->iy:I
.line 4
iget v5, v1, Lcom/bumptech/glide/gifdecoder/GifFrame;->iw:I
.line 5
iget v6, v1, Lcom/bumptech/glide/gifdecoder/GifFrame;->ix:I
.line 6
iget v7, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->framePointer:I
if-nez v7, :cond_14
const/4 v7, 0x1
goto :goto_15
:cond_14
const/4 v7, 0x0
.line 7
:goto_15
iget v10, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->downsampledWidth:I
.line 8
iget-object v11, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->mainPixels:[B
.line 9
iget-object v12, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->act:[I
const/4 v14, 0x0
const/4 v15, -0x1
:goto_1d
if-ge v14, v3, :cond_54
add-int v16, v14, v4
mul-int v16, v16, v10
add-int v17, v16, v6
add-int v8, v17, v5
add-int v9, v16, v10
if-ge v9, v8, :cond_2c
move v8, v9
.line 10
:cond_2c
iget v9, v1, Lcom/bumptech/glide/gifdecoder/GifFrame;->iw:I
mul-int v9, v9, v14
move/from16 v13, v17
:goto_32
if-ge v13, v8, :cond_4d
.line 11
aget-byte v1, v11, v9
move/from16 v17, v3
and-int/lit16 v3, v1, 0xff
if-eq v3, v15, :cond_44
.line 12
aget v3, v12, v3
if-eqz v3, :cond_43
.line 13
aput v3, v2, v13
goto :goto_44
:cond_43
move v15, v1
:cond_44
:goto_44
add-int/lit8 v9, v9, 0x1
add-int/lit8 v13, v13, 0x1
move-object/from16 v1, p1
move/from16 v3, v17
goto :goto_32
:cond_4d
move/from16 v17, v3
add-int/lit8 v14, v14, 0x1
move-object/from16 v1, p1
goto :goto_1d
.line 14
:cond_54
iget-object v1, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->isFirstFrameTransparent:Ljava/lang/Boolean;
if-eqz v1, :cond_5e
.line 15
invoke-virtual {v1}, Ljava/lang/Boolean;->booleanValue()Z
move-result v1
if-nez v1, :cond_67
:cond_5e
iget-object v1, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->isFirstFrameTransparent:Ljava/lang/Boolean;
if-nez v1, :cond_69
if-eqz v7, :cond_69
const/4 v1, -0x1
if-eq v15, v1, :cond_69
:cond_67
const/4 v8, 0x1
goto :goto_6a
:cond_69
const/4 v8, 0x0
:goto_6a
invoke-static {v8}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v1
iput-object v1, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->isFirstFrameTransparent:Ljava/lang/Boolean;
return-void
.end method
.method private decodeBitmapData(Lcom/bumptech/glide/gifdecoder/GifFrame;)V
.registers 30
move-object/from16 v0, p0
move-object/from16 v1, p1
if-eqz v1, :cond_d
.line 1
iget-object v2, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->rawData:Ljava/nio/ByteBuffer;
iget v3, v1, Lcom/bumptech/glide/gifdecoder/GifFrame;->bufferFrameStart:I
invoke-virtual {v2, v3}, Ljava/nio/ByteBuffer;->position(I)Ljava/nio/Buffer;
:cond_d
if-nez v1, :cond_16
.line 2
iget-object v1, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->header:Lcom/bumptech/glide/gifdecoder/GifHeader;
iget v2, v1, Lcom/bumptech/glide/gifdecoder/GifHeader;->width:I
iget v1, v1, Lcom/bumptech/glide/gifdecoder/GifHeader;->height:I
goto :goto_1a
:cond_16
iget v2, v1, Lcom/bumptech/glide/gifdecoder/GifFrame;->iw:I
iget v1, v1, Lcom/bumptech/glide/gifdecoder/GifFrame;->ih:I
:goto_1a
mul-int v2, v2, v1
.line 3
iget-object v1, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->mainPixels:[B
if-eqz v1, :cond_23
array-length v1, v1
if-ge v1, v2, :cond_2b
.line 4
:cond_23
iget-object v1, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->bitmapProvider:Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;
invoke-interface {v1, v2}, Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;->obtainByteArray(I)[B
move-result-object v1
iput-object v1, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->mainPixels:[B
.line 5
:cond_2b
iget-object v1, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->mainPixels:[B
.line 6
iget-object v3, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->prefix:[S
const/16 v4, 0x1000
if-nez v3, :cond_37
new-array v3, v4, [S
.line 7
iput-object v3, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->prefix:[S
.line 8
:cond_37
iget-object v3, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->prefix:[S
.line 9
iget-object v5, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->suffix:[B
if-nez v5, :cond_41
new-array v5, v4, [B
.line 10
iput-object v5, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->suffix:[B
.line 11
:cond_41
iget-object v5, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->suffix:[B
.line 12
iget-object v6, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->pixelStack:[B
if-nez v6, :cond_4d
const/16 v6, 0x1001
new-array v6, v6, [B
.line 13
iput-object v6, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->pixelStack:[B
.line 14
:cond_4d
iget-object v6, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->pixelStack:[B
.line 15
invoke-direct/range {p0 .. p0}, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->readByte()I
move-result v7
const/4 v8, 0x1
shl-int v9, v8, v7
add-int/lit8 v10, v9, 0x1
add-int/lit8 v11, v9, 0x2
add-int/2addr v7, v8
shl-int v12, v8, v7
sub-int/2addr v12, v8
const/4 v13, 0x0
const/4 v14, 0x0
:goto_60
if-ge v14, v9, :cond_6a
.line 16
aput-short v13, v3, v14
int-to-byte v15, v14
.line 17
aput-byte v15, v5, v14
add-int/lit8 v14, v14, 0x1
goto :goto_60
.line 18
:cond_6a
iget-object v14, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->block:[B
const/4 v15, -0x1
move/from16 v23, v7
move/from16 v21, v11
move/from16 v24, v12
const/16 v16, 0x0
const/16 v17, 0x0
const/16 v18, 0x0
const/16 v19, 0x0
const/16 v20, 0x0
const/16 v22, -0x1
const/16 v25, 0x0
const/16 v26, 0x0
:goto_83
if-ge v13, v2, :cond_14b
if-nez v16, :cond_94
.line 19
invoke-direct/range {p0 .. p0}, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->readBlock()I
move-result v16
if-gtz v16, :cond_92
const/4 v3, 0x3
.line 20
iput v3, v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->status:I
goto/16 :goto_14b
:cond_92
const/16 v17, 0x0
.line 21
:cond_94
aget-byte v4, v14, v17
and-int/lit16 v4, v4, 0xff
shl-int v4, v4, v18
add-int v19, v19, v4
add-int/lit8 v18, v18, 0x8
add-int/lit8 v17, v17, 0x1
add-int/lit8 v16, v16, -0x1
move/from16 v4, v18
move/from16 v8, v21
move/from16 v0, v22
move/from16 v15, v23
move/from16 v22, v7
move/from16 v7, v26
:goto_ae
if-lt v4, v15, :cond_135
move/from16 v23, v11
and-int v11, v19, v24
shr-int v19, v19, v15
sub-int/2addr v4, v15
if-ne v11, v9, :cond_c2
move/from16 v24, v12
move/from16 v15, v22
move/from16 v8, v23
move v11, v8
const/4 v0, -0x1
goto :goto_ae
:cond_c2
if-ne v11, v10, :cond_d8
move/from16 v18, v4
move/from16 v26, v7
move/from16 v21, v8
move/from16 v7, v22
move/from16 v11, v23
const/16 v4, 0x1000
const/4 v8, 0x1
move/from16 v22, v0
move/from16 v23, v15
const/4 v15, -0x1
goto/16 :goto_147
:cond_d8
move/from16 v26, v4
const/4 v4, -0x1
if-ne v0, v4, :cond_ec
.line 22
aget-byte v0, v5, v11
aput-byte v0, v1, v20
add-int/lit8 v20, v20, 0x1
add-int/lit8 v13, v13, 0x1
move v0, v11
move v7, v0
move/from16 v11, v23
move/from16 v4, v26
goto :goto_ae
:cond_ec
if-lt v11, v8, :cond_f5
int-to-byte v7, v7
.line 23
aput-byte v7, v6, v25
add-int/lit8 v25, v25, 0x1
move v7, v0
goto :goto_f6
:cond_f5
move v7, v11
:goto_f6
if-lt v7, v9, :cond_101
.line 24
aget-byte v21, v5, v7
aput-byte v21, v6, v25
add-int/lit8 v25, v25, 0x1
.line 25
aget-short v7, v3, v7
goto :goto_f6
.line 26
:cond_101
aget-byte v7, v5, v7
and-int/lit16 v7, v7, 0xff
int-to-byte v4, v7
.line 27
aput-byte v4, v1, v20
:goto_108
add-int/lit8 v20, v20, 0x1
add-int/lit8 v13, v13, 0x1
if-lez v25, :cond_115
add-int/lit8 v25, v25, -0x1
.line 28
aget-byte v27, v6, v25
aput-byte v27, v1, v20
goto :goto_108
:cond_115
move-object/from16 v27, v6
const/16 v6, 0x1000
if-ge v8, v6, :cond_12c
int-to-short v0, v0
.line 29
aput-short v0, v3, v8
.line 30
aput-byte v4, v5, v8
add-int/lit8 v8, v8, 0x1
and-int v0, v8, v24
if-nez v0, :cond_12c
if-ge v8, v6, :cond_12c
add-int/lit8 v15, v15, 0x1
add-int v24, v24, v8
:cond_12c
move v0, v11
move/from16 v11, v23
move/from16 v4, v26
move-object/from16 v6, v27
goto/16 :goto_ae
:cond_135
move/from16 v26, v4
move/from16 v21, v8
move/from16 v23, v15
move/from16 v18, v26
const/16 v4, 0x1000
const/4 v8, 0x1
const/4 v15, -0x1
move/from16 v26, v7
move/from16 v7, v22
move/from16 v22, v0
:goto_147
move-object/from16 v0, p0
goto/16 :goto_83
:cond_14b
:goto_14b
move/from16 v13, v20
const/4 v0, 0x0
.line 31
invoke-static {v1, v13, v2, v0}, Ljava/util/Arrays;->fill([BIIB)V
return-void
.end method
.method private getHeaderParser()Lcom/bumptech/glide/gifdecoder/GifHeaderParser;
.registers 2
.line 1
iget-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->parser:Lcom/bumptech/glide/gifdecoder/GifHeaderParser;
if-nez v0, :cond_b
.line 2
new-instance v0, Lcom/bumptech/glide/gifdecoder/GifHeaderParser;
invoke-direct {v0}, Lcom/bumptech/glide/gifdecoder/GifHeaderParser;-><init>()V
iput-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->parser:Lcom/bumptech/glide/gifdecoder/GifHeaderParser;
.line 3
:cond_b
iget-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->parser:Lcom/bumptech/glide/gifdecoder/GifHeaderParser;
return-object v0
.end method
.method private getNextBitmap()Landroid/graphics/Bitmap;
.registers 5
.line 1
iget-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->isFirstFrameTransparent:Ljava/lang/Boolean;
if-eqz v0, :cond_e
invoke-virtual {v0}, Ljava/lang/Boolean;->booleanValue()Z
move-result v0
if-eqz v0, :cond_b
goto :goto_e
:cond_b
iget-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->bitmapConfig:Landroid/graphics/Bitmap$Config;
goto :goto_10
:cond_e
:goto_e
sget-object v0, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;
.line 2
:goto_10
iget-object v1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->bitmapProvider:Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;
iget v2, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->downsampledWidth:I
iget v3, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->downsampledHeight:I
invoke-interface {v1, v2, v3, v0}, Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;->obtain(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;
move-result-object v0
const/4 v1, 0x1
.line 3
invoke-virtual {v0, v1}, Landroid/graphics/Bitmap;->setHasAlpha(Z)V
return-object v0
.end method
.method private readBlock()I
.registers 6
.line 1
invoke-direct {p0}, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->readByte()I
move-result v0
if-gtz v0, :cond_7
return v0
.line 2
:cond_7
iget-object v1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->rawData:Ljava/nio/ByteBuffer;
iget-object v2, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->block:[B
const/4 v3, 0x0
invoke-virtual {v1}, Ljava/nio/Buffer;->remaining()I
move-result v4
invoke-static {v0, v4}, Ljava/lang/Math;->min(II)I
move-result v4
invoke-virtual {v1, v2, v3, v4}, Ljava/nio/ByteBuffer;->get([BII)Ljava/nio/ByteBuffer;
return v0
.end method
.method private readByte()I
.registers 2
iget-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->rawData:Ljava/nio/ByteBuffer;
invoke-virtual {v0}, Ljava/nio/ByteBuffer;->get()B
move-result v0
and-int/lit16 v0, v0, 0xff
return v0
.end method
.method private setPixels(Lcom/bumptech/glide/gifdecoder/GifFrame;Lcom/bumptech/glide/gifdecoder/GifFrame;)Landroid/graphics/Bitmap;
.registers 12
.line 1
iget-object v8, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->mainScratch:[I
const/4 v0, 0x0
if-nez p2, :cond_14
.line 2
iget-object v1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->previousImage:Landroid/graphics/Bitmap;
if-eqz v1, :cond_e
.line 3
iget-object v2, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->bitmapProvider:Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;
invoke-interface {v2, v1}, Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;->release(Landroid/graphics/Bitmap;)V
:cond_e
const/4 v1, 0x0
.line 4
iput-object v1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->previousImage:Landroid/graphics/Bitmap;
.line 5
invoke-static {v8, v0}, Ljava/util/Arrays;->fill([II)V
:cond_14
const/4 v1, 0x3
if-eqz p2, :cond_22
.line 6
iget v2, p2, Lcom/bumptech/glide/gifdecoder/GifFrame;->dispose:I
if-ne v2, v1, :cond_22
iget-object v2, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->previousImage:Landroid/graphics/Bitmap;
if-nez v2, :cond_22
.line 7
invoke-static {v8, v0}, Ljava/util/Arrays;->fill([II)V
:cond_22
if-eqz p2, :cond_77
.line 8
iget v2, p2, Lcom/bumptech/glide/gifdecoder/GifFrame;->dispose:I
if-lez v2, :cond_77
const/4 v3, 0x2
if-ne v2, v3, :cond_65
.line 9
iget-boolean v1, p1, Lcom/bumptech/glide/gifdecoder/GifFrame;->transparency:Z
if-nez v1, :cond_3f
.line 10
iget-object v1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->header:Lcom/bumptech/glide/gifdecoder/GifHeader;
iget v2, v1, Lcom/bumptech/glide/gifdecoder/GifHeader;->bgColor:I
.line 11
iget-object v3, p1, Lcom/bumptech/glide/gifdecoder/GifFrame;->lct:[I
if-eqz v3, :cond_3e
iget v1, v1, Lcom/bumptech/glide/gifdecoder/GifHeader;->bgIndex:I
iget v3, p1, Lcom/bumptech/glide/gifdecoder/GifFrame;->transIndex:I
if-ne v1, v3, :cond_3e
goto :goto_3f
:cond_3e
move v0, v2
.line 12
:cond_3f
:goto_3f
iget v1, p2, Lcom/bumptech/glide/gifdecoder/GifFrame;->ih:I
iget v2, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->sampleSize:I
div-int/2addr v1, v2
.line 13
iget v3, p2, Lcom/bumptech/glide/gifdecoder/GifFrame;->iy:I
div-int/2addr v3, v2
.line 14
iget v4, p2, Lcom/bumptech/glide/gifdecoder/GifFrame;->iw:I
div-int/2addr v4, v2
.line 15
iget p2, p2, Lcom/bumptech/glide/gifdecoder/GifFrame;->ix:I
div-int/2addr p2, v2
.line 16
iget v2, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->downsampledWidth:I
mul-int v3, v3, v2
add-int/2addr v3, p2
mul-int v1, v1, v2
add-int/2addr v1, v3
:goto_55
if-ge v3, v1, :cond_77
add-int p2, v3, v4
move v2, v3
:goto_5a
if-ge v2, p2, :cond_61
.line 17
aput v0, v8, v2
add-int/lit8 v2, v2, 0x1
goto :goto_5a
.line 18
:cond_61
iget p2, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->downsampledWidth:I
add-int/2addr v3, p2
goto :goto_55
:cond_65
if-ne v2, v1, :cond_77
.line 19
iget-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->previousImage:Landroid/graphics/Bitmap;
if-eqz v0, :cond_77
const/4 v2, 0x0
.line 20
iget v6, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->downsampledWidth:I
const/4 v4, 0x0
const/4 v5, 0x0
iget v7, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->downsampledHeight:I
move-object v1, v8
move v3, v6
invoke-virtual/range {v0 .. v7}, Landroid/graphics/Bitmap;->getPixels([IIIIIII)V
.line 21
:cond_77
invoke-direct {p0, p1}, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->decodeBitmapData(Lcom/bumptech/glide/gifdecoder/GifFrame;)V
.line 22
iget-boolean p2, p1, Lcom/bumptech/glide/gifdecoder/GifFrame;->interlace:Z
const/4 v0, 0x1
if-nez p2, :cond_88
iget p2, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->sampleSize:I
if-eq p2, v0, :cond_84
goto :goto_88
.line 23
:cond_84
invoke-direct {p0, p1}, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->copyIntoScratchFast(Lcom/bumptech/glide/gifdecoder/GifFrame;)V
goto :goto_8b
.line 24
:cond_88
:goto_88
invoke-direct {p0, p1}, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->copyCopyIntoScratchRobust(Lcom/bumptech/glide/gifdecoder/GifFrame;)V
.line 25
:goto_8b
iget-boolean p2, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->savePrevious:Z
if-eqz p2, :cond_ad
iget p1, p1, Lcom/bumptech/glide/gifdecoder/GifFrame;->dispose:I
if-eqz p1, :cond_95
if-ne p1, v0, :cond_ad
.line 26
:cond_95
iget-object p1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->previousImage:Landroid/graphics/Bitmap;
if-nez p1, :cond_9f
.line 27
invoke-direct {p0}, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->getNextBitmap()Landroid/graphics/Bitmap;
move-result-object p1
iput-object p1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->previousImage:Landroid/graphics/Bitmap;
.line 28
:cond_9f
iget-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->previousImage:Landroid/graphics/Bitmap;
const/4 v2, 0x0
iget v6, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->downsampledWidth:I
const/4 v4, 0x0
const/4 v5, 0x0
iget v7, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->downsampledHeight:I
move-object v1, v8
move v3, v6
invoke-virtual/range {v0 .. v7}, Landroid/graphics/Bitmap;->setPixels([IIIIIII)V
.line 29
:cond_ad
invoke-direct {p0}, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->getNextBitmap()Landroid/graphics/Bitmap;
move-result-object p1
const/4 v2, 0x0
.line 30
iget v6, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->downsampledWidth:I
const/4 v4, 0x0
const/4 v5, 0x0
iget v7, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->downsampledHeight:I
move-object v0, p1
move-object v1, v8
move v3, v6
invoke-virtual/range {v0 .. v7}, Landroid/graphics/Bitmap;->setPixels([IIIIIII)V
return-object p1
.end method
# virtual methods
.method public advance()V
.registers 3
iget v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->framePointer:I
add-int/lit8 v0, v0, 0x1
iget-object v1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->header:Lcom/bumptech/glide/gifdecoder/GifHeader;
iget v1, v1, Lcom/bumptech/glide/gifdecoder/GifHeader;->frameCount:I
rem-int/2addr v0, v1
iput v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->framePointer:I
return-void
.end method
.method public clear()V
.registers 4
const/4 v0, 0x0
.line 1
iput-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->header:Lcom/bumptech/glide/gifdecoder/GifHeader;
.line 2
iget-object v1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->mainPixels:[B
if-eqz v1, :cond_c
.line 3
iget-object v2, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->bitmapProvider:Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;
invoke-interface {v2, v1}, Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;->release([B)V
.line 4
:cond_c
iget-object v1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->mainScratch:[I
if-eqz v1, :cond_15
.line 5
iget-object v2, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->bitmapProvider:Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;
invoke-interface {v2, v1}, Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;->release([I)V
.line 6
:cond_15
iget-object v1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->previousImage:Landroid/graphics/Bitmap;
if-eqz v1, :cond_1e
.line 7
iget-object v2, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->bitmapProvider:Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;
invoke-interface {v2, v1}, Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;->release(Landroid/graphics/Bitmap;)V
.line 8
:cond_1e
iput-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->previousImage:Landroid/graphics/Bitmap;
.line 9
iput-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->rawData:Ljava/nio/ByteBuffer;
.line 10
iput-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->isFirstFrameTransparent:Ljava/lang/Boolean;
.line 11
iget-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->block:[B
if-eqz v0, :cond_2d
.line 12
iget-object v1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->bitmapProvider:Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;
invoke-interface {v1, v0}, Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;->release([B)V
:cond_2d
return-void
.end method
.method public getByteSize()I
.registers 3
iget-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->rawData:Ljava/nio/ByteBuffer;
invoke-virtual {v0}, Ljava/nio/Buffer;->limit()I
move-result v0
iget-object v1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->mainPixels:[B
array-length v1, v1
add-int/2addr v0, v1
iget-object v1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->mainScratch:[I
array-length v1, v1
mul-int/lit8 v1, v1, 0x4
add-int/2addr v1, v0
return v1
.end method
.method public getCurrentFrameIndex()I
.registers 2
iget v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->framePointer:I
return v0
.end method
.method public getData()Ljava/nio/ByteBuffer;
.registers 2
iget-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->rawData:Ljava/nio/ByteBuffer;
return-object v0
.end method
.method public getDelay(I)I
.registers 4
if-ltz p1, :cond_13
.line 1
iget-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->header:Lcom/bumptech/glide/gifdecoder/GifHeader;
iget v1, v0, Lcom/bumptech/glide/gifdecoder/GifHeader;->frameCount:I
if-ge p1, v1, :cond_13
.line 2
iget-object v0, v0, Lcom/bumptech/glide/gifdecoder/GifHeader;->frames:Ljava/util/List;
invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object p1
check-cast p1, Lcom/bumptech/glide/gifdecoder/GifFrame;
iget p1, p1, Lcom/bumptech/glide/gifdecoder/GifFrame;->delay:I
goto :goto_14
:cond_13
const/4 p1, -0x1
:goto_14
return p1
.end method
.method public getFrameCount()I
.registers 2
iget-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->header:Lcom/bumptech/glide/gifdecoder/GifHeader;
iget v0, v0, Lcom/bumptech/glide/gifdecoder/GifHeader;->frameCount:I
return v0
.end method
.method public getHeight()I
.registers 2
iget-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->header:Lcom/bumptech/glide/gifdecoder/GifHeader;
iget v0, v0, Lcom/bumptech/glide/gifdecoder/GifHeader;->height:I
return v0
.end method
.method public getLoopCount()I
.registers 3
.annotation runtime Ljava/lang/Deprecated;
.end annotation
iget-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->header:Lcom/bumptech/glide/gifdecoder/GifHeader;
iget v0, v0, Lcom/bumptech/glide/gifdecoder/GifHeader;->loopCount:I
const/4 v1, -0x1
if-ne v0, v1, :cond_8
const/4 v0, 0x1
:cond_8
return v0
.end method
.method public getNetscapeLoopCount()I
.registers 2
iget-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->header:Lcom/bumptech/glide/gifdecoder/GifHeader;
iget v0, v0, Lcom/bumptech/glide/gifdecoder/GifHeader;->loopCount:I
return v0
.end method
.method public getNextDelay()I
.registers 2
.line 1
iget-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->header:Lcom/bumptech/glide/gifdecoder/GifHeader;
iget v0, v0, Lcom/bumptech/glide/gifdecoder/GifHeader;->frameCount:I
if-lez v0, :cond_10
iget v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->framePointer:I
if-gez v0, :cond_b
goto :goto_10
.line 2
:cond_b
invoke-virtual {p0, v0}, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->getDelay(I)I
move-result v0
return v0
:cond_10
:goto_10
const/4 v0, 0x0
return v0
.end method
.method public declared-synchronized getNextFrame()Landroid/graphics/Bitmap;
.registers 9
monitor-enter p0
.line 1
:try_start_1
iget-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->header:Lcom/bumptech/glide/gifdecoder/GifHeader;
iget v0, v0, Lcom/bumptech/glide/gifdecoder/GifHeader;->frameCount:I
const/4 v1, 0x3
const/4 v2, 0x1
if-lez v0, :cond_d
iget v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->framePointer:I
if-gez v0, :cond_1b
.line 2
:cond_d
sget-object v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->TAG:Ljava/lang/String;
invoke-static {v0, v1}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
move-result v0
if-eqz v0, :cond_19
.line 3
iget-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->header:Lcom/bumptech/glide/gifdecoder/GifHeader;
iget v0, v0, Lcom/bumptech/glide/gifdecoder/GifHeader;->frameCount:I
.line 4
:cond_19
iput v2, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->status:I
.line 5
:cond_1b
iget v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->status:I
const/4 v3, 0x0
if-eq v0, v2, :cond_91
const/4 v4, 0x2
if-ne v0, v4, :cond_24
goto :goto_91
:cond_24
const/4 v0, 0x0
.line 6
iput v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->status:I
.line 7
iget-object v5, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->block:[B
if-nez v5, :cond_35
.line 8
iget-object v5, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->bitmapProvider:Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;
const/16 v6, 0xff
invoke-interface {v5, v6}, Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;->obtainByteArray(I)[B
move-result-object v5
iput-object v5, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->block:[B
.line 9
:cond_35
iget-object v5, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->header:Lcom/bumptech/glide/gifdecoder/GifHeader;
iget-object v5, v5, Lcom/bumptech/glide/gifdecoder/GifHeader;->frames:Ljava/util/List;
iget v6, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->framePointer:I
invoke-interface {v5, v6}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v5
check-cast v5, Lcom/bumptech/glide/gifdecoder/GifFrame;
.line 10
iget v6, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->framePointer:I
sub-int/2addr v6, v2
if-ltz v6, :cond_51
.line 11
iget-object v7, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->header:Lcom/bumptech/glide/gifdecoder/GifHeader;
iget-object v7, v7, Lcom/bumptech/glide/gifdecoder/GifHeader;->frames:Ljava/util/List;
invoke-interface {v7, v6}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v6
check-cast v6, Lcom/bumptech/glide/gifdecoder/GifFrame;
goto :goto_52
:cond_51
move-object v6, v3
.line 12
:goto_52
iget-object v7, v5, Lcom/bumptech/glide/gifdecoder/GifFrame;->lct:[I
if-eqz v7, :cond_57
goto :goto_5b
:cond_57
iget-object v7, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->header:Lcom/bumptech/glide/gifdecoder/GifHeader;
iget-object v7, v7, Lcom/bumptech/glide/gifdecoder/GifHeader;->gct:[I
:goto_5b
iput-object v7, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->act:[I
if-nez v7, :cond_69
.line 13
sget-object v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->TAG:Ljava/lang/String;
invoke-static {v0, v1}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
move-result v0
.line 14
iput v2, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->status:I
:try_end_67
.catchall {:try_start_1 .. :try_end_67} :catchall_99
.line 15
monitor-exit p0
return-object v3
.line 16
:cond_69
:try_start_69
iget-boolean v1, v5, Lcom/bumptech/glide/gifdecoder/GifFrame;->transparency:Z
if-eqz v1, :cond_8b
.line 17
iget-object v1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->pct:[I
array-length v2, v7
invoke-static {v7, v0, v1, v0, v2}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
.line 18
iget-object v1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->pct:[I
iput-object v1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->act:[I
.line 19
iget v2, v5, Lcom/bumptech/glide/gifdecoder/GifFrame;->transIndex:I
aput v0, v1, v2
.line 20
iget v0, v5, Lcom/bumptech/glide/gifdecoder/GifFrame;->dispose:I
if-eq v0, v4, :cond_83
iget-boolean v0, v5, Lcom/bumptech/glide/gifdecoder/GifFrame;->transparency:Z
if-eqz v0, :cond_8b
:cond_83
iget v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->framePointer:I
if-nez v0, :cond_8b
.line 21
sget-object v0, Ljava/lang/Boolean;->TRUE:Ljava/lang/Boolean;
iput-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->isFirstFrameTransparent:Ljava/lang/Boolean;
.line 22
:cond_8b
invoke-direct {p0, v5, v6}, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->setPixels(Lcom/bumptech/glide/gifdecoder/GifFrame;Lcom/bumptech/glide/gifdecoder/GifFrame;)Landroid/graphics/Bitmap;
move-result-object v0
:try_end_8f
.catchall {:try_start_69 .. :try_end_8f} :catchall_99
monitor-exit p0
return-object v0
.line 23
:cond_91
:goto_91
:try_start_91
sget-object v0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->TAG:Ljava/lang/String;
invoke-static {v0, v1}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
move-result v0
:try_end_97
.catchall {:try_start_91 .. :try_end_97} :catchall_99
.line 24
monitor-exit p0
return-object v3
:catchall_99
move-exception v0
monitor-exit p0
throw v0
.end method
.method public getStatus()I
.registers 2
iget v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->status:I
return v0
.end method
.method public getTotalIterationCount()I
.registers 4
iget-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->header:Lcom/bumptech/glide/gifdecoder/GifHeader;
iget v0, v0, Lcom/bumptech/glide/gifdecoder/GifHeader;->loopCount:I
const/4 v1, 0x1
const/4 v2, -0x1
if-ne v0, v2, :cond_9
return v1
:cond_9
if-nez v0, :cond_d
const/4 v0, 0x0
return v0
:cond_d
add-int/2addr v0, v1
return v0
.end method
.method public getWidth()I
.registers 2
iget-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->header:Lcom/bumptech/glide/gifdecoder/GifHeader;
iget v0, v0, Lcom/bumptech/glide/gifdecoder/GifHeader;->width:I
return v0
.end method
.method public read(Ljava/io/InputStream;I)I
.registers 8
if-eqz p1, :cond_2b
const/16 v0, 0x4000
if-lez p2, :cond_9
add-int/lit16 p2, p2, 0x1000
goto :goto_b
:cond_9
const/16 p2, 0x4000
.line 1
:goto_b
:try_start_b
new-instance v1, Ljava/io/ByteArrayOutputStream;
invoke-direct {v1, p2}, Ljava/io/ByteArrayOutputStream;-><init>(I)V
new-array p2, v0, [B
:goto_12
const/4 v2, 0x0
.line 2
invoke-virtual {p1, p2, v2, v0}, Ljava/io/InputStream;->read([BII)I
move-result v3
const/4 v4, -0x1
if-eq v3, v4, :cond_1e
.line 3
invoke-virtual {v1, p2, v2, v3}, Ljava/io/ByteArrayOutputStream;->write([BII)V
goto :goto_12
.line 4
:cond_1e
invoke-virtual {v1}, Ljava/io/OutputStream;->flush()V
.line 5
invoke-virtual {v1}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B
move-result-object p2
invoke-virtual {p0, p2}, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->read([B)I
:try_end_28
.catch Ljava/io/IOException; {:try_start_b .. :try_end_28} :catch_29
goto :goto_2e
:catch_29
nop
goto :goto_2e
:cond_2b
const/4 p2, 0x2
.line 6
iput p2, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->status:I
:goto_2e
if-eqz p1, :cond_33
.line 7
:try_start_30
invoke-virtual {p1}, Ljava/io/InputStream;->close()V
:try_end_33
.catch Ljava/io/IOException; {:try_start_30 .. :try_end_33} :catch_33
.line 8
:catch_33
:cond_33
iget p1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->status:I
return p1
.end method
.method public declared-synchronized read([B)I
.registers 3
monitor-enter p0
.line 9
:try_start_1
invoke-direct {p0}, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->getHeaderParser()Lcom/bumptech/glide/gifdecoder/GifHeaderParser;
move-result-object v0
invoke-virtual {v0, p1}, Lcom/bumptech/glide/gifdecoder/GifHeaderParser;->setData([B)Lcom/bumptech/glide/gifdecoder/GifHeaderParser;
move-result-object v0
invoke-virtual {v0}, Lcom/bumptech/glide/gifdecoder/GifHeaderParser;->parseHeader()Lcom/bumptech/glide/gifdecoder/GifHeader;
move-result-object v0
iput-object v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->header:Lcom/bumptech/glide/gifdecoder/GifHeader;
if-eqz p1, :cond_14
.line 10
invoke-virtual {p0, v0, p1}, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->setData(Lcom/bumptech/glide/gifdecoder/GifHeader;[B)V
.line 11
:cond_14
iget p1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->status:I
:try_end_16
.catchall {:try_start_1 .. :try_end_16} :catchall_18
monitor-exit p0
return p1
:catchall_18
move-exception p1
monitor-exit p0
throw p1
.end method
.method public resetFrameIndex()V
.registers 2
const/4 v0, -0x1
iput v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->framePointer:I
return-void
.end method
.method public declared-synchronized setData(Lcom/bumptech/glide/gifdecoder/GifHeader;Ljava/nio/ByteBuffer;)V
.registers 4
monitor-enter p0
const/4 v0, 0x1
.line 3
:try_start_2
invoke-virtual {p0, p1, p2, v0}, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->setData(Lcom/bumptech/glide/gifdecoder/GifHeader;Ljava/nio/ByteBuffer;I)V
:try_end_5
.catchall {:try_start_2 .. :try_end_5} :catchall_7
.line 4
monitor-exit p0
return-void
:catchall_7
move-exception p1
monitor-exit p0
throw p1
.end method
.method public declared-synchronized setData(Lcom/bumptech/glide/gifdecoder/GifHeader;Ljava/nio/ByteBuffer;I)V
.registers 6
monitor-enter p0
if-lez p3, :cond_65
.line 5
:try_start_3
invoke-static {p3}, Ljava/lang/Integer;->highestOneBit(I)I
move-result p3
const/4 v0, 0x0
.line 6
iput v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->status:I
.line 7
iput-object p1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->header:Lcom/bumptech/glide/gifdecoder/GifHeader;
const/4 v1, -0x1
.line 8
iput v1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->framePointer:I
.line 9
invoke-virtual {p2}, Ljava/nio/ByteBuffer;->asReadOnlyBuffer()Ljava/nio/ByteBuffer;
move-result-object p2
iput-object p2, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->rawData:Ljava/nio/ByteBuffer;
.line 10
invoke-virtual {p2, v0}, Ljava/nio/ByteBuffer;->position(I)Ljava/nio/Buffer;
.line 11
iget-object p2, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->rawData:Ljava/nio/ByteBuffer;
sget-object v1, Ljava/nio/ByteOrder;->LITTLE_ENDIAN:Ljava/nio/ByteOrder;
invoke-virtual {p2, v1}, Ljava/nio/ByteBuffer;->order(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;
.line 12
iput-boolean v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->savePrevious:Z
.line 13
iget-object p2, p1, Lcom/bumptech/glide/gifdecoder/GifHeader;->frames:Ljava/util/List;
invoke-interface {p2}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object p2
:cond_27
invoke-interface {p2}, Ljava/util/Iterator;->hasNext()Z
move-result v0
if-eqz v0, :cond_3b
invoke-interface {p2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/bumptech/glide/gifdecoder/GifFrame;
.line 14
iget v0, v0, Lcom/bumptech/glide/gifdecoder/GifFrame;->dispose:I
const/4 v1, 0x3
if-ne v0, v1, :cond_27
const/4 p2, 0x1
.line 15
iput-boolean p2, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->savePrevious:Z
.line 16
:cond_3b
iput p3, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->sampleSize:I
.line 17
iget p2, p1, Lcom/bumptech/glide/gifdecoder/GifHeader;->width:I
div-int v0, p2, p3
iput v0, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->downsampledWidth:I
.line 18
iget p1, p1, Lcom/bumptech/glide/gifdecoder/GifHeader;->height:I
div-int p3, p1, p3
iput p3, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->downsampledHeight:I
.line 19
iget-object p3, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->bitmapProvider:Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;
mul-int p2, p2, p1
invoke-interface {p3, p2}, Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;->obtainByteArray(I)[B
move-result-object p1
iput-object p1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->mainPixels:[B
.line 20
iget-object p1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->bitmapProvider:Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;
iget p2, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->downsampledWidth:I
iget p3, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->downsampledHeight:I
mul-int p2, p2, p3
invoke-interface {p1, p2}, Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;->obtainIntArray(I)[I
move-result-object p1
iput-object p1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->mainScratch:[I
:try_end_61
.catchall {:try_start_3 .. :try_end_61} :catchall_63
.line 21
monitor-exit p0
return-void
:catchall_63
move-exception p1
goto :goto_7c
.line 22
:cond_65
:try_start_65
new-instance p1, Ljava/lang/IllegalArgumentException;
new-instance p2, Ljava/lang/StringBuilder;
invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
const-string v0, "Sample size must be >=0, not: "
invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p2
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
:try_end_7c
.catchall {:try_start_65 .. :try_end_7c} :catchall_63
:goto_7c
monitor-exit p0
throw p1
.end method
.method public declared-synchronized setData(Lcom/bumptech/glide/gifdecoder/GifHeader;[B)V
.registers 3
monitor-enter p0
.line 1
:try_start_1
invoke-static {p2}, Ljava/nio/ByteBuffer;->wrap([B)Ljava/nio/ByteBuffer;
move-result-object p2
invoke-virtual {p0, p1, p2}, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->setData(Lcom/bumptech/glide/gifdecoder/GifHeader;Ljava/nio/ByteBuffer;)V
:try_end_8
.catchall {:try_start_1 .. :try_end_8} :catchall_a
.line 2
monitor-exit p0
return-void
:catchall_a
move-exception p1
monitor-exit p0
throw p1
.end method
.method public setDefaultBitmapConfig(Landroid/graphics/Bitmap$Config;)V
.registers 5
.line 1
sget-object v0, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;
if-eq p1, v0, :cond_34
sget-object v0, Landroid/graphics/Bitmap$Config;->RGB_565:Landroid/graphics/Bitmap$Config;
if-ne p1, v0, :cond_9
goto :goto_34
.line 2
:cond_9
new-instance v0, Ljava/lang/IllegalArgumentException;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "Unsupported format: "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
const-string p1, ", must be one of "
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
sget-object p1, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
const-string p1, " or "
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
sget-object p1, Landroid/graphics/Bitmap$Config;->RGB_565:Landroid/graphics/Bitmap$Config;
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
invoke-direct {v0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v0
.line 3
:cond_34
:goto_34
iput-object p1, p0, Lcom/bumptech/glide/gifdecoder/StandardGifDecoder;->bitmapConfig:Landroid/graphics/Bitmap$Config;
return-void
.end method