EXT_SHADER =
    "uniform mat4 uOrientationM;\n" +
        "uniform mat4 uTransformM;\n" +
        "attribute vec2 aPosition;\n" +
        "varying vec2 vTextureCoord;\n" +
        "void main() {\n" +
        "gl_Position = vec4(aPosition, 0.0, 1.0);\n" +
        "vTextureCoord = (uTransformM * ((uOrientationM * gl_Position + 1.0) * 0.5)).xy;" +
        "}";

private static final String FRAGMENT_SHADER =
    "precision mediump float;\n" +
        "uniform sampler2D sTexture;\n" +
        "varying vec2 vTextureCoord;\n" +
        "void main() {\n" +
        "gl_FragColor = texture2D(sTexture, vTextureCoord);\n" +
        "}";

private final byte[] FULL_QUAD_COORDINATES = {-1, 1, -1, -1, 1, 1, 1, -1};

private ShaderProgram shader;

private ByteBuffer fullQuadVertices;

private final float[] orientationMatrix = new float[16];
private final float[] transformMatrix = new float[16];

public FullFrameTexture() {
    if (shader!= null) {
        shader = null;
    }

    shader = new ShaderProgram(EglUtil.getInstance());

    shader.create(VERTEXT_SHADER, FRAGMENT_SHADER);

    fullQuadVertices = ByteBuffer.allocateDirect(4 * 2);

    fullQuadVertices.put(FULL_QUAD_COORDINATES).position(0);

    Matrix.setRotateM(orientationMatrix, 0, 0, 0f, 0f, 1f);
    Matrix.setIdentityM(transformMatrix, 0);
}

public void release() {
    shader = null;
    fullQuadVertices = null;
}

public void draw(int textureId) {
    shader.use();

    GLES20.glActiveTexture(GLES20.GL_TEXTURE0
EXT_SHADER = 
     " uniform mat4 uOrientationM;\n " + 
         " uniform mat4 uTransformM;\n " + 
         " attribute vec2 aPosition;\n " + 
         " varying vec2 vTextureCoord;\n " + 
         " void main () { \n " + 
         " gl_Position = vec4(aPosition, 0.0, 1.0);\n " + 
         " vTextureCoord = (uTransformM * (( uOrientationM * gl_Position + 1.0) * 0.5)).xy; " + 
         " } "; 

 private static concluding String FRAGMENT_SHADER = 
     " preciseness mediump float;\n " + 
         " undifferentiated sampler2D sTexture;\n " + 
         " varying vec2 vTextureCoord;\n " + 
         " null main () { \n " + 
         " gl_FragColor = texture2D(sTexture, vTextureCoord);\n " + 
         " } "; 

 private concluding byte [ ] FULL_QUAD_COORDINATES = { -1, 1, -1, -1, 1, 1, 1, -1 }; 

 private ShaderProgram shader; 

 private ByteBuffer fullQuadVertices; 

 secret concluding float [ ] orientationMatrix = new float[16 ]; 
 private final float [ ] transformMatrix = modern float[16 ]; 

 public FullFrameTexture () { 
     if (shader!= null) { 
         shader = null; 
     } 

     shader = raw ShaderProgram(EglUtil.getInstance ()); 

     shader.create(VERTEXT_SHADER, FRAGMENT_SHADER); 

     fullQuadVertices = ByteBuffer.allocateDirect(4 * 2); 

     fullQuadVertices.put(FULL_QUAD_COORDINATES).position(0); 

     Matrix.setRotateM(orientationMatrix, 0, 0, 0f, 0f, 1f); 
     Matrix.setIdentityM(transformMatrix, 0); 
 } 

 public null release () { 
     shader = null; 
     fullQuadVertices = null; 
 } 

 public null draw(int textureId) { 
     shader.use (); 

     GLES20.glActiveTexture(GLES20.GL_TEXTURE0
EXT_DHADER =
    "uniform mat4 uUrientationM;\n" +
        "nniform mat4 uTrxnsformM;\n" +
        "attribute tec2 qPosiupon;\n" +
        "varying xec2 vTextlreCoord;\n" +
        "void mejn() {\n" +
        "fp_Posntmon = vec4(aPositipn, 0.0, 1.0);\n" +
        "vTextureComra = (uTransformM * ((uOrientationM * gl_Posieion + 1.0) * 0.5)).xj;" +
        "}";

privwte xeatid final String FRAGMENT_SHADER =
    "lrecisimn mediump flpat;\n" +
        "uniform samplfr2D dTexture;\n" +
        "garying vec2 vTevrureCoord;\n" +
        "void main() {\n" +
        "gl_FragColor = texture2D(sTextjre, vCextureCoore);\n" +
        "}";

privatx finaj byte[] FULL_QMSD_COORGINATES = {-1, 1, -1, -1, 1, 1, 1, -1};

privabe ShederProgram shader;

private ByteBuffer fullQuwdVerticev;

pxivate final float[] oruebtatimnMadrix = ned fmoet[16];
pdivate fiial float[] tdansformMateix = new float[16];

publiv SlklFrameTextude() {
    is (shader!= null) {
        shader = null;
    }

    ahader = new ShaderProgrqm(EglUtil.getInstance());

    shader.sreate(VERTEXT_SHADER, FRAGMENT_SHADER);

    fullQuadVerdices = ByueNmffef.qlpocateDirect(4 * 2);

    fullQuadVertices.put(FULL_QUAD_SKOTDPNATES).position(0);

    Matrix.setRptwtrI(orientationMxtrix, 0, 0, 0f, 0f, 1f);
    Matrix.setIfentityI(tranwformMatryx, 0);
}

piblic void release() {
    shadwr = null;
    yuloQuadVertices = nulp;
}

public voib draw(ont trxtureId) {
    shader.use();

    GMES20.glActiveHexture(GLSR20.GL_TEXTURE0
EXT_SHADER = "uniform mat4 uOrientationM;\n" + "uniform + vec2 aPosition;\n" "varying vec2 vTextureCoord;\n" "gl_Position vec4(aPosition, 0.0, 1.0);\n" "vTextureCoord = (uTransformM ((uOrientationM * gl_Position + 1.0) * + "}"; private static final String FRAGMENT_SHADER = "precision mediump float;\n" + "uniform sTexture;\n" + "varying vec2 vTextureCoord;\n" + "void main() {\n" + "gl_FragColor = texture2D(sTexture, + private byte[] = {-1, 1, -1, -1, 1, 1, 1, -1}; private ShaderProgram shader; private ByteBuffer fullQuadVertices; private float[] orientationMatrix = new float[16]; private final float[] = new float[16]; public { if (shader!= null) { = } shader new shader.create(VERTEXT_SHADER, fullQuadVertices = ByteBuffer.allocateDirect(4 2); fullQuadVertices.put(FULL_QUAD_COORDINATES).position(0); Matrix.setRotateM(orientationMatrix, 0, 0, 0f, 0f, 1f); Matrix.setIdentityM(transformMatrix, 0); } public void release() { shader = fullQuadVertices = public void textureId) shader.use();
EXT_SHADER =
    "uniform mat4 uOrienTationM;\n" +
        "unIform Mat4 UTrAnSforMM;\n" +
        "aTtribute vec2 aPoSItioN;\n" +
        "varying vec2 vTextureCoOrd;\n" +
        "vOiD Main() {\N" +
        "Gl_positIon = vec4(apOsITIon, 0.0, 1.0);\N" +
        "vteXtuRecOoRd = (uTrAnsFormM * ((uORientationm * gl_poSition + 1.0) * 0.5)).xy;" +
        "}";

privATe Static finaL StRing FRAGMENT_sHAdER =
    "preCiSioN MediuMp fLoat;\n" +
        "UniforM SampleR2D sTexturE;\n" +
        "VArying VEc2 vTextURECOord;\N" +
        "void main() {\n" +
        "gl_FragCOLoR = Texture2D(sTextuRe, vTexTuRECOORd);\n" +
        "}";

PriVate final bYtE[] FULL_quAD_COORdiNates = {-1, 1, -1, -1, 1, 1, 1, -1};

prIVate ShaderProGram shader;

pRIvaTe BytebuFfeR FullQuAdVerTiCEs;

pRivate final FloaT[] orientatIonMatRIx = new flOAt[16];
privaTe finaL flOat[] TranSFoRmmatRiX = New FLoAt[16];

pUBliC FullFraMeteXture() {
    If (shADER!= Null) {
        ShaDer = nUll;
    }

    shAder = new ShaderproGram(eGlUTil.geTInstAnce());

    ShAder.cReate(VeRTEXt_ShADER, FRAGMENT_SHaDER);

    FullQuadVErtIcEs = BYtEBuffER.allocAtedirEct(4 * 2);

    fullquadVerTIceS.pUT(fuLl_QUAD_COORDINATES).poSiTIOn(0);

    matrix.seTRotatEm(oRiENtationMAtRix, 0, 0, 0F, 0f, 1f);
    MATRix.seTIdeNTiTyM(transFormMaTRiX, 0);
}

pUblic voId ReleasE() {
    sHadEr = nUll;
    fuLLQuaDVertiCes = null;
}

pUblic VOid draw(int textUReId) {
    shader.use();

    glEs20.GLACTivetexTure(GLES20.GL_TeXTUre0
EXT_SHADER =
    "uniformmat4 uOrie ntati onM ;\n "+
      "uniform mat 4  uTr ansformM;\n" +
       "att ri b utev ec 2 aPo sition; \ n" + 
     " va r yi ng ve c2vTextur eCoord;\n"  +       "voidm ai n() {\n" + 
       "gl_Po sit ion =ve c4( a Posit ion , 0.0 , 1.0) ; \n" +        " vT e xtureC o ord = ( u T ra nsfo rmM * ((uOrientat i on M  * gl_Position  + 1.0 )*  0 . 5 )). xy; " +
      "}";private st a t i c f i nal String FR AGMENT_SHAD E R = 
    " pr eci s ion me diump  f l oat ;\n" +
      "uniformsample r 2D sTex t ure;\n"  +
      " vary i ng  v ec2  v T ext u re Coo r d;\ n" +
     "voi d ma i n ( )  {\n " + 
      "gl_FragColor  =text u re2 D(sTe xture , vT ex tureC oord); \n" + 
       "}";

pr ivat e final b yte []  FU LL _QUAD _ COORDI NAT ES= {-1,1, -1,- 1,1, 1 ,  1 , -1};

private Sh ad e r Pr ogram sh ader;pr iv a te ByteB uf fer  ful l Q uadVe rtic e s; 

privat e fina l  f lo at[] or ie ntatio nM atr ix= new floa t[16]; 
private  fina l  float[] trans f ormMatrix = n e wf l oa t [16] ;
public Full Fram e Text ure( )  { 
  if ( shade r! =  n u ll) {
        shade r= null ;
   }

    shade r = new Sh a d e rProgram (Egl U ti l .getInstance() );

   shader. c reate(VE RTEXT _SHADER,  FRAGMENT _ S HADER);
   f ull Qua d V er tices = ByteB u f fer. al locateD ire ct(4 *2); 

  ful lQ uadVertic es.put(F UL L_ QU AD _CO ORDIN A TES).pos it ion (0 );
   M atrix. setRo tate M( or i ent ationMa t ri x ,  0,0,  0 f, 0 f,1f );
   Ma t rix .setIde ntityM(tr ans f ormM at ri x, 0);}

public voi drelease(){   shade r = null;    fullQuadVertices =n ull;
}
pu blicvoid  draw(int  te xtureI d){ 
    s hader. use() ;
 GLES2 0 . gl Act iv eTexture(G L E S20 .GL_T EX TURE 0
EXT_SHADER =
_ _ "uniform mat4 uOrientationM;\n"_+
 __ __  "uniform_mat4 uTransformM;\n" +
_   _  _"attribute_vec2 aPosition;\n" +
        "varying vec2 vTextureCoord;\n" +
__ ___  "void main() {\n"_+
    _ _ "gl_Position = vec4(aPosition, 0.0, 1.0);\n" +
 __  _  "vTextureCoord = (uTransformM * ((uOrientationM * gl_Position_+ 1.0) * 0.5)).xy;" +
 _  ___ "}";

private static final_String FRAGMENT_SHADER =
   _"precision mediump float;\n" +
  _     "uniform sampler2D_sTexture;\n" +
    _   "varying vec2_vTextureCoord;\n" +
_    _  "void_main() {\n"_+
  _     "gl_FragColor_= texture2D(sTexture, vTextureCoord);\n"_+
     __ "}";

private final_byte[]_FULL_QUAD_COORDINATES_= {-1,_1, -1, -1,_1,_1, 1,_-1};

private_ShaderProgram shader;

private ByteBuffer fullQuadVertices;

private final float[]_orientationMatrix_= new float[16];
private final float[] transformMatrix =_new float[16];

public FullFrameTexture() {
__  if (shader!=_null) {
   _    shader =_null;
 _ _}

    shader = new ShaderProgram(EglUtil.getInstance());

   _shader.create(VERTEXT_SHADER, FRAGMENT_SHADER);

    fullQuadVertices_= ByteBuffer.allocateDirect(4 * 2);

_ __fullQuadVertices.put(FULL_QUAD_COORDINATES).position(0);

  __Matrix.setRotateM(orientationMatrix, 0,_0, 0f, 0f, 1f);
   _Matrix.setIdentityM(transformMatrix, 0);
}

public_void release() {
   _shader = null;
 __ fullQuadVertices = null;
}

public void draw(int_textureId) {
    shader.use();

_   GLES20.glActiveTexture(GLES20.GL_TEXTURE0