WeChat.apk(点击下载) / a.java


package l71;

import android.opengl.GLES20;
import com.tencent.mm.sdk.platformtools.Log;
import java.nio.Buffer;
import lh4.h;
import m71.b;
import ra0.c;
import ya0.d;

public final class a extends wa0.a {
    public int B;
    public int C;
    public int D;
    public int E;
    public int F;
    public int G;
    public int H;
    public c I;

    /* JADX WARNING: Illegal instructions before constructor call */
    public a(int i15, int i16, int i17, int i18, int i19, int i25, int i26, h hVar) {
        super(i15, i16, r3, r4, r5, r6);
        int i27;
        int i28;
        int i29;
        int i35;
        if ((i26 & 4) != 0) {
            i27 = i15;
        } else {
            i27 = i17;
        }
        if ((i26 & 8) != 0) {
            i28 = i16;
        } else {
            i28 = i18;
        }
        if ((i26 & 16) != 0) {
            i29 = 1;
        } else {
            i29 = i19;
        }
        if ((i26 & 32) != 0) {
            i35 = 1;
        } else {
            i35 = i25;
        }
        int p15 = d.f344535a.p("\n        attribute vec4 a_position;\n        attribute vec2 a_texCoord;\n        varying vec2 v_texCoord;\n        uniform mat4 uMatrix;\n        void main() {\n            gl_Position = uMatrix * a_position;\n            v_texCoord = a_texCoord;\n        }\n        ", "\n        #ifdef GL_ES\n        precision highp float;\n        #endif\n\n        varying vec2 v_texCoord;\n        uniform sampler2D y_texture;\n        uniform sampler2D u_texture;\n        uniform sampler2D v_texture;\n\n        void main () {\n           float r, g, b, y, u, v;\n\n        //We had put the Y values of each pixel to the R,G,B components by GL_LUMINANCE,\n        //that's why we're pulling it from the R component, we could also use G or B\n           y = texture2D(y_texture, v_texCoord).r;\n\n        //We had put the U and V values of each pixel to the A and R,G,B components of the\n        //texture respectively using GL_LUMINANCE_ALPHA. Since U,V bytes are interspread\n        //in the texture, this is probably the fastest way to use them in the shader\n        //GL_LUMINANCE_ALPHA is a luminance/alpha pair, so r correspond to v, and\n        //a correspond to u\n        //NV21 is a VUVU pair\n           v = texture2D(v_texture, v_texCoord).r;\n           u = texture2D(u_texture, v_texCoord).r;\n           u = u - 0.5;\n           v = v - 0.5;\n\n        //The numbers are just YUV to RGB conversion constants\n        //https://en.wikipedia.org/wiki/YUV#Y.E2.80.B2UV420sp_.28NV21.29_to_RGB_conversion_.28Android.29\n           r = y + 1.370705 * v;\n           g = y - 0.337633 * u - 0.698001 * v;\n           b = y + 1.732446 * u;\n\n        //We finally set the RGB color of our pixel\n           gl_FragColor = vec4(r, g, b, 1.0);\n        }\n        ");
        this.B = p15;
        if (p15 == 0) {
            Log.e("MicroMsg.MTR.GLRenderProcI420ToRgb", "checkInit, load program failed!");
        }
        this.D = GLES20.glGetAttribLocation(this.B, "a_position");
        this.C = GLES20.glGetAttribLocation(this.B, "a_texCoord");
        this.E = GLES20.glGetUniformLocation(this.B, "y_texture");
        this.F = GLES20.glGetUniformLocation(this.B, "u_texture");
        this.G = GLES20.glGetUniformLocation(this.B, "v_texture");
        this.H = GLES20.glGetUniformLocation(this.B, "uMatrix");
    }

    @Override // wa0.a
    public void f() {
        super.f();
        GLES20.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
    }

    @Override // wa0.a
    public void n() {
        super.n();
        GLES20.glDeleteProgram(this.B);
    }

    /* JADX WARNING: Removed duplicated region for block: B:15:0x0039  */
    /* JADX WARNING: Removed duplicated region for block: B:18:0x004d  */
    /* JADX WARNING: Removed duplicated region for block: B:23:0x0059  */
    /* JADX WARNING: Removed duplicated region for block: B:26:0x006d  */
    /* JADX WARNING: Removed duplicated region for block: B:31:0x0079  */
    @Override // wa0.a
    public void p() {
        c cVar;
        b.c cVar2;
        c cVar3;
        b.c cVar4;
        c cVar5;
        GLES20.glClear(16640);
        GLES20.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
        int i15 = this.B;
        if (i15 != 0 && this.f331738c > 0 && this.f331739d > 0) {
            GLES20.glUseProgram(i15);
            c cVar6 = this.I;
            if (cVar6 != null) {
                GLES20.glActiveTexture(33984);
                b.c cVar7 = cVar6.f250999c;
                if (cVar7.f258340d) {
                    b.C3954b bVar = cVar7.f258337a;
                    if (bVar.f258335b) {
                        cVar = bVar.f258334a;
                        if (cVar != null) {
                            cVar.d();
                        }
                        GLES20.glUniform1i(this.E, 0);
                        GLES20.glActiveTexture(33985);
                        cVar2 = cVar6.f250999c;
                        if (cVar2.f258340d) {
                            b.C3954b bVar2 = cVar2.f258338b;
                            if (bVar2.f258335b) {
                                cVar3 = bVar2.f258334a;
                                if (cVar3 != null) {
                                    cVar3.d();
                                }
                                GLES20.glUniform1i(this.F, 1);
                                GLES20.glActiveTexture(33986);
                                cVar4 = cVar6.f250999c;
                                if (cVar4.f258340d) {
                                    b.C3954b bVar3 = cVar4.f258339c;
                                    if (bVar3.f258335b) {
                                        cVar5 = bVar3.f258334a;
                                        if (cVar5 != null) {
                                            cVar5.d();
                                        }
                                        GLES20.glUniform1i(this.G, 2);
                                    }
                                }
                                cVar5 = null;
                                if (cVar5 != null) {
                                }
                                GLES20.glUniform1i(this.G, 2);
                            }
                        }
                        cVar3 = null;
                        if (cVar3 != null) {
                        }
                        GLES20.glUniform1i(this.F, 1);
                        GLES20.glActiveTexture(33986);
                        cVar4 = cVar6.f250999c;
                        if (cVar4.f258340d) {
                        }
                        cVar5 = null;
                        if (cVar5 != null) {
                        }
                        GLES20.glUniform1i(this.G, 2);
                    }
                }
                cVar = null;
                if (cVar != null) {
                }
                GLES20.glUniform1i(this.E, 0);
                GLES20.glActiveTexture(33985);
                cVar2 = cVar6.f250999c;
                if (cVar2.f258340d) {
                }
                cVar3 = null;
                if (cVar3 != null) {
                }
                GLES20.glUniform1i(this.F, 1);
                GLES20.glActiveTexture(33986);
                cVar4 = cVar6.f250999c;
                if (cVar4.f258340d) {
                }
                cVar5 = null;
                if (cVar5 != null) {
                }
                GLES20.glUniform1i(this.G, 2);
            }
            GLES20.glUniformMatrix4fv(this.H, 1, false, this.f331747l, 0);
            this.f331743h.position(0);
            GLES20.glVertexAttribPointer(this.D, 2, 5126, false, 0, (Buffer) this.f331743h);
            GLES20.glEnableVertexAttribArray(this.D);
            this.f331742g.position(0);
            GLES20.glVertexAttribPointer(this.C, 2, 5126, false, 0, (Buffer) this.f331742g);
            GLES20.glEnableVertexAttribArray(this.C);
            GLES20.glDrawArrays(5, 0, 4);
            GLES20.glDisableVertexAttribArray(this.D);
            GLES20.glDisableVertexAttribArray(this.C);
            GLES20.glBindTexture(3553, 0);
        }
        this.I = null;
    }
}