protected void setGLBackgroundTransparent(boolean transparent) {
   if (transparent) {
     mSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
     mSurfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
     mSurfaceView.setZOrderOnTop(true);
   } else {
     mSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
     mSurfaceView.getHolder().setFormat(PixelFormat.RGBA_8888);
     mSurfaceView.setZOrderOnTop(false);
   }
 }
 private void init(Context context, AttributeSet attrs) {
   mGLSurfaceView = new GPUImageGLSurfaceView(context, attrs);
   mGLSurfaceView.setZOrderOnTop(true);
   mGLSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
   mGLSurfaceView.getHolder().setFormat(PixelFormat.TRANSPARENT);
   addView(mGLSurfaceView);
   mGPUImage = new GPUImage(getContext());
   mGPUImage.setGLSurfaceView(mGLSurfaceView);
 }
 public void resetSurfaceView() {
   removeViewInLayout(surfaceView);
   surfaceView = null;
   surfaceView = new GLSurfaceView(getContext());
   // surfaceView.setBackgroundColor(Color.WHITE);
   surfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
   surfaceView.setZOrderOnTop(true);
   surfaceView.setRenderer(renderer);
   surfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
   surfaceView.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
   addViewInLayout(
       surfaceView,
       -1,
       new AbsListView.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT),
       false);
 }
  // --------------------------------------------------------------------------------------------------------------------
  // Internals
  private void setupSurfaceView(Context context) {
    surfaceView = new GLSurfaceView(getContext());

    cards = new FlipCards(this, flipOrientation == VERTICAL);
    renderer = new FlipRenderer(this, cards);

    surfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
    surfaceView.setZOrderOnTop(true);
    surfaceView.setRenderer(renderer);
    surfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
    surfaceView.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);

    addViewInLayout(
        surfaceView,
        -1,
        new AbsListView.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT),
        false);
  }