d.smali

.class final Lcom/tencent/liteav/beauty/b/a/d;
.super Lcom/tencent/liteav/videobase/a/b;
.source "SourceFile"


# instance fields
.field private final a:Z

.field private b:I

.field private c:I


# direct methods
.method public constructor <init>(Z)V
    .registers 4

    const-string v0, " attribute vec4 position;\n attribute vec4 inputTextureCoordinate;\n \n uniform float texelWidthOffset;\n uniform float texelHeightOffset;\n \n varying vec2 textureCoordinate;\n varying vec4 textureShift_1;\n varying vec4 textureShift_2;\n varying vec4 textureShift_3;\n varying vec4 textureShift_4;\n \n void main(void)\n {\n     gl_Position = position;\n     textureCoordinate = inputTextureCoordinate.xy;\n     \n     vec2 singleStepOffset = vec2(texelWidthOffset, texelHeightOffset);\n     textureShift_1 = vec4(textureCoordinate - singleStepOffset,                           textureCoordinate + singleStepOffset);\n     textureShift_2 = vec4(textureCoordinate - 2.0 * singleStepOffset,                           textureCoordinate + 2.0 * singleStepOffset);\n     textureShift_3 = vec4(textureCoordinate - 3.0 * singleStepOffset,                           textureCoordinate + 3.0 * singleStepOffset);\n     textureShift_4 = vec4(textureCoordinate - 4.0 * singleStepOffset,                           textureCoordinate + 4.0 * singleStepOffset);\n }\n"

    const-string v1, "uniform sampler2D inputImageTexture;\n varying highp vec2 textureCoordinate;\n varying highp vec4 textureShift_1;\n varying highp vec4 textureShift_2;\n varying highp vec4 textureShift_3;\n varying highp vec4 textureShift_4;\n \n void main()\n {\n     mediump vec3 sum = texture2D(inputImageTexture, textureCoordinate).rgb;\n     sum += texture2D(inputImageTexture, textureShift_1.xy).rgb;\n     sum += texture2D(inputImageTexture, textureShift_1.zw).rgb;\n     sum += texture2D(inputImageTexture, textureShift_2.xy).rgb;\n     sum += texture2D(inputImageTexture, textureShift_2.zw).rgb;\n     sum += texture2D(inputImageTexture, textureShift_3.xy).rgb;\n     sum += texture2D(inputImageTexture, textureShift_3.zw).rgb;\n     sum += texture2D(inputImageTexture, textureShift_4.xy).rgb;\n     sum += texture2D(inputImageTexture, textureShift_4.zw).rgb;\n     \n     gl_FragColor = vec4(sum * 0.1111, 1.0);\n }\n"

    .line 69
    invoke-direct {p0, v0, v1}, Lcom/tencent/liteav/videobase/a/b;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    const/4 v0, -0x1

    .line 65
    iput v0, p0, Lcom/tencent/liteav/beauty/b/a/d;->b:I

    .line 66
    iput v0, p0, Lcom/tencent/liteav/beauty/b/a/d;->c:I

    .line 70
    iput-boolean p1, p0, Lcom/tencent/liteav/beauty/b/a/d;->a:Z

    return-void
.end method


# virtual methods
.method public final onInit(Lcom/tencent/liteav/videobase/frame/e;)V
    .registers 3

    .line 75
    invoke-super {p0, p1}, Lcom/tencent/liteav/videobase/a/b;->onInit(Lcom/tencent/liteav/videobase/frame/e;)V

    .line 76
    invoke-virtual {p0}, Lcom/tencent/liteav/beauty/b/a/d;->getProgramId()I

    move-result p1

    const-string v0, "texelWidthOffset"

    invoke-static {p1, v0}, Landroid/opengl/GLES20;->glGetUniformLocation(ILjava/lang/String;)I

    move-result p1

    iput p1, p0, Lcom/tencent/liteav/beauty/b/a/d;->b:I

    .line 78
    invoke-virtual {p0}, Lcom/tencent/liteav/beauty/b/a/d;->getProgramId()I

    move-result p1

    const-string v0, "texelHeightOffset"

    invoke-static {p1, v0}, Landroid/opengl/GLES20;->glGetUniformLocation(ILjava/lang/String;)I

    move-result p1

    iput p1, p0, Lcom/tencent/liteav/beauty/b/a/d;->c:I

    return-void
.end method

.method public final onOutputSizeChanged(II)V
    .registers 6

    .line 83
    invoke-static {p1, p2}, Ljava/lang/Math;->min(II)I

    move-result v0

    int-to-float v0, v0

    const/high16 v1, 0x43b40000    # 360.0f

    div-float/2addr v1, v0

    const/high16 v0, 0x3f800000    # 1.0f

    .line 84
    invoke-static {v0, v1}, Ljava/lang/Math;->min(FF)F

    move-result v0

    int-to-float p1, p1

    mul-float/2addr p1, v0

    .line 85
    invoke-static {p1}, Ljava/lang/Math;->round(F)I

    move-result p1

    int-to-float p2, p2

    mul-float/2addr p2, v0

    .line 86
    invoke-static {p2}, Ljava/lang/Math;->round(F)I

    move-result p2

    .line 87
    invoke-super {p0, p1, p2}, Lcom/tencent/liteav/videobase/a/b;->onOutputSizeChanged(II)V

    .line 88
    iget-boolean v0, p0, Lcom/tencent/liteav/beauty/b/a/d;->a:Z

    const/4 v1, 0x0

    const/high16 v2, 0x3fc00000    # 1.5f

    if-eqz v0, :cond_31

    .line 89
    iget p1, p0, Lcom/tencent/liteav/beauty/b/a/d;->b:I

    invoke-virtual {p0, p1, v1}, Lcom/tencent/liteav/beauty/b/a/d;->setFloatOnDraw(IF)V

    .line 90
    iget p1, p0, Lcom/tencent/liteav/beauty/b/a/d;->c:I

    int-to-float p2, p2

    div-float/2addr v2, p2

    invoke-virtual {p0, p1, v2}, Lcom/tencent/liteav/beauty/b/a/d;->setFloatOnDraw(IF)V

    return-void

    .line 92
    :cond_31
    iget p2, p0, Lcom/tencent/liteav/beauty/b/a/d;->b:I

    int-to-float p1, p1

    div-float/2addr v2, p1

    invoke-virtual {p0, p2, v2}, Lcom/tencent/liteav/beauty/b/a/d;->setFloatOnDraw(IF)V

    .line 93
    iget p1, p0, Lcom/tencent/liteav/beauty/b/a/d;->c:I

    invoke-virtual {p0, p1, v1}, Lcom/tencent/liteav/beauty/b/a/d;->setFloatOnDraw(IF)V

    return-void
.end method