Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Merge pull request #331 from axinging/xwalk_transparenttexture_6519
Browse files Browse the repository at this point in the history
[Android] Enable transparent TextureView
  • Loading branch information
Raphael Kubo da Costa committed Mar 25, 2016
2 parents bde07cf + e7d4a95 commit 3462d5c
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,22 @@ public ContentReadbackHandler getContentReadbackHandler() {
return mContentReadbackHandler;
}

private static boolean isOpaque(int color) {
return ((color >> 24) & 0xFF) == 0xFF;
}

/**
* Sets the background color of the surface view. This method is necessary because the
* Set the background color of SurfaceView or TextureView. This method is necessary because the
* background color of ContentViewRenderView itself is covered by the background of
* SurfaceView.
* SurfaceView or TextureView.
* @param color The color of the background.
*/
public void setSurfaceViewBackgroundColor(int color) {
if (mSurfaceView != null) {
mSurfaceView.setBackgroundColor(color);
} else if (mTextureView != null) {
mTextureView.setOpaque(isOpaque(color));
mTextureView.setBackgroundColor(color);
}
}

Expand Down

0 comments on commit 3462d5c

Please sign in to comment.