@Override public void onDrawFrame(final GL10 unused){
  GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
  if (requesrUpdateTex) {
    requesrUpdateTex=false;
    mSTexture.updateTexImage();
    mSTexture.getTransformMatrix(mStMatrix);
    update(hTex,mStMatrix);
  }
  GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER,0);
  GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
  GLES20.glEnable(GLES20.GL_BLEND);
  final CameraGLView parent=mWeakParent.get();
  render(parent.mRenderViewport.x,parent.mRenderViewport.y,parent.mRenderViewport.width,parent.mRenderViewport.height);
  GLES20.glDisable(GLES20.GL_BLEND);
  flip=!flip;
  if (flip) {
synchronized (this) {
      if (mVideoEncoder != null) {
        mVideoEncoder.frameAvailableSoon(mStMatrix,mMvpMatrix);
      }
    }
  }
}

@ Override public void onDrawFrame ( final GL10 unused ) { GLES20 . glClear ( GLES20 . GL_COLOR_BUFFER_BIT ) ; if ( requesrUpdateTex ) { requesrUpdateTex = false ; mSTexture . updateTexImage ( ) ; mSTexture . getTransformMatrix ( mStMatrix ) ; update ( hTex , mStMatrix ) ; } GLES20 . glBindFramebuffer ( GLES20 . GL_FRAMEBUFFER , 0 ) ; GLES20 . glClear ( GLES20 . GL_COLOR_BUFFER_BIT ) ; GLES20 . glEnable ( GLES20 . GL_BLEND ) ; final CameraGLView parent = mWeakParent . get ( ) ; render ( parent . mRenderViewport . x , parent . mRenderViewport . y , parent . mRenderViewport . width , parent . mRenderViewport . height ) ; GLES20 . glDisable ( GLES20 . GL_BLEND ) ; flip = ! flip ; if ( flip ) { synchronized ( this ) { if ( mVideoEncoder != null ) { mVideoEncoder . frameAvailableSoon ( mStMatrix , mMvpMatrix ) ; } } } }
drawing to glsurface we set rendermode to glsurfaceview . rendermode_when_dirty , this method is only called when # requestrender is called ( = when texture is required to update ) if you don ' t set rendermode_when_dirty , this method is called at maximum 60fps
