Skip to content

Commit 0c580a0

Browse files
Andy RossNRanjan-17
Andy Ross
authored andcommitted
fwb: GLSurfaceView: Be less picky about EGLConfig alpha sizes
EGLChooseConfig returns a "best match" set of visuals meeting or exceeding the required r/g/b/a component depths. But GLSurfaceView oddly requires that the returned visual be an exact match. Add to that that the (rarely used outside of CTS) default request specifies zero alpha bits and that not all drivers expose a zero-alpha EGLConfig, and the default configuration will fail needlessly. It's not incorrect to have alpha bits you didn't request: the only way to produce divergent behavior is for a fragment shader to write out explicit alpha values (into the channel it didn't want to begin with!) with values other than 1.0 and then rely on them being ignored and treated as 1.0. For: AXIA-1448 Change-Id: I2f64995d7b9de1ae082aa47822af525390102083 Signed-off-by: Andy Ross <andy.ross@windriver.com> Signed-off-by: Pranav Vashi <neobuddy89@gmail.com> Signed-off-by: NRanjan-17 <nalinishranjan05@gmail.com>
1 parent d76eae0 commit 0c580a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

opengl/java/android/opengl/GLSurfaceView.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display,
970970
int a = findConfigAttrib(egl, display, config,
971971
EGL10.EGL_ALPHA_SIZE, 0);
972972
if ((r == mRedSize) && (g == mGreenSize)
973-
&& (b == mBlueSize) && (a == mAlphaSize)) {
973+
&& (b == mBlueSize) && (a >= mAlphaSize)) {
974974
return config;
975975
}
976976
}

0 commit comments

Comments
 (0)