616 lines
17 KiB
Smali
616 lines
17 KiB
Smali
.class public Lorg/webrtc/GlGenericDrawer;
|
|
.super Ljava/lang/Object;
|
|
.source "GlGenericDrawer.java"
|
|
|
|
# interfaces
|
|
.implements Lorg/webrtc/RendererCommon$GlDrawer;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lorg/webrtc/GlGenericDrawer$ShaderCallbacks;,
|
|
Lorg/webrtc/GlGenericDrawer$ShaderType;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final DEFAULT_VERTEX_SHADER_STRING:Ljava/lang/String; = "varying vec2 tc;\nattribute vec4 in_pos;\nattribute vec4 in_tc;\nuniform mat4 tex_mat;\nvoid main() {\n gl_Position = in_pos;\n tc = (tex_mat * in_tc).xy;\n}\n"
|
|
|
|
.field public static final FULL_RECTANGLE_BUFFER:Ljava/nio/FloatBuffer;
|
|
|
|
.field public static final FULL_RECTANGLE_TEXTURE_BUFFER:Ljava/nio/FloatBuffer;
|
|
|
|
.field public static final INPUT_TEXTURE_COORDINATE_NAME:Ljava/lang/String; = "in_tc"
|
|
|
|
.field public static final INPUT_VERTEX_COORDINATE_NAME:Ljava/lang/String; = "in_pos"
|
|
|
|
.field public static final TEXTURE_MATRIX_NAME:Ljava/lang/String; = "tex_mat"
|
|
|
|
|
|
# instance fields
|
|
.field public currentShader:Lorg/webrtc/GlShader;
|
|
|
|
.field public currentShaderType:Lorg/webrtc/GlGenericDrawer$ShaderType;
|
|
|
|
.field public final genericFragmentSource:Ljava/lang/String;
|
|
|
|
.field public inPosLocation:I
|
|
|
|
.field public inTcLocation:I
|
|
|
|
.field public final shaderCallbacks:Lorg/webrtc/GlGenericDrawer$ShaderCallbacks;
|
|
|
|
.field public texMatrixLocation:I
|
|
|
|
.field public final vertexShader:Ljava/lang/String;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 2
|
|
|
|
const/16 v0, 0x8
|
|
|
|
new-array v1, v0, [F
|
|
|
|
fill-array-data v1, :array_0
|
|
|
|
invoke-static {v1}, Lorg/webrtc/GlUtil;->createFloatBuffer([F)Ljava/nio/FloatBuffer;
|
|
|
|
move-result-object v1
|
|
|
|
sput-object v1, Lorg/webrtc/GlGenericDrawer;->FULL_RECTANGLE_BUFFER:Ljava/nio/FloatBuffer;
|
|
|
|
new-array v0, v0, [F
|
|
|
|
fill-array-data v0, :array_1
|
|
|
|
invoke-static {v0}, Lorg/webrtc/GlUtil;->createFloatBuffer([F)Ljava/nio/FloatBuffer;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lorg/webrtc/GlGenericDrawer;->FULL_RECTANGLE_TEXTURE_BUFFER:Ljava/nio/FloatBuffer;
|
|
|
|
return-void
|
|
|
|
nop
|
|
|
|
:array_0
|
|
.array-data 4
|
|
-0x40800000 # -1.0f
|
|
-0x40800000 # -1.0f
|
|
0x3f800000 # 1.0f
|
|
-0x40800000 # -1.0f
|
|
-0x40800000 # -1.0f
|
|
0x3f800000 # 1.0f
|
|
0x3f800000 # 1.0f
|
|
0x3f800000 # 1.0f
|
|
.end array-data
|
|
|
|
:array_1
|
|
.array-data 4
|
|
0x0
|
|
0x0
|
|
0x3f800000 # 1.0f
|
|
0x0
|
|
0x0
|
|
0x3f800000 # 1.0f
|
|
0x3f800000 # 1.0f
|
|
0x3f800000 # 1.0f
|
|
.end array-data
|
|
.end method
|
|
|
|
.method public constructor <init>(Ljava/lang/String;Ljava/lang/String;Lorg/webrtc/GlGenericDrawer$ShaderCallbacks;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p1, p0, Lorg/webrtc/GlGenericDrawer;->vertexShader:Ljava/lang/String;
|
|
|
|
iput-object p2, p0, Lorg/webrtc/GlGenericDrawer;->genericFragmentSource:Ljava/lang/String;
|
|
|
|
iput-object p3, p0, Lorg/webrtc/GlGenericDrawer;->shaderCallbacks:Lorg/webrtc/GlGenericDrawer$ShaderCallbacks;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Ljava/lang/String;Lorg/webrtc/GlGenericDrawer$ShaderCallbacks;)V
|
|
.locals 1
|
|
|
|
const-string v0, "varying vec2 tc;\nattribute vec4 in_pos;\nattribute vec4 in_tc;\nuniform mat4 tex_mat;\nvoid main() {\n gl_Position = in_pos;\n tc = (tex_mat * in_tc).xy;\n}\n"
|
|
|
|
invoke-direct {p0, v0, p1, p2}, Lorg/webrtc/GlGenericDrawer;-><init>(Ljava/lang/String;Ljava/lang/String;Lorg/webrtc/GlGenericDrawer$ShaderCallbacks;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static createFragmentShaderString(Ljava/lang/String;Lorg/webrtc/GlGenericDrawer$ShaderType;)Ljava/lang/String;
|
|
.locals 2
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
sget-object v1, Lorg/webrtc/GlGenericDrawer$ShaderType;->OES:Lorg/webrtc/GlGenericDrawer$ShaderType;
|
|
|
|
if-ne p1, v1, :cond_0
|
|
|
|
const-string v1, "#extension GL_OES_EGL_image_external : require\n"
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
:cond_0
|
|
const-string v1, "precision mediump float;\n"
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, "varying vec2 tc;\n"
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
sget-object v1, Lorg/webrtc/GlGenericDrawer$ShaderType;->YUV:Lorg/webrtc/GlGenericDrawer$ShaderType;
|
|
|
|
if-ne p1, v1, :cond_1
|
|
|
|
const-string p1, "uniform sampler2D y_tex;\n"
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, "uniform sampler2D u_tex;\n"
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, "uniform sampler2D v_tex;\n"
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, "vec4 sample(vec2 p) {\n"
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, " float y = texture2D(y_tex, p).r * 1.16438;\n"
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, " float u = texture2D(u_tex, p).r;\n"
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, " float v = texture2D(v_tex, p).r;\n"
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, " return vec4(y + 1.59603 * v - 0.874202,\n"
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, " y - 0.391762 * u - 0.812968 * v + 0.531668,\n"
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, " y + 2.01723 * u - 1.08563, 1);\n"
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, "}\n"
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
sget-object v1, Lorg/webrtc/GlGenericDrawer$ShaderType;->OES:Lorg/webrtc/GlGenericDrawer$ShaderType;
|
|
|
|
if-ne p1, v1, :cond_2
|
|
|
|
const-string p1, "samplerExternalOES"
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
const-string p1, "sampler2D"
|
|
|
|
:goto_0
|
|
const-string v1, "uniform "
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, " tex;\n"
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, "sample("
|
|
|
|
const-string v1, "texture2D(tex, "
|
|
|
|
invoke-virtual {p0, p1, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
:goto_1
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private prepareShader(Lorg/webrtc/GlGenericDrawer$ShaderType;[FIIII)V
|
|
.locals 13
|
|
|
|
move-object v0, p0
|
|
|
|
move-object v1, p1
|
|
|
|
iget-object v2, v0, Lorg/webrtc/GlGenericDrawer;->currentShaderType:Lorg/webrtc/GlGenericDrawer$ShaderType;
|
|
|
|
invoke-virtual {p1, v2}, Ljava/lang/Enum;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
|
|
const/4 v3, 0x1
|
|
|
|
const/4 v4, 0x0
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
iget-object v1, v0, Lorg/webrtc/GlGenericDrawer;->currentShader:Lorg/webrtc/GlShader;
|
|
|
|
move-object v6, v1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
iput-object v1, v0, Lorg/webrtc/GlGenericDrawer;->currentShaderType:Lorg/webrtc/GlGenericDrawer$ShaderType;
|
|
|
|
iget-object v2, v0, Lorg/webrtc/GlGenericDrawer;->currentShader:Lorg/webrtc/GlShader;
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
invoke-virtual {v2}, Lorg/webrtc/GlShader;->release()V
|
|
|
|
:cond_1
|
|
invoke-virtual {p0, p1}, Lorg/webrtc/GlGenericDrawer;->createShader(Lorg/webrtc/GlGenericDrawer$ShaderType;)Lorg/webrtc/GlShader;
|
|
|
|
move-result-object v2
|
|
|
|
iput-object v2, v0, Lorg/webrtc/GlGenericDrawer;->currentShader:Lorg/webrtc/GlShader;
|
|
|
|
invoke-virtual {v2}, Lorg/webrtc/GlShader;->useProgram()V
|
|
|
|
sget-object v5, Lorg/webrtc/GlGenericDrawer$ShaderType;->YUV:Lorg/webrtc/GlGenericDrawer$ShaderType;
|
|
|
|
if-ne v1, v5, :cond_2
|
|
|
|
const-string v1, "y_tex"
|
|
|
|
invoke-virtual {v2, v1}, Lorg/webrtc/GlShader;->getUniformLocation(Ljava/lang/String;)I
|
|
|
|
move-result v1
|
|
|
|
invoke-static {v1, v4}, Landroid/opengl/GLES20;->glUniform1i(II)V
|
|
|
|
const-string v1, "u_tex"
|
|
|
|
invoke-virtual {v2, v1}, Lorg/webrtc/GlShader;->getUniformLocation(Ljava/lang/String;)I
|
|
|
|
move-result v1
|
|
|
|
invoke-static {v1, v3}, Landroid/opengl/GLES20;->glUniform1i(II)V
|
|
|
|
const-string v1, "v_tex"
|
|
|
|
invoke-virtual {v2, v1}, Lorg/webrtc/GlShader;->getUniformLocation(Ljava/lang/String;)I
|
|
|
|
move-result v1
|
|
|
|
const/4 v5, 0x2
|
|
|
|
invoke-static {v1, v5}, Landroid/opengl/GLES20;->glUniform1i(II)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
const-string v1, "tex"
|
|
|
|
invoke-virtual {v2, v1}, Lorg/webrtc/GlShader;->getUniformLocation(Ljava/lang/String;)I
|
|
|
|
move-result v1
|
|
|
|
invoke-static {v1, v4}, Landroid/opengl/GLES20;->glUniform1i(II)V
|
|
|
|
:goto_0
|
|
const-string v1, "Create shader"
|
|
|
|
invoke-static {v1}, Lorg/webrtc/GlUtil;->checkNoGLES2Error(Ljava/lang/String;)V
|
|
|
|
iget-object v1, v0, Lorg/webrtc/GlGenericDrawer;->shaderCallbacks:Lorg/webrtc/GlGenericDrawer$ShaderCallbacks;
|
|
|
|
invoke-interface {v1, v2}, Lorg/webrtc/GlGenericDrawer$ShaderCallbacks;->onNewShader(Lorg/webrtc/GlShader;)V
|
|
|
|
const-string v1, "tex_mat"
|
|
|
|
invoke-virtual {v2, v1}, Lorg/webrtc/GlShader;->getUniformLocation(Ljava/lang/String;)I
|
|
|
|
move-result v1
|
|
|
|
iput v1, v0, Lorg/webrtc/GlGenericDrawer;->texMatrixLocation:I
|
|
|
|
const-string v1, "in_pos"
|
|
|
|
invoke-virtual {v2, v1}, Lorg/webrtc/GlShader;->getAttribLocation(Ljava/lang/String;)I
|
|
|
|
move-result v1
|
|
|
|
iput v1, v0, Lorg/webrtc/GlGenericDrawer;->inPosLocation:I
|
|
|
|
const-string v1, "in_tc"
|
|
|
|
invoke-virtual {v2, v1}, Lorg/webrtc/GlShader;->getAttribLocation(Ljava/lang/String;)I
|
|
|
|
move-result v1
|
|
|
|
iput v1, v0, Lorg/webrtc/GlGenericDrawer;->inTcLocation:I
|
|
|
|
move-object v6, v2
|
|
|
|
:goto_1
|
|
invoke-virtual {v6}, Lorg/webrtc/GlShader;->useProgram()V
|
|
|
|
iget v1, v0, Lorg/webrtc/GlGenericDrawer;->inPosLocation:I
|
|
|
|
invoke-static {v1}, Landroid/opengl/GLES20;->glEnableVertexAttribArray(I)V
|
|
|
|
iget v7, v0, Lorg/webrtc/GlGenericDrawer;->inPosLocation:I
|
|
|
|
const/4 v8, 0x2
|
|
|
|
const/16 v9, 0x1406
|
|
|
|
const/4 v10, 0x0
|
|
|
|
const/4 v11, 0x0
|
|
|
|
sget-object v12, Lorg/webrtc/GlGenericDrawer;->FULL_RECTANGLE_BUFFER:Ljava/nio/FloatBuffer;
|
|
|
|
invoke-static/range {v7 .. v12}, Landroid/opengl/GLES20;->glVertexAttribPointer(IIIZILjava/nio/Buffer;)V
|
|
|
|
iget v1, v0, Lorg/webrtc/GlGenericDrawer;->inTcLocation:I
|
|
|
|
invoke-static {v1}, Landroid/opengl/GLES20;->glEnableVertexAttribArray(I)V
|
|
|
|
iget v7, v0, Lorg/webrtc/GlGenericDrawer;->inTcLocation:I
|
|
|
|
sget-object v12, Lorg/webrtc/GlGenericDrawer;->FULL_RECTANGLE_TEXTURE_BUFFER:Ljava/nio/FloatBuffer;
|
|
|
|
invoke-static/range {v7 .. v12}, Landroid/opengl/GLES20;->glVertexAttribPointer(IIIZILjava/nio/Buffer;)V
|
|
|
|
iget v1, v0, Lorg/webrtc/GlGenericDrawer;->texMatrixLocation:I
|
|
|
|
move-object v2, p2
|
|
|
|
invoke-static {v1, v3, v4, p2, v4}, Landroid/opengl/GLES20;->glUniformMatrix4fv(IIZ[FI)V
|
|
|
|
iget-object v5, v0, Lorg/webrtc/GlGenericDrawer;->shaderCallbacks:Lorg/webrtc/GlGenericDrawer$ShaderCallbacks;
|
|
|
|
move-object v7, p2
|
|
|
|
move/from16 v8, p3
|
|
|
|
move/from16 v9, p4
|
|
|
|
move/from16 v10, p5
|
|
|
|
move/from16 v11, p6
|
|
|
|
invoke-interface/range {v5 .. v11}, Lorg/webrtc/GlGenericDrawer$ShaderCallbacks;->onPrepareShader(Lorg/webrtc/GlShader;[FIIII)V
|
|
|
|
const-string v1, "Prepare shader"
|
|
|
|
invoke-static {v1}, Lorg/webrtc/GlUtil;->checkNoGLES2Error(Ljava/lang/String;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public createShader(Lorg/webrtc/GlGenericDrawer$ShaderType;)Lorg/webrtc/GlShader;
|
|
.locals 3
|
|
|
|
new-instance v0, Lorg/webrtc/GlShader;
|
|
|
|
iget-object v1, p0, Lorg/webrtc/GlGenericDrawer;->vertexShader:Ljava/lang/String;
|
|
|
|
iget-object v2, p0, Lorg/webrtc/GlGenericDrawer;->genericFragmentSource:Ljava/lang/String;
|
|
|
|
invoke-static {v2, p1}, Lorg/webrtc/GlGenericDrawer;->createFragmentShaderString(Ljava/lang/String;Lorg/webrtc/GlGenericDrawer$ShaderType;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {v0, v1, p1}, Lorg/webrtc/GlShader;-><init>(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public drawOes(I[FIIIIII)V
|
|
.locals 7
|
|
|
|
sget-object v1, Lorg/webrtc/GlGenericDrawer$ShaderType;->OES:Lorg/webrtc/GlGenericDrawer$ShaderType;
|
|
|
|
move-object v0, p0
|
|
|
|
move-object v2, p2
|
|
|
|
move v3, p3
|
|
|
|
move v4, p4
|
|
|
|
move v5, p7
|
|
|
|
move v6, p8
|
|
|
|
invoke-direct/range {v0 .. v6}, Lorg/webrtc/GlGenericDrawer;->prepareShader(Lorg/webrtc/GlGenericDrawer$ShaderType;[FIIII)V
|
|
|
|
const p2, 0x84c0
|
|
|
|
invoke-static {p2}, Landroid/opengl/GLES20;->glActiveTexture(I)V
|
|
|
|
const p2, 0x8d65
|
|
|
|
invoke-static {p2, p1}, Landroid/opengl/GLES20;->glBindTexture(II)V
|
|
|
|
invoke-static {p5, p6, p7, p8}, Landroid/opengl/GLES20;->glViewport(IIII)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
const/4 p3, 0x5
|
|
|
|
const/4 p4, 0x4
|
|
|
|
invoke-static {p3, p1, p4}, Landroid/opengl/GLES20;->glDrawArrays(III)V
|
|
|
|
invoke-static {p2, p1}, Landroid/opengl/GLES20;->glBindTexture(II)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public drawRgb(I[FIIIIII)V
|
|
.locals 7
|
|
|
|
sget-object v1, Lorg/webrtc/GlGenericDrawer$ShaderType;->RGB:Lorg/webrtc/GlGenericDrawer$ShaderType;
|
|
|
|
move-object v0, p0
|
|
|
|
move-object v2, p2
|
|
|
|
move v3, p3
|
|
|
|
move v4, p4
|
|
|
|
move v5, p7
|
|
|
|
move v6, p8
|
|
|
|
invoke-direct/range {v0 .. v6}, Lorg/webrtc/GlGenericDrawer;->prepareShader(Lorg/webrtc/GlGenericDrawer$ShaderType;[FIIII)V
|
|
|
|
const p2, 0x84c0
|
|
|
|
invoke-static {p2}, Landroid/opengl/GLES20;->glActiveTexture(I)V
|
|
|
|
const/16 p2, 0xde1
|
|
|
|
invoke-static {p2, p1}, Landroid/opengl/GLES20;->glBindTexture(II)V
|
|
|
|
invoke-static {p5, p6, p7, p8}, Landroid/opengl/GLES20;->glViewport(IIII)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
const/4 p3, 0x5
|
|
|
|
const/4 p4, 0x4
|
|
|
|
invoke-static {p3, p1, p4}, Landroid/opengl/GLES20;->glDrawArrays(III)V
|
|
|
|
invoke-static {p2, p1}, Landroid/opengl/GLES20;->glBindTexture(II)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public drawYuv([I[FIIIIII)V
|
|
.locals 7
|
|
|
|
sget-object v1, Lorg/webrtc/GlGenericDrawer$ShaderType;->YUV:Lorg/webrtc/GlGenericDrawer$ShaderType;
|
|
|
|
move-object v0, p0
|
|
|
|
move-object v2, p2
|
|
|
|
move v3, p3
|
|
|
|
move v4, p4
|
|
|
|
move v5, p7
|
|
|
|
move v6, p8
|
|
|
|
invoke-direct/range {v0 .. v6}, Lorg/webrtc/GlGenericDrawer;->prepareShader(Lorg/webrtc/GlGenericDrawer$ShaderType;[FIIII)V
|
|
|
|
const/4 p2, 0x0
|
|
|
|
const/4 p3, 0x0
|
|
|
|
:goto_0
|
|
const/16 p4, 0xde1
|
|
|
|
const v0, 0x84c0
|
|
|
|
const/4 v1, 0x3
|
|
|
|
if-ge p3, v1, :cond_0
|
|
|
|
add-int/2addr v0, p3
|
|
|
|
invoke-static {v0}, Landroid/opengl/GLES20;->glActiveTexture(I)V
|
|
|
|
aget v0, p1, p3
|
|
|
|
invoke-static {p4, v0}, Landroid/opengl/GLES20;->glBindTexture(II)V
|
|
|
|
add-int/lit8 p3, p3, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-static {p5, p6, p7, p8}, Landroid/opengl/GLES20;->glViewport(IIII)V
|
|
|
|
const/4 p1, 0x5
|
|
|
|
const/4 p3, 0x4
|
|
|
|
invoke-static {p1, p2, p3}, Landroid/opengl/GLES20;->glDrawArrays(III)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
:goto_1
|
|
if-ge p1, v1, :cond_1
|
|
|
|
add-int p3, p1, v0
|
|
|
|
invoke-static {p3}, Landroid/opengl/GLES20;->glActiveTexture(I)V
|
|
|
|
invoke-static {p4, p2}, Landroid/opengl/GLES20;->glBindTexture(II)V
|
|
|
|
add-int/lit8 p1, p1, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
.method public release()V
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lorg/webrtc/GlGenericDrawer;->currentShader:Lorg/webrtc/GlShader;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0}, Lorg/webrtc/GlShader;->release()V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput-object v0, p0, Lorg/webrtc/GlGenericDrawer;->currentShader:Lorg/webrtc/GlShader;
|
|
|
|
iput-object v0, p0, Lorg/webrtc/GlGenericDrawer;->currentShaderType:Lorg/webrtc/GlGenericDrawer$ShaderType;
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|