// Path: src/com/af/experiments/FxCameraApp/Utils/OpenGlUtils.java
// public static final int GL_TEXTURE_EXTERNAL_OES = 0x8D65;


import static android.opengl.GLES20.*;
import static com.af.experiments.FxCameraApp.Utils.OpenGlUtils.GL_TEXTURE_EXTERNAL_OES;
package com.af.experiments.FxCameraApp.shaders;


public class GlPreviewShader  extends GlShader{
    private static final String VERTEX_SHADER =
            "uniform mat4 uMVPMatrix;\n" +
                    "uniform mat4 uSTMatrix;\n" +
                    "uniform float uCRatio;\n" +

                    "attribute vec4 aPosition;\n" +
                    "attribute vec4 aTextureCoord;\n" +
                    "varying highp vec2 vTextureCoord;\n" +

                    "void main() {\n" +
                    "vec4 scaledPos = aPosition;\n" +
                    "scaledPos.x = scaledPos.x * uCRatio;\n" +
                    "gl_Position = uMVPMatrix * scaledPos;\n" +
                    "vTextureCoord = (uSTMatrix * aTextureCoord).xy;\n" +
                    "}\n";

    private final int mTexTarget;

    public GlPreviewShader(final int texTarget) {
        super(VERTEX_SHADER, createFragmentShaderSourceOESIfNeed(texTarget));
        mTexTarget = texTarget;
    }

    private static String createFragmentShaderSourceOESIfNeed(final int texTarget) {
// Path: src/com/af/experiments/FxCameraApp/Utils/OpenGlUtils.java
// public static final int GL_TEXTURE_EXTERNAL_OES = 0x8D65;


// Path: src/com/af/experiments/FxCameraApp/shaders/GlPreviewShader.java
import static android.opengl.GLES20.*;
import static com.af.experiments.FxCameraApp.Utils.OpenGlUtils.GL_TEXTURE_EXTERNAL_OES;

package com.af.experiments.FxCameraApp.shaders;


public class GlPreviewShader  extends GlShader{
    private static final String VERTEX_SHADER =
            "uniform mat4 uMVPMatrix;\n" +
                    "uniform mat4 uSTMatrix;\n" +
                    "uniform float uCRatio;\n" +

                    "attribute vec4 aPosition;\n" +
                    "attribute vec4 aTextureCoord;\n" +
                    "varying highp vec2 vTextureCoord;\n" +

                    "void main() {\n" +
                    "vec4 scaledPos = aPosition;\n" +
                    "scaledPos.x = scaledPos.x * uCRatio;\n" +
                    "gl_Position = uMVPMatrix * scaledPos;\n" +
                    "vTextureCoord = (uSTMatrix * aTextureCoord).xy;\n" +
                    "}\n";

    private final int mTexTarget;

    public GlPreviewShader(final int texTarget) {
        super(VERTEX_SHADER, createFragmentShaderSourceOESIfNeed(texTarget));
        mTexTarget = texTarget;
    }

    private static String createFragmentShaderSourceOESIfNeed(final int texTarget) {
        if (texTarget == GL_TEXTURE_EXTERNAL_OES) {