Painting.smali

.class public Lim/tpelyyftgw/ui/components/paint/Painting;
.super Ljava/lang/Object;
.source "Painting.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lim/tpelyyftgw/ui/components/paint/Painting$PaintingData;,
        Lim/tpelyyftgw/ui/components/paint/Painting$PaintingDelegate;
    }
.end annotation


# instance fields
.field private activePath:Lim/tpelyyftgw/ui/components/paint/Path;

.field private activeStrokeBounds:Landroid/graphics/RectF;

.field private backupSlice:Lim/tpelyyftgw/ui/components/paint/Slice;

.field private bitmapTexture:Lim/tpelyyftgw/ui/components/paint/Texture;

.field private brush:Lim/tpelyyftgw/ui/components/paint/Brush;

.field private brushTexture:Lim/tpelyyftgw/ui/components/paint/Texture;

.field private buffers:[I

.field private dataBuffer:Ljava/nio/ByteBuffer;

.field private delegate:Lim/tpelyyftgw/ui/components/paint/Painting$PaintingDelegate;

.field private paintTexture:I

.field private paused:Z

.field private projection:[F

.field private renderProjection:[F

.field private renderState:Lim/tpelyyftgw/ui/components/paint/RenderState;

.field private renderView:Lim/tpelyyftgw/ui/components/paint/RenderView;

.field private reusableFramebuffer:I

.field private shaders:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "Lim/tpelyyftgw/ui/components/paint/Shader;",
            ">;"
        }
    .end annotation
.end field

.field private size:Lim/tpelyyftgw/ui/components/Size;

.field private suppressChangesCounter:I

.field private textureBuffer:Ljava/nio/ByteBuffer;

.field private vertexBuffer:Ljava/nio/ByteBuffer;


# direct methods
.method static constructor <clinit>()V
    .registers 1

    return-void
.end method

.method public constructor <init>(Lim/tpelyyftgw/ui/components/Size;)V
    .registers 9
    .param p1, "sz"    # Lim/tpelyyftgw/ui/components/Size;

    .line 62
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 53
    const/4 v0, 0x1

    new-array v0, v0, [I

    iput-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->buffers:[I

    .line 63
    new-instance v0, Lim/tpelyyftgw/ui/components/paint/RenderState;

    invoke-direct {v0}, Lim/tpelyyftgw/ui/components/paint/RenderState;-><init>()V

    iput-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->renderState:Lim/tpelyyftgw/ui/components/paint/RenderState;

    .line 65
    iput-object p1, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->size:Lim/tpelyyftgw/ui/components/Size;

    .line 67
    iget v0, p1, Lim/tpelyyftgw/ui/components/Size;->width:F

    float-to-int v0, v0

    iget-object v1, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->size:Lim/tpelyyftgw/ui/components/Size;

    iget v1, v1, Lim/tpelyyftgw/ui/components/Size;->height:F

    float-to-int v1, v1

    mul-int v0, v0, v1

    mul-int/lit8 v0, v0, 0x4

    invoke-static {v0}, Ljava/nio/ByteBuffer;->allocateDirect(I)Ljava/nio/ByteBuffer;

    move-result-object v0

    iput-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->dataBuffer:Ljava/nio/ByteBuffer;

    .line 69
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->size:Lim/tpelyyftgw/ui/components/Size;

    iget v2, v0, Lim/tpelyyftgw/ui/components/Size;->width:F

    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->size:Lim/tpelyyftgw/ui/components/Size;

    iget v4, v0, Lim/tpelyyftgw/ui/components/Size;->height:F

    const/4 v1, 0x0

    const/4 v3, 0x0

    const/high16 v5, -0x40800000    # -1.0f

    const/high16 v6, 0x3f800000    # 1.0f

    invoke-static/range {v1 .. v6}, Lim/tpelyyftgw/ui/components/paint/GLMatrix;->LoadOrtho(FFFFFF)[F

    move-result-object v0

    iput-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->projection:[F

    .line 71
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->vertexBuffer:Ljava/nio/ByteBuffer;

    const/16 v1, 0x20

    if-nez v0, :cond_4a

    .line 72
    invoke-static {v1}, Ljava/nio/ByteBuffer;->allocateDirect(I)Ljava/nio/ByteBuffer;

    move-result-object v0

    iput-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->vertexBuffer:Ljava/nio/ByteBuffer;

    .line 73
    invoke-static {}, Ljava/nio/ByteOrder;->nativeOrder()Ljava/nio/ByteOrder;

    move-result-object v2

    invoke-virtual {v0, v2}, Ljava/nio/ByteBuffer;->order(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;

    .line 75
    :cond_4a
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->vertexBuffer:Ljava/nio/ByteBuffer;

    const/4 v2, 0x0

    invoke-virtual {v0, v2}, Ljava/nio/ByteBuffer;->putFloat(F)Ljava/nio/ByteBuffer;

    .line 76
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->vertexBuffer:Ljava/nio/ByteBuffer;

    invoke-virtual {v0, v2}, Ljava/nio/ByteBuffer;->putFloat(F)Ljava/nio/ByteBuffer;

    .line 77
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->vertexBuffer:Ljava/nio/ByteBuffer;

    iget-object v3, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->size:Lim/tpelyyftgw/ui/components/Size;

    iget v3, v3, Lim/tpelyyftgw/ui/components/Size;->width:F

    invoke-virtual {v0, v3}, Ljava/nio/ByteBuffer;->putFloat(F)Ljava/nio/ByteBuffer;

    .line 78
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->vertexBuffer:Ljava/nio/ByteBuffer;

    invoke-virtual {v0, v2}, Ljava/nio/ByteBuffer;->putFloat(F)Ljava/nio/ByteBuffer;

    .line 79
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->vertexBuffer:Ljava/nio/ByteBuffer;

    invoke-virtual {v0, v2}, Ljava/nio/ByteBuffer;->putFloat(F)Ljava/nio/ByteBuffer;

    .line 80
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->vertexBuffer:Ljava/nio/ByteBuffer;

    iget-object v3, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->size:Lim/tpelyyftgw/ui/components/Size;

    iget v3, v3, Lim/tpelyyftgw/ui/components/Size;->height:F

    invoke-virtual {v0, v3}, Ljava/nio/ByteBuffer;->putFloat(F)Ljava/nio/ByteBuffer;

    .line 81
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->vertexBuffer:Ljava/nio/ByteBuffer;

    iget-object v3, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->size:Lim/tpelyyftgw/ui/components/Size;

    iget v3, v3, Lim/tpelyyftgw/ui/components/Size;->width:F

    invoke-virtual {v0, v3}, Ljava/nio/ByteBuffer;->putFloat(F)Ljava/nio/ByteBuffer;

    .line 82
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->vertexBuffer:Ljava/nio/ByteBuffer;

    iget-object v3, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->size:Lim/tpelyyftgw/ui/components/Size;

    iget v3, v3, Lim/tpelyyftgw/ui/components/Size;->height:F

    invoke-virtual {v0, v3}, Ljava/nio/ByteBuffer;->putFloat(F)Ljava/nio/ByteBuffer;

    .line 83
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->vertexBuffer:Ljava/nio/ByteBuffer;

    invoke-virtual {v0}, Ljava/nio/ByteBuffer;->rewind()Ljava/nio/Buffer;

    .line 85
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->textureBuffer:Ljava/nio/ByteBuffer;

    if-nez v0, :cond_c8

    .line 86
    invoke-static {v1}, Ljava/nio/ByteBuffer;->allocateDirect(I)Ljava/nio/ByteBuffer;

    move-result-object v0

    iput-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->textureBuffer:Ljava/nio/ByteBuffer;

    .line 87
    invoke-static {}, Ljava/nio/ByteOrder;->nativeOrder()Ljava/nio/ByteOrder;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/nio/ByteBuffer;->order(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;

    .line 88
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->textureBuffer:Ljava/nio/ByteBuffer;

    invoke-virtual {v0, v2}, Ljava/nio/ByteBuffer;->putFloat(F)Ljava/nio/ByteBuffer;

    .line 89
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->textureBuffer:Ljava/nio/ByteBuffer;

    invoke-virtual {v0, v2}, Ljava/nio/ByteBuffer;->putFloat(F)Ljava/nio/ByteBuffer;

    .line 90
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->textureBuffer:Ljava/nio/ByteBuffer;

    const/high16 v1, 0x3f800000    # 1.0f

    invoke-virtual {v0, v1}, Ljava/nio/ByteBuffer;->putFloat(F)Ljava/nio/ByteBuffer;

    .line 91
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->textureBuffer:Ljava/nio/ByteBuffer;

    invoke-virtual {v0, v2}, Ljava/nio/ByteBuffer;->putFloat(F)Ljava/nio/ByteBuffer;

    .line 92
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->textureBuffer:Ljava/nio/ByteBuffer;

    invoke-virtual {v0, v2}, Ljava/nio/ByteBuffer;->putFloat(F)Ljava/nio/ByteBuffer;

    .line 93
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->textureBuffer:Ljava/nio/ByteBuffer;

    invoke-virtual {v0, v1}, Ljava/nio/ByteBuffer;->putFloat(F)Ljava/nio/ByteBuffer;

    .line 94
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->textureBuffer:Ljava/nio/ByteBuffer;

    invoke-virtual {v0, v1}, Ljava/nio/ByteBuffer;->putFloat(F)Ljava/nio/ByteBuffer;

    .line 95
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->textureBuffer:Ljava/nio/ByteBuffer;

    invoke-virtual {v0, v1}, Ljava/nio/ByteBuffer;->putFloat(F)Ljava/nio/ByteBuffer;

    .line 96
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->textureBuffer:Ljava/nio/ByteBuffer;

    invoke-virtual {v0}, Ljava/nio/ByteBuffer;->rewind()Ljava/nio/Buffer;

    .line 98
    :cond_c8
    return-void
.end method

.method static synthetic access$002(Lim/tpelyyftgw/ui/components/paint/Painting;Lim/tpelyyftgw/ui/components/paint/Path;)Lim/tpelyyftgw/ui/components/paint/Path;
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/Painting;
    .param p1, "x1"    # Lim/tpelyyftgw/ui/components/paint/Path;

    .line 19
    iput-object p1, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->activePath:Lim/tpelyyftgw/ui/components/paint/Path;

    return-object p1
.end method

.method static synthetic access$100(Lim/tpelyyftgw/ui/components/paint/Painting;)I
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/Painting;

    .line 19
    invoke-direct {p0}, Lim/tpelyyftgw/ui/components/paint/Painting;->getReusableFramebuffer()I

    move-result v0

    return v0
.end method

.method static synthetic access$1000(Lim/tpelyyftgw/ui/components/paint/Painting;)Landroid/graphics/RectF;
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/Painting;

    .line 19
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->activeStrokeBounds:Landroid/graphics/RectF;

    return-object v0
.end method

.method static synthetic access$1002(Lim/tpelyyftgw/ui/components/paint/Painting;Landroid/graphics/RectF;)Landroid/graphics/RectF;
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/Painting;
    .param p1, "x1"    # Landroid/graphics/RectF;

    .line 19
    iput-object p1, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->activeStrokeBounds:Landroid/graphics/RectF;

    return-object p1
.end method

.method static synthetic access$1100(Lim/tpelyyftgw/ui/components/paint/Painting;Landroid/graphics/RectF;)V
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/Painting;
    .param p1, "x1"    # Landroid/graphics/RectF;

    .line 19
    invoke-direct {p0, p1}, Lim/tpelyyftgw/ui/components/paint/Painting;->registerUndo(Landroid/graphics/RectF;)V

    return-void
.end method

.method static synthetic access$1200(Lim/tpelyyftgw/ui/components/paint/Painting;)V
    .registers 1
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/Painting;

    .line 19
    invoke-direct {p0}, Lim/tpelyyftgw/ui/components/paint/Painting;->beginSuppressingChanges()V

    return-void
.end method

.method static synthetic access$1300(Lim/tpelyyftgw/ui/components/paint/Painting;)Ljava/nio/ByteBuffer;
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/Painting;

    .line 19
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->vertexBuffer:Ljava/nio/ByteBuffer;

    return-object v0
.end method

.method static synthetic access$1400(Lim/tpelyyftgw/ui/components/paint/Painting;)Ljava/nio/ByteBuffer;
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/Painting;

    .line 19
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->textureBuffer:Ljava/nio/ByteBuffer;

    return-object v0
.end method

.method static synthetic access$1500(Lim/tpelyyftgw/ui/components/paint/Painting;Landroid/graphics/RectF;Ljava/lang/Runnable;)V
    .registers 3
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/Painting;
    .param p1, "x1"    # Landroid/graphics/RectF;
    .param p2, "x2"    # Ljava/lang/Runnable;

    .line 19
    invoke-direct {p0, p1, p2}, Lim/tpelyyftgw/ui/components/paint/Painting;->update(Landroid/graphics/RectF;Ljava/lang/Runnable;)V

    return-void
.end method

.method static synthetic access$1600(Lim/tpelyyftgw/ui/components/paint/Painting;)V
    .registers 1
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/Painting;

    .line 19
    invoke-direct {p0}, Lim/tpelyyftgw/ui/components/paint/Painting;->endSuppressingChanges()V

    return-void
.end method

.method static synthetic access$1700(Lim/tpelyyftgw/ui/components/paint/Painting;Lim/tpelyyftgw/ui/components/paint/Slice;)V
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/Painting;
    .param p1, "x1"    # Lim/tpelyyftgw/ui/components/paint/Slice;

    .line 19
    invoke-direct {p0, p1}, Lim/tpelyyftgw/ui/components/paint/Painting;->restoreSlice(Lim/tpelyyftgw/ui/components/paint/Slice;)V

    return-void
.end method

.method static synthetic access$1800(Lim/tpelyyftgw/ui/components/paint/Painting;)I
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/Painting;

    .line 19
    invoke-direct {p0}, Lim/tpelyyftgw/ui/components/paint/Painting;->getTexture()I

    move-result v0

    return v0
.end method

.method static synthetic access$1900(Lim/tpelyyftgw/ui/components/paint/Painting;)Z
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/Painting;

    .line 19
    invoke-direct {p0}, Lim/tpelyyftgw/ui/components/paint/Painting;->isSuppressingChanges()Z

    move-result v0

    return v0
.end method

.method static synthetic access$200(Lim/tpelyyftgw/ui/components/paint/Painting;)I
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/Painting;

    .line 19
    invoke-direct {p0}, Lim/tpelyyftgw/ui/components/paint/Painting;->getPaintTexture()I

    move-result v0

    return v0
.end method

.method static synthetic access$2002(Lim/tpelyyftgw/ui/components/paint/Painting;Z)Z
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/Painting;
    .param p1, "x1"    # Z

    .line 19
    iput-boolean p1, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->paused:Z

    return p1
.end method

.method static synthetic access$2102(Lim/tpelyyftgw/ui/components/paint/Painting;Lim/tpelyyftgw/ui/components/paint/Slice;)Lim/tpelyyftgw/ui/components/paint/Slice;
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/Painting;
    .param p1, "x1"    # Lim/tpelyyftgw/ui/components/paint/Slice;

    .line 19
    iput-object p1, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->backupSlice:Lim/tpelyyftgw/ui/components/paint/Slice;

    return-object p1
.end method

.method static synthetic access$300(Lim/tpelyyftgw/ui/components/paint/Painting;)Lim/tpelyyftgw/ui/components/Size;
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/Painting;

    .line 19
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->size:Lim/tpelyyftgw/ui/components/Size;

    return-object v0
.end method

.method static synthetic access$400(Lim/tpelyyftgw/ui/components/paint/Painting;)Ljava/util/Map;
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/Painting;

    .line 19
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->shaders:Ljava/util/Map;

    return-object v0
.end method

.method static synthetic access$500(Lim/tpelyyftgw/ui/components/paint/Painting;)Lim/tpelyyftgw/ui/components/paint/Brush;
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/Painting;

    .line 19
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->brush:Lim/tpelyyftgw/ui/components/paint/Brush;

    return-object v0
.end method

.method static synthetic access$600(Lim/tpelyyftgw/ui/components/paint/Painting;)Lim/tpelyyftgw/ui/components/paint/Texture;
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/Painting;

    .line 19
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->brushTexture:Lim/tpelyyftgw/ui/components/paint/Texture;

    return-object v0
.end method

.method static synthetic access$602(Lim/tpelyyftgw/ui/components/paint/Painting;Lim/tpelyyftgw/ui/components/paint/Texture;)Lim/tpelyyftgw/ui/components/paint/Texture;
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/Painting;
    .param p1, "x1"    # Lim/tpelyyftgw/ui/components/paint/Texture;

    .line 19
    iput-object p1, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->brushTexture:Lim/tpelyyftgw/ui/components/paint/Texture;

    return-object p1
.end method

.method static synthetic access$700(Lim/tpelyyftgw/ui/components/paint/Painting;)[F
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/Painting;

    .line 19
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->projection:[F

    return-object v0
.end method

.method static synthetic access$800(Lim/tpelyyftgw/ui/components/paint/Painting;)Lim/tpelyyftgw/ui/components/paint/RenderState;
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/Painting;

    .line 19
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->renderState:Lim/tpelyyftgw/ui/components/paint/RenderState;

    return-object v0
.end method

.method static synthetic access$900(Lim/tpelyyftgw/ui/components/paint/Painting;)Lim/tpelyyftgw/ui/components/paint/Painting$PaintingDelegate;
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/Painting;

    .line 19
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->delegate:Lim/tpelyyftgw/ui/components/paint/Painting$PaintingDelegate;

    return-object v0
.end method

.method private beginSuppressingChanges()V
    .registers 2

    .line 121
    iget v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->suppressChangesCounter:I

    add-int/lit8 v0, v0, 0x1

    iput v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->suppressChangesCounter:I

    .line 122
    return-void
.end method

.method private endSuppressingChanges()V
    .registers 2

    .line 125
    iget v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->suppressChangesCounter:I

    add-int/lit8 v0, v0, -0x1

    iput v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->suppressChangesCounter:I

    .line 126
    return-void
.end method

.method private getPaintTexture()I
    .registers 2

    .line 543
    iget v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->paintTexture:I

    if-nez v0, :cond_c

    .line 544
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->size:Lim/tpelyyftgw/ui/components/Size;

    invoke-static {v0}, Lim/tpelyyftgw/ui/components/paint/Texture;->generateTexture(Lim/tpelyyftgw/ui/components/Size;)I

    move-result v0

    iput v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->paintTexture:I

    .line 546
    :cond_c
    iget v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->paintTexture:I

    return v0
.end method

.method private getReusableFramebuffer()I
    .registers 4

    .line 525
    iget v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->reusableFramebuffer:I

    if-nez v0, :cond_12

    .line 526
    const/4 v0, 0x1

    new-array v1, v0, [I

    .line 527
    .local v1, "buffers":[I
    const/4 v2, 0x0

    invoke-static {v0, v1, v2}, Landroid/opengl/GLES20;->glGenFramebuffers(I[II)V

    .line 528
    aget v0, v1, v2

    iput v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->reusableFramebuffer:I

    .line 530
    invoke-static {}, Lim/tpelyyftgw/ui/components/paint/Utils;->HasGLError()V

    .line 532
    .end local v1    # "buffers":[I
    :cond_12
    iget v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->reusableFramebuffer:I

    return v0
.end method

.method private getTexture()I
    .registers 2

    .line 536
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->bitmapTexture:Lim/tpelyyftgw/ui/components/paint/Texture;

    if-eqz v0, :cond_9

    .line 537
    invoke-virtual {v0}, Lim/tpelyyftgw/ui/components/paint/Texture;->texture()I

    move-result v0

    return v0

    .line 539
    :cond_9
    const/4 v0, 0x0

    return v0
.end method

.method private isSuppressingChanges()Z
    .registers 2

    .line 117
    iget v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->suppressChangesCounter:I

    if-lez v0, :cond_6

    const/4 v0, 0x1

    goto :goto_7

    :cond_6
    const/4 v0, 0x0

    :goto_7
    return v0
.end method

.method private registerUndo(Landroid/graphics/RectF;)V
    .registers 9
    .param p1, "rect"    # Landroid/graphics/RectF;

    .line 263
    if-nez p1, :cond_3

    .line 264
    return-void

    .line 267
    :cond_3
    invoke-virtual {p0}, Lim/tpelyyftgw/ui/components/paint/Painting;->getBounds()Landroid/graphics/RectF;

    move-result-object v0

    invoke-virtual {p1, p1, v0}, Landroid/graphics/RectF;->setIntersect(Landroid/graphics/RectF;Landroid/graphics/RectF;)Z

    move-result v0

    .line 268
    .local v0, "intersect":Z
    if-nez v0, :cond_e

    .line 269
    return-void

    .line 272
    :cond_e
    const/4 v1, 0x1

    invoke-virtual {p0, p1, v1}, Lim/tpelyyftgw/ui/components/paint/Painting;->getPaintingData(Landroid/graphics/RectF;Z)Lim/tpelyyftgw/ui/components/paint/Painting$PaintingData;

    move-result-object v1

    .line 273
    .local v1, "paintingData":Lim/tpelyyftgw/ui/components/paint/Painting$PaintingData;
    iget-object v2, v1, Lim/tpelyyftgw/ui/components/paint/Painting$PaintingData;->data:Ljava/nio/ByteBuffer;

    .line 275
    .local v2, "data":Ljava/nio/ByteBuffer;
    new-instance v3, Lim/tpelyyftgw/ui/components/paint/Slice;

    iget-object v4, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->delegate:Lim/tpelyyftgw/ui/components/paint/Painting$PaintingDelegate;

    invoke-interface {v4}, Lim/tpelyyftgw/ui/components/paint/Painting$PaintingDelegate;->requestDispatchQueue()Lim/tpelyyftgw/messenger/DispatchQueue;

    move-result-object v4

    invoke-direct {v3, v2, p1, v4}, Lim/tpelyyftgw/ui/components/paint/Slice;-><init>(Ljava/nio/ByteBuffer;Landroid/graphics/RectF;Lim/tpelyyftgw/messenger/DispatchQueue;)V

    .line 276
    .local v3, "slice":Lim/tpelyyftgw/ui/components/paint/Slice;
    iget-object v4, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->delegate:Lim/tpelyyftgw/ui/components/paint/Painting$PaintingDelegate;

    invoke-interface {v4}, Lim/tpelyyftgw/ui/components/paint/Painting$PaintingDelegate;->requestUndoStore()Lim/tpelyyftgw/ui/components/paint/UndoStore;

    move-result-object v4

    invoke-static {}, Ljava/util/UUID;->randomUUID()Ljava/util/UUID;

    move-result-object v5

    new-instance v6, Lim/tpelyyftgw/ui/components/paint/Painting$3;

    invoke-direct {v6, p0, v3}, Lim/tpelyyftgw/ui/components/paint/Painting$3;-><init>(Lim/tpelyyftgw/ui/components/paint/Painting;Lim/tpelyyftgw/ui/components/paint/Slice;)V

    invoke-virtual {v4, v5, v6}, Lim/tpelyyftgw/ui/components/paint/UndoStore;->registerUndo(Ljava/util/UUID;Ljava/lang/Runnable;)V

    .line 282
    return-void
.end method

.method private render(II)V
    .registers 22
    .param p1, "mask"    # I
    .param p2, "color"    # I

    .line 318
    move-object/from16 v0, p0

    iget-object v1, v0, Lim/tpelyyftgw/ui/components/paint/Painting;->shaders:Ljava/util/Map;

    iget-object v2, v0, Lim/tpelyyftgw/ui/components/paint/Painting;->brush:Lim/tpelyyftgw/ui/components/paint/Brush;

    invoke-interface {v2}, Lim/tpelyyftgw/ui/components/paint/Brush;->isLightSaber()Z

    move-result v2

    if-eqz v2, :cond_f

    const-string v2, "blitWithMaskLight"

    goto :goto_11

    :cond_f
    const-string v2, "blitWithMask"

    :goto_11
    invoke-interface {v1, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lim/tpelyyftgw/ui/components/paint/Shader;

    .line 319
    .local v1, "shader":Lim/tpelyyftgw/ui/components/paint/Shader;
    if-nez v1, :cond_1a

    .line 320
    return-void

    .line 323
    :cond_1a
    iget v2, v1, Lim/tpelyyftgw/ui/components/paint/Shader;->program:I

    invoke-static {v2}, Landroid/opengl/GLES20;->glUseProgram(I)V

    .line 325
    const-string v2, "mvpMatrix"

    invoke-virtual {v1, v2}, Lim/tpelyyftgw/ui/components/paint/Shader;->getUniform(Ljava/lang/String;)I

    move-result v2

    iget-object v3, v0, Lim/tpelyyftgw/ui/components/paint/Painting;->renderProjection:[F

    invoke-static {v3}, Ljava/nio/FloatBuffer;->wrap([F)Ljava/nio/FloatBuffer;

    move-result-object v3

    const/4 v4, 0x0

    const/4 v5, 0x1

    invoke-static {v2, v5, v4, v3}, Landroid/opengl/GLES20;->glUniformMatrix4fv(IIZLjava/nio/FloatBuffer;)V

    .line 326
    const-string v2, "texture"

    invoke-virtual {v1, v2}, Lim/tpelyyftgw/ui/components/paint/Shader;->getUniform(Ljava/lang/String;)I

    move-result v2

    invoke-static {v2, v4}, Landroid/opengl/GLES20;->glUniform1i(II)V

    .line 327
    const-string v2, "mask"

    invoke-virtual {v1, v2}, Lim/tpelyyftgw/ui/components/paint/Shader;->getUniform(Ljava/lang/String;)I

    move-result v2

    invoke-static {v2, v5}, Landroid/opengl/GLES20;->glUniform1i(II)V

    .line 328
    const-string v2, "color"

    invoke-virtual {v1, v2}, Lim/tpelyyftgw/ui/components/paint/Shader;->getUniform(Ljava/lang/String;)I

    move-result v2

    move/from16 v3, p2

    invoke-static {v2, v3}, Lim/tpelyyftgw/ui/components/paint/Shader;->SetColorUniform(II)V

    .line 330
    const v2, 0x84c0

    invoke-static {v2}, Landroid/opengl/GLES20;->glActiveTexture(I)V

    .line 331
    invoke-direct/range {p0 .. p0}, Lim/tpelyyftgw/ui/components/paint/Painting;->getTexture()I

    move-result v2

    const/16 v6, 0xde1

    invoke-static {v6, v2}, Landroid/opengl/GLES20;->glBindTexture(II)V

    .line 333
    const v2, 0x84c1

    invoke-static {v2}, Landroid/opengl/GLES20;->glActiveTexture(I)V

    .line 334
    move/from16 v2, p1

    invoke-static {v6, v2}, Landroid/opengl/GLES20;->glBindTexture(II)V

    .line 336
    const/16 v6, 0x303

    invoke-static {v5, v6}, Landroid/opengl/GLES20;->glBlendFunc(II)V

    .line 338
    const/4 v7, 0x0

    const/4 v8, 0x2

    const/16 v9, 0x1406

    const/4 v10, 0x0

    const/16 v11, 0x8

    iget-object v12, v0, Lim/tpelyyftgw/ui/components/paint/Painting;->vertexBuffer:Ljava/nio/ByteBuffer;

    invoke-static/range {v7 .. v12}, Landroid/opengl/GLES20;->glVertexAttribPointer(IIIZILjava/nio/Buffer;)V

    .line 339
    invoke-static {v4}, Landroid/opengl/GLES20;->glEnableVertexAttribArray(I)V

    .line 340
    const/4 v13, 0x1

    const/4 v14, 0x2

    const/16 v15, 0x1406

    const/16 v16, 0x0

    const/16 v17, 0x8

    iget-object v6, v0, Lim/tpelyyftgw/ui/components/paint/Painting;->textureBuffer:Ljava/nio/ByteBuffer;

    move-object/from16 v18, v6

    invoke-static/range {v13 .. v18}, Landroid/opengl/GLES20;->glVertexAttribPointer(IIIZILjava/nio/Buffer;)V

    .line 341
    invoke-static {v5}, Landroid/opengl/GLES20;->glEnableVertexAttribArray(I)V

    .line 343
    const/4 v5, 0x5

    const/4 v6, 0x4

    invoke-static {v5, v4, v6}, Landroid/opengl/GLES20;->glDrawArrays(III)V

    .line 345
    invoke-static {}, Lim/tpelyyftgw/ui/components/paint/Utils;->HasGLError()V

    .line 346
    return-void
.end method

.method private renderBlit()V
    .registers 19

    .line 349
    move-object/from16 v0, p0

    iget-object v1, v0, Lim/tpelyyftgw/ui/components/paint/Painting;->shaders:Ljava/util/Map;

    const-string v2, "blit"

    invoke-interface {v1, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lim/tpelyyftgw/ui/components/paint/Shader;

    .line 350
    .local v1, "shader":Lim/tpelyyftgw/ui/components/paint/Shader;
    if-nez v1, :cond_f

    .line 351
    return-void

    .line 354
    :cond_f
    iget v2, v1, Lim/tpelyyftgw/ui/components/paint/Shader;->program:I

    invoke-static {v2}, Landroid/opengl/GLES20;->glUseProgram(I)V

    .line 356
    const-string v2, "mvpMatrix"

    invoke-virtual {v1, v2}, Lim/tpelyyftgw/ui/components/paint/Shader;->getUniform(Ljava/lang/String;)I

    move-result v2

    iget-object v3, v0, Lim/tpelyyftgw/ui/components/paint/Painting;->renderProjection:[F

    invoke-static {v3}, Ljava/nio/FloatBuffer;->wrap([F)Ljava/nio/FloatBuffer;

    move-result-object v3

    const/4 v4, 0x1

    const/4 v5, 0x0

    invoke-static {v2, v4, v5, v3}, Landroid/opengl/GLES20;->glUniformMatrix4fv(IIZLjava/nio/FloatBuffer;)V

    .line 357
    const-string v2, "texture"

    invoke-virtual {v1, v2}, Lim/tpelyyftgw/ui/components/paint/Shader;->getUniform(Ljava/lang/String;)I

    move-result v2

    invoke-static {v2, v5}, Landroid/opengl/GLES20;->glUniform1i(II)V

    .line 359
    const v2, 0x84c0

    invoke-static {v2}, Landroid/opengl/GLES20;->glActiveTexture(I)V

    .line 360
    const/16 v2, 0xde1

    invoke-direct/range {p0 .. p0}, Lim/tpelyyftgw/ui/components/paint/Painting;->getTexture()I

    move-result v3

    invoke-static {v2, v3}, Landroid/opengl/GLES20;->glBindTexture(II)V

    .line 362
    const/16 v2, 0x303

    invoke-static {v4, v2}, Landroid/opengl/GLES20;->glBlendFunc(II)V

    .line 364
    const/4 v6, 0x0

    const/4 v7, 0x2

    const/16 v8, 0x1406

    const/4 v9, 0x0

    const/16 v10, 0x8

    iget-object v11, v0, Lim/tpelyyftgw/ui/components/paint/Painting;->vertexBuffer:Ljava/nio/ByteBuffer;

    invoke-static/range {v6 .. v11}, Landroid/opengl/GLES20;->glVertexAttribPointer(IIIZILjava/nio/Buffer;)V

    .line 365
    invoke-static {v5}, Landroid/opengl/GLES20;->glEnableVertexAttribArray(I)V

    .line 366
    const/4 v12, 0x1

    const/4 v13, 0x2

    const/16 v14, 0x1406

    const/4 v15, 0x0

    const/16 v16, 0x8

    iget-object v2, v0, Lim/tpelyyftgw/ui/components/paint/Painting;->textureBuffer:Ljava/nio/ByteBuffer;

    move-object/from16 v17, v2

    invoke-static/range {v12 .. v17}, Landroid/opengl/GLES20;->glVertexAttribPointer(IIIZILjava/nio/Buffer;)V

    .line 367
    invoke-static {v4}, Landroid/opengl/GLES20;->glEnableVertexAttribArray(I)V

    .line 369
    const/4 v2, 0x5

    const/4 v3, 0x4

    invoke-static {v2, v5, v3}, Landroid/opengl/GLES20;->glDrawArrays(III)V

    .line 371
    invoke-static {}, Lim/tpelyyftgw/ui/components/paint/Utils;->HasGLError()V

    .line 372
    return-void
.end method

.method private restoreSlice(Lim/tpelyyftgw/ui/components/paint/Slice;)V
    .registers 4
    .param p1, "slice"    # Lim/tpelyyftgw/ui/components/paint/Slice;

    .line 285
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->renderView:Lim/tpelyyftgw/ui/components/paint/RenderView;

    new-instance v1, Lim/tpelyyftgw/ui/components/paint/Painting$4;

    invoke-direct {v1, p0, p1}, Lim/tpelyyftgw/ui/components/paint/Painting$4;-><init>(Lim/tpelyyftgw/ui/components/paint/Painting;Lim/tpelyyftgw/ui/components/paint/Slice;)V

    invoke-virtual {v0, v1}, Lim/tpelyyftgw/ui/components/paint/RenderView;->performInContext(Ljava/lang/Runnable;)V

    .line 299
    return-void
.end method

.method private update(Landroid/graphics/RectF;Ljava/lang/Runnable;)V
    .registers 8
    .param p1, "bounds"    # Landroid/graphics/RectF;
    .param p2, "action"    # Ljava/lang/Runnable;

    .line 137
    invoke-direct {p0}, Lim/tpelyyftgw/ui/components/paint/Painting;->getReusableFramebuffer()I

    move-result v0

    const v1, 0x8d40

    invoke-static {v1, v0}, Landroid/opengl/GLES20;->glBindFramebuffer(II)V

    .line 138
    invoke-direct {p0}, Lim/tpelyyftgw/ui/components/paint/Painting;->getTexture()I

    move-result v0

    const/4 v2, 0x0

    const v3, 0x8ce0

    const/16 v4, 0xde1

    invoke-static {v1, v3, v4, v0, v2}, Landroid/opengl/GLES20;->glFramebufferTexture2D(IIIII)V

    .line 140
    invoke-static {v1}, Landroid/opengl/GLES20;->glCheckFramebufferStatus(I)I

    move-result v0

    .line 141
    .local v0, "status":I
    const v3, 0x8cd5

    if-ne v0, v3, :cond_30

    .line 142
    iget-object v3, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->size:Lim/tpelyyftgw/ui/components/Size;

    iget v3, v3, Lim/tpelyyftgw/ui/components/Size;->width:F

    float-to-int v3, v3

    iget-object v4, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->size:Lim/tpelyyftgw/ui/components/Size;

    iget v4, v4, Lim/tpelyyftgw/ui/components/Size;->height:F

    float-to-int v4, v4

    invoke-static {v2, v2, v3, v4}, Landroid/opengl/GLES20;->glViewport(IIII)V

    .line 143
    invoke-interface {p2}, Ljava/lang/Runnable;->run()V

    .line 145
    :cond_30
    invoke-static {v1, v2}, Landroid/opengl/GLES20;->glBindFramebuffer(II)V

    .line 147
    invoke-direct {p0}, Lim/tpelyyftgw/ui/components/paint/Painting;->isSuppressingChanges()Z

    move-result v1

    if-nez v1, :cond_40

    iget-object v1, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->delegate:Lim/tpelyyftgw/ui/components/paint/Painting$PaintingDelegate;

    if-eqz v1, :cond_40

    .line 148
    invoke-interface {v1, p1}, Lim/tpelyyftgw/ui/components/paint/Painting$PaintingDelegate;->contentChanged(Landroid/graphics/RectF;)V

    .line 150
    :cond_40
    return-void
.end method


# virtual methods
.method public cleanResources(Z)V
    .registers 6
    .param p1, "recycle"    # Z

    .line 497
    iget v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->reusableFramebuffer:I

    const/4 v1, 0x1

    const/4 v2, 0x0

    if-eqz v0, :cond_f

    .line 498
    iget-object v3, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->buffers:[I

    aput v0, v3, v2

    .line 499
    invoke-static {v1, v3, v2}, Landroid/opengl/GLES20;->glDeleteFramebuffers(I[II)V

    .line 500
    iput v2, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->reusableFramebuffer:I

    .line 503
    :cond_f
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->bitmapTexture:Lim/tpelyyftgw/ui/components/paint/Texture;

    invoke-virtual {v0, p1}, Lim/tpelyyftgw/ui/components/paint/Texture;->cleanResources(Z)V

    .line 505
    iget v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->paintTexture:I

    if-eqz v0, :cond_21

    .line 506
    iget-object v3, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->buffers:[I

    aput v0, v3, v2

    .line 507
    invoke-static {v1, v3, v2}, Landroid/opengl/GLES20;->glDeleteTextures(I[II)V

    .line 508
    iput v2, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->paintTexture:I

    .line 511
    :cond_21
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->brushTexture:Lim/tpelyyftgw/ui/components/paint/Texture;

    const/4 v2, 0x0

    if-eqz v0, :cond_2b

    .line 512
    invoke-virtual {v0, v1}, Lim/tpelyyftgw/ui/components/paint/Texture;->cleanResources(Z)V

    .line 513
    iput-object v2, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->brushTexture:Lim/tpelyyftgw/ui/components/paint/Texture;

    .line 516
    :cond_2b
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->shaders:Ljava/util/Map;

    if-eqz v0, :cond_49

    .line 517
    invoke-interface {v0}, Ljava/util/Map;->values()Ljava/util/Collection;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_37
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_47

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lim/tpelyyftgw/ui/components/paint/Shader;

    .line 518
    .local v1, "shader":Lim/tpelyyftgw/ui/components/paint/Shader;
    invoke-virtual {v1}, Lim/tpelyyftgw/ui/components/paint/Shader;->cleanResources()V

    .line 519
    .end local v1    # "shader":Lim/tpelyyftgw/ui/components/paint/Shader;
    goto :goto_37

    .line 520
    :cond_47
    iput-object v2, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->shaders:Ljava/util/Map;

    .line 522
    :cond_49
    return-void
.end method

.method public commitStroke(I)V
    .registers 4
    .param p1, "color"    # I

    .line 214
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->renderView:Lim/tpelyyftgw/ui/components/paint/RenderView;

    new-instance v1, Lim/tpelyyftgw/ui/components/paint/Painting$2;

    invoke-direct {v1, p0, p1}, Lim/tpelyyftgw/ui/components/paint/Painting$2;-><init>(Lim/tpelyyftgw/ui/components/paint/Painting;I)V

    invoke-virtual {v0, v1}, Lim/tpelyyftgw/ui/components/paint/RenderView;->performInContext(Ljava/lang/Runnable;)V

    .line 260
    return-void
.end method

.method public getBounds()Landroid/graphics/RectF;
    .registers 5

    .line 113
    new-instance v0, Landroid/graphics/RectF;

    iget-object v1, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->size:Lim/tpelyyftgw/ui/components/Size;

    iget v1, v1, Lim/tpelyyftgw/ui/components/Size;->width:F

    iget-object v2, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->size:Lim/tpelyyftgw/ui/components/Size;

    iget v2, v2, Lim/tpelyyftgw/ui/components/Size;->height:F

    const/4 v3, 0x0

    invoke-direct {v0, v3, v3, v1, v2}, Landroid/graphics/RectF;-><init>(FFFF)V

    return-object v0
.end method

.method public getPaintingData(Landroid/graphics/RectF;Z)Lim/tpelyyftgw/ui/components/paint/Painting$PaintingData;
    .registers 34
    .param p1, "rect"    # Landroid/graphics/RectF;
    .param p2, "undo"    # Z

    .line 375
    move-object/from16 v0, p0

    move-object/from16 v1, p1

    iget v2, v1, Landroid/graphics/RectF;->left:F

    float-to-int v2, v2

    .line 376
    .local v2, "minX":I
    iget v3, v1, Landroid/graphics/RectF;->top:F

    float-to-int v3, v3

    .line 377
    .local v3, "minY":I
    invoke-virtual/range {p1 .. p1}, Landroid/graphics/RectF;->width()F

    move-result v4

    float-to-int v4, v4

    .line 378
    .local v4, "width":I
    invoke-virtual/range {p1 .. p1}, Landroid/graphics/RectF;->height()F

    move-result v5

    float-to-int v14, v5

    .line 380
    .local v14, "height":I
    iget-object v5, v0, Lim/tpelyyftgw/ui/components/paint/Painting;->buffers:[I

    const/4 v15, 0x1

    const/4 v13, 0x0

    invoke-static {v15, v5, v13}, Landroid/opengl/GLES20;->glGenFramebuffers(I[II)V

    .line 381
    iget-object v5, v0, Lim/tpelyyftgw/ui/components/paint/Painting;->buffers:[I

    aget v12, v5, v13

    .line 382
    .local v12, "framebuffer":I
    const v11, 0x8d40

    invoke-static {v11, v12}, Landroid/opengl/GLES20;->glBindFramebuffer(II)V

    .line 384
    iget-object v5, v0, Lim/tpelyyftgw/ui/components/paint/Painting;->buffers:[I

    invoke-static {v15, v5, v13}, Landroid/opengl/GLES20;->glGenTextures(I[II)V

    .line 385
    iget-object v5, v0, Lim/tpelyyftgw/ui/components/paint/Painting;->buffers:[I

    aget v10, v5, v13

    .line 387
    .local v10, "texture":I
    const/16 v9, 0xde1

    invoke-static {v9, v10}, Landroid/opengl/GLES20;->glBindTexture(II)V

    .line 388
    const/16 v5, 0x2601

    const/16 v6, 0x2801

    invoke-static {v9, v6, v5}, Landroid/opengl/GLES20;->glTexParameteri(III)V

    .line 389
    const/16 v6, 0x2800

    invoke-static {v9, v6, v5}, Landroid/opengl/GLES20;->glTexParameteri(III)V

    .line 390
    const v5, 0x812f

    const/16 v6, 0x2802

    invoke-static {v9, v6, v5}, Landroid/opengl/GLES20;->glTexParameteri(III)V

    .line 391
    const/16 v6, 0x2803

    invoke-static {v9, v6, v5}, Landroid/opengl/GLES20;->glTexParameteri(III)V

    .line 392
    const/16 v5, 0xde1

    const/4 v6, 0x0

    const/16 v7, 0x1908

    const/16 v16, 0x0

    const/16 v17, 0x1908

    const/16 v18, 0x1401

    const/16 v19, 0x0

    move v8, v4

    const/16 v15, 0xde1

    move v9, v14

    move v15, v10

    .end local v10    # "texture":I
    .local v15, "texture":I
    move/from16 v10, v16

    move/from16 v11, v17

    move/from16 v16, v12

    .end local v12    # "framebuffer":I
    .local v16, "framebuffer":I
    move/from16 v12, v18

    const/4 v1, 0x0

    move-object/from16 v13, v19

    invoke-static/range {v5 .. v13}, Landroid/opengl/GLES20;->glTexImage2D(IIIIIIIILjava/nio/Buffer;)V

    .line 394
    const v5, 0x8ce0

    const v6, 0x8d40

    const/16 v7, 0xde1

    invoke-static {v6, v5, v7, v15, v1}, Landroid/opengl/GLES20;->glFramebufferTexture2D(IIIII)V

    .line 396
    iget-object v5, v0, Lim/tpelyyftgw/ui/components/paint/Painting;->size:Lim/tpelyyftgw/ui/components/Size;

    iget v5, v5, Lim/tpelyyftgw/ui/components/Size;->width:F

    float-to-int v5, v5

    iget-object v6, v0, Lim/tpelyyftgw/ui/components/paint/Painting;->size:Lim/tpelyyftgw/ui/components/Size;

    iget v6, v6, Lim/tpelyyftgw/ui/components/Size;->height:F

    float-to-int v6, v6

    invoke-static {v1, v1, v5, v6}, Landroid/opengl/GLES20;->glViewport(IIII)V

    .line 398
    iget-object v5, v0, Lim/tpelyyftgw/ui/components/paint/Painting;->shaders:Ljava/util/Map;

    const/4 v12, 0x0

    if-nez v5, :cond_8a

    .line 399
    return-object v12

    .line 401
    :cond_8a
    if-eqz p2, :cond_8f

    const-string v6, "nonPremultipliedBlit"

    goto :goto_91

    :cond_8f
    const-string v6, "blit"

    :goto_91
    invoke-interface {v5, v6}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v5

    move-object v13, v5

    check-cast v13, Lim/tpelyyftgw/ui/components/paint/Shader;

    .line 402
    .local v13, "shader":Lim/tpelyyftgw/ui/components/paint/Shader;
    if-nez v13, :cond_9b

    .line 403
    return-object v12

    .line 405
    :cond_9b
    iget v5, v13, Lim/tpelyyftgw/ui/components/paint/Shader;->program:I

    invoke-static {v5}, Landroid/opengl/GLES20;->glUseProgram(I)V

    .line 407
    new-instance v5, Landroid/graphics/Matrix;

    invoke-direct {v5}, Landroid/graphics/Matrix;-><init>()V

    move-object v11, v5

    .line 408
    .local v11, "translate":Landroid/graphics/Matrix;
    neg-int v5, v2

    int-to-float v5, v5

    neg-int v6, v3

    int-to-float v6, v6

    invoke-virtual {v11, v5, v6}, Landroid/graphics/Matrix;->preTranslate(FF)Z

    .line 409
    invoke-static {v11}, Lim/tpelyyftgw/ui/components/paint/GLMatrix;->LoadGraphicsMatrix(Landroid/graphics/Matrix;)[F

    move-result-object v10

    .line 410
    .local v10, "effective":[F
    iget-object v5, v0, Lim/tpelyyftgw/ui/components/paint/Painting;->projection:[F

    invoke-static {v5, v10}, Lim/tpelyyftgw/ui/components/paint/GLMatrix;->MultiplyMat4f([F[F)[F

    move-result-object v17

    .line 412
    .local v17, "finalProjection":[F
    const-string v5, "mvpMatrix"

    invoke-virtual {v13, v5}, Lim/tpelyyftgw/ui/components/paint/Shader;->getUniform(Ljava/lang/String;)I

    move-result v5

    invoke-static/range {v17 .. v17}, Ljava/nio/FloatBuffer;->wrap([F)Ljava/nio/FloatBuffer;

    move-result-object v6

    const/4 v7, 0x1

    invoke-static {v5, v7, v1, v6}, Landroid/opengl/GLES20;->glUniformMatrix4fv(IIZLjava/nio/FloatBuffer;)V

    .line 414
    const-string v5, "texture"

    const v6, 0x84c0

    if-eqz p2, :cond_e0

    .line 415
    invoke-virtual {v13, v5}, Lim/tpelyyftgw/ui/components/paint/Shader;->getUniform(Ljava/lang/String;)I

    move-result v5

    invoke-static {v5, v1}, Landroid/opengl/GLES20;->glUniform1i(II)V

    .line 417
    invoke-static {v6}, Landroid/opengl/GLES20;->glActiveTexture(I)V

    .line 418
    invoke-direct/range {p0 .. p0}, Lim/tpelyyftgw/ui/components/paint/Painting;->getTexture()I

    move-result v5

    const/16 v7, 0xde1

    invoke-static {v7, v5}, Landroid/opengl/GLES20;->glBindTexture(II)V

    goto :goto_ff

    .line 420
    :cond_e0
    const/16 v7, 0xde1

    invoke-virtual {v13, v5}, Lim/tpelyyftgw/ui/components/paint/Shader;->getUniform(Ljava/lang/String;)I

    move-result v5

    invoke-static {v5, v1}, Landroid/opengl/GLES20;->glUniform1i(II)V

    .line 422
    invoke-static {v6}, Landroid/opengl/GLES20;->glActiveTexture(I)V

    .line 423
    iget-object v5, v0, Lim/tpelyyftgw/ui/components/paint/Painting;->bitmapTexture:Lim/tpelyyftgw/ui/components/paint/Texture;

    invoke-virtual {v5}, Lim/tpelyyftgw/ui/components/paint/Texture;->texture()I

    move-result v5

    invoke-static {v7, v5}, Landroid/opengl/GLES20;->glBindTexture(II)V

    .line 425
    invoke-static {v6}, Landroid/opengl/GLES20;->glActiveTexture(I)V

    .line 426
    invoke-direct/range {p0 .. p0}, Lim/tpelyyftgw/ui/components/paint/Painting;->getTexture()I

    move-result v5

    invoke-static {v7, v5}, Landroid/opengl/GLES20;->glBindTexture(II)V

    .line 428
    :goto_ff
    const/4 v5, 0x0

    invoke-static {v5, v5, v5, v5}, Landroid/opengl/GLES20;->glClearColor(FFFF)V

    .line 429
    const/16 v5, 0x4000

    invoke-static {v5}, Landroid/opengl/GLES20;->glClear(I)V

    .line 431
    const/16 v5, 0x303

    const/4 v6, 0x1

    invoke-static {v6, v5}, Landroid/opengl/GLES20;->glBlendFunc(II)V

    .line 433
    const/16 v20, 0x0

    const/16 v21, 0x2

    const/16 v22, 0x1406

    const/16 v23, 0x0

    const/16 v24, 0x8

    iget-object v5, v0, Lim/tpelyyftgw/ui/components/paint/Painting;->vertexBuffer:Ljava/nio/ByteBuffer;

    move-object/from16 v25, v5

    invoke-static/range {v20 .. v25}, Landroid/opengl/GLES20;->glVertexAttribPointer(IIIZILjava/nio/Buffer;)V

    .line 434
    invoke-static {v1}, Landroid/opengl/GLES20;->glEnableVertexAttribArray(I)V

    .line 435
    const/16 v25, 0x1

    const/16 v26, 0x2

    const/16 v27, 0x1406

    const/16 v28, 0x0

    const/16 v29, 0x8

    iget-object v5, v0, Lim/tpelyyftgw/ui/components/paint/Painting;->textureBuffer:Ljava/nio/ByteBuffer;

    move-object/from16 v30, v5

    invoke-static/range {v25 .. v30}, Landroid/opengl/GLES20;->glVertexAttribPointer(IIIZILjava/nio/Buffer;)V

    .line 436
    const/4 v5, 0x1

    invoke-static {v5}, Landroid/opengl/GLES20;->glEnableVertexAttribArray(I)V

    .line 438
    const/4 v5, 0x5

    const/4 v6, 0x4

    invoke-static {v5, v1, v6}, Landroid/opengl/GLES20;->glDrawArrays(III)V

    .line 440
    iget-object v5, v0, Lim/tpelyyftgw/ui/components/paint/Painting;->dataBuffer:Ljava/nio/ByteBuffer;

    mul-int v7, v4, v14

    mul-int/lit8 v7, v7, 0x4

    invoke-virtual {v5, v7}, Ljava/nio/ByteBuffer;->limit(I)Ljava/nio/Buffer;

    .line 441
    const/4 v5, 0x0

    const/4 v6, 0x0

    const/16 v9, 0x1908

    const/16 v18, 0x1401

    iget-object v8, v0, Lim/tpelyyftgw/ui/components/paint/Painting;->dataBuffer:Ljava/nio/ByteBuffer;

    move v7, v4

    move-object/from16 v19, v8

    move v8, v14

    move-object/from16 v20, v10

    .end local v10    # "effective":[F
    .local v20, "effective":[F
    move/from16 v10, v18

    move-object/from16 v18, v11

    .end local v11    # "translate":Landroid/graphics/Matrix;
    .local v18, "translate":Landroid/graphics/Matrix;
    move-object/from16 v11, v19

    invoke-static/range {v5 .. v11}, Landroid/opengl/GLES20;->glReadPixels(IIIIIILjava/nio/Buffer;)V

    .line 444
    if-eqz p2, :cond_166

    .line 445
    new-instance v5, Lim/tpelyyftgw/ui/components/paint/Painting$PaintingData;

    iget-object v6, v0, Lim/tpelyyftgw/ui/components/paint/Painting;->dataBuffer:Ljava/nio/ByteBuffer;

    invoke-direct {v5, v0, v12, v6}, Lim/tpelyyftgw/ui/components/paint/Painting$PaintingData;-><init>(Lim/tpelyyftgw/ui/components/paint/Painting;Landroid/graphics/Bitmap;Ljava/nio/ByteBuffer;)V

    .local v5, "data":Lim/tpelyyftgw/ui/components/paint/Painting$PaintingData;
    goto :goto_177

    .line 447
    .end local v5    # "data":Lim/tpelyyftgw/ui/components/paint/Painting$PaintingData;
    :cond_166
    sget-object v5, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;

    invoke-static {v4, v14, v5}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;

    move-result-object v5

    .line 448
    .local v5, "bitmap":Landroid/graphics/Bitmap;
    iget-object v6, v0, Lim/tpelyyftgw/ui/components/paint/Painting;->dataBuffer:Ljava/nio/ByteBuffer;

    invoke-virtual {v5, v6}, Landroid/graphics/Bitmap;->copyPixelsFromBuffer(Ljava/nio/Buffer;)V

    .line 450
    new-instance v6, Lim/tpelyyftgw/ui/components/paint/Painting$PaintingData;

    invoke-direct {v6, v0, v5, v12}, Lim/tpelyyftgw/ui/components/paint/Painting$PaintingData;-><init>(Lim/tpelyyftgw/ui/components/paint/Painting;Landroid/graphics/Bitmap;Ljava/nio/ByteBuffer;)V

    move-object v5, v6

    .line 453
    .local v5, "data":Lim/tpelyyftgw/ui/components/paint/Painting$PaintingData;
    :goto_177
    iget-object v6, v0, Lim/tpelyyftgw/ui/components/paint/Painting;->buffers:[I

    aput v16, v6, v1

    .line 454
    const/4 v7, 0x1

    invoke-static {v7, v6, v1}, Landroid/opengl/GLES20;->glDeleteFramebuffers(I[II)V

    .line 456
    iget-object v6, v0, Lim/tpelyyftgw/ui/components/paint/Painting;->buffers:[I

    aput v15, v6, v1

    .line 457
    invoke-static {v7, v6, v1}, Landroid/opengl/GLES20;->glDeleteTextures(I[II)V

    .line 459
    return-object v5
.end method

.method public getSize()Lim/tpelyyftgw/ui/components/Size;
    .registers 2

    .line 109
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->size:Lim/tpelyyftgw/ui/components/Size;

    return-object v0
.end method

.method public isPaused()Z
    .registers 2

    .line 471
    iget-boolean v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->paused:Z

    return v0
.end method

.method public onPause(Ljava/lang/Runnable;)V
    .registers 4
    .param p1, "completionRunnable"    # Ljava/lang/Runnable;

    .line 475
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->renderView:Lim/tpelyyftgw/ui/components/paint/RenderView;

    new-instance v1, Lim/tpelyyftgw/ui/components/paint/Painting$5;

    invoke-direct {v1, p0, p1}, Lim/tpelyyftgw/ui/components/paint/Painting$5;-><init>(Lim/tpelyyftgw/ui/components/paint/Painting;Ljava/lang/Runnable;)V

    invoke-virtual {v0, v1}, Lim/tpelyyftgw/ui/components/paint/RenderView;->performInContext(Ljava/lang/Runnable;)V

    .line 488
    return-void
.end method

.method public onResume()V
    .registers 2

    .line 491
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->backupSlice:Lim/tpelyyftgw/ui/components/paint/Slice;

    invoke-direct {p0, v0}, Lim/tpelyyftgw/ui/components/paint/Painting;->restoreSlice(Lim/tpelyyftgw/ui/components/paint/Slice;)V

    .line 492
    const/4 v0, 0x0

    iput-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->backupSlice:Lim/tpelyyftgw/ui/components/paint/Slice;

    .line 493
    const/4 v0, 0x0

    iput-boolean v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->paused:Z

    .line 494
    return-void
.end method

.method public paintStroke(Lim/tpelyyftgw/ui/components/paint/Path;ZLjava/lang/Runnable;)V
    .registers 6
    .param p1, "path"    # Lim/tpelyyftgw/ui/components/paint/Path;
    .param p2, "clearBuffer"    # Z
    .param p3, "action"    # Ljava/lang/Runnable;

    .line 153
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->renderView:Lim/tpelyyftgw/ui/components/paint/RenderView;

    new-instance v1, Lim/tpelyyftgw/ui/components/paint/Painting$1;

    invoke-direct {v1, p0, p1, p2, p3}, Lim/tpelyyftgw/ui/components/paint/Painting$1;-><init>(Lim/tpelyyftgw/ui/components/paint/Painting;Lim/tpelyyftgw/ui/components/paint/Path;ZLjava/lang/Runnable;)V

    invoke-virtual {v0, v1}, Lim/tpelyyftgw/ui/components/paint/RenderView;->performInContext(Ljava/lang/Runnable;)V

    .line 211
    return-void
.end method

.method public render()V
    .registers 3

    .line 306
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->shaders:Ljava/util/Map;

    if-nez v0, :cond_5

    .line 307
    return-void

    .line 310
    :cond_5
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->activePath:Lim/tpelyyftgw/ui/components/paint/Path;

    if-eqz v0, :cond_17

    .line 311
    invoke-direct {p0}, Lim/tpelyyftgw/ui/components/paint/Painting;->getPaintTexture()I

    move-result v0

    iget-object v1, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->activePath:Lim/tpelyyftgw/ui/components/paint/Path;

    invoke-virtual {v1}, Lim/tpelyyftgw/ui/components/paint/Path;->getColor()I

    move-result v1

    invoke-direct {p0, v0, v1}, Lim/tpelyyftgw/ui/components/paint/Painting;->render(II)V

    goto :goto_1a

    .line 313
    :cond_17
    invoke-direct {p0}, Lim/tpelyyftgw/ui/components/paint/Painting;->renderBlit()V

    .line 315
    :goto_1a
    return-void
.end method

.method public setBitmap(Landroid/graphics/Bitmap;)V
    .registers 3
    .param p1, "bitmap"    # Landroid/graphics/Bitmap;

    .line 129
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->bitmapTexture:Lim/tpelyyftgw/ui/components/paint/Texture;

    if-eqz v0, :cond_5

    .line 130
    return-void

    .line 133
    :cond_5
    new-instance v0, Lim/tpelyyftgw/ui/components/paint/Texture;

    invoke-direct {v0, p1}, Lim/tpelyyftgw/ui/components/paint/Texture;-><init>(Landroid/graphics/Bitmap;)V

    iput-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->bitmapTexture:Lim/tpelyyftgw/ui/components/paint/Texture;

    .line 134
    return-void
.end method

.method public setBrush(Lim/tpelyyftgw/ui/components/paint/Brush;)V
    .registers 4
    .param p1, "value"    # Lim/tpelyyftgw/ui/components/paint/Brush;

    .line 463
    iput-object p1, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->brush:Lim/tpelyyftgw/ui/components/paint/Brush;

    .line 464
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->brushTexture:Lim/tpelyyftgw/ui/components/paint/Texture;

    if-eqz v0, :cond_d

    .line 465
    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Lim/tpelyyftgw/ui/components/paint/Texture;->cleanResources(Z)V

    .line 466
    const/4 v0, 0x0

    iput-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->brushTexture:Lim/tpelyyftgw/ui/components/paint/Texture;

    .line 468
    :cond_d
    return-void
.end method

.method public setDelegate(Lim/tpelyyftgw/ui/components/paint/Painting$PaintingDelegate;)V
    .registers 2
    .param p1, "paintingDelegate"    # Lim/tpelyyftgw/ui/components/paint/Painting$PaintingDelegate;

    .line 101
    iput-object p1, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->delegate:Lim/tpelyyftgw/ui/components/paint/Painting$PaintingDelegate;

    .line 102
    return-void
.end method

.method public setRenderProjection([F)V
    .registers 2
    .param p1, "proj"    # [F

    .line 302
    iput-object p1, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->renderProjection:[F

    .line 303
    return-void
.end method

.method public setRenderView(Lim/tpelyyftgw/ui/components/paint/RenderView;)V
    .registers 2
    .param p1, "view"    # Lim/tpelyyftgw/ui/components/paint/RenderView;

    .line 105
    iput-object p1, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->renderView:Lim/tpelyyftgw/ui/components/paint/RenderView;

    .line 106
    return-void
.end method

.method public setupShaders()V
    .registers 2

    .line 550
    invoke-static {}, Lim/tpelyyftgw/ui/components/paint/ShaderSet;->setup()Ljava/util/Map;

    move-result-object v0

    iput-object v0, p0, Lim/tpelyyftgw/ui/components/paint/Painting;->shaders:Ljava/util/Map;

    .line 551
    return-void
.end method