Skip to content

Commit

Permalink
Merge pull request #208 from jonan/transparent
Browse files Browse the repository at this point in the history
Transparent GLSurfaceView background
  • Loading branch information
wasabeef committed Oct 8, 2015
2 parents 8ca48f1 + 28f785a commit 6a7c30b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ public GPUImageRenderer(final GPUImageFilter filter) {

@Override
public void onSurfaceCreated(final GL10 unused, final EGLConfig config) {
GLES20.glClearColor(0, 0, 0, 1);
GLES20.glDisable(GLES20.GL_DEPTH_TEST);
GLES20.glDisable(GL10.GL_DITHER);
GLES20.glClearColor(0,0,0,0);
GLES20.glEnable(GL10.GL_CULL_FACE);
GLES20.glEnable(GL10.GL_DEPTH_TEST);
mFilter.init();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import android.graphics.Bitmap;
import android.graphics.Color;
import android.media.MediaScannerConnection;
import android.graphics.PixelFormat;
import android.net.Uri;
import android.opengl.GLES20;
import android.opengl.GLSurfaceView;
Expand Down Expand Up @@ -56,6 +57,9 @@ public GPUImageView(Context context, AttributeSet attrs) {

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);
Expand Down

0 comments on commit 6a7c30b

Please sign in to comment.