Andoid EglBase: Detect failure to find EGL config
BUG=b/27950559 Review URL: https://codereview.webrtc.org/1855953002 Cr-Commit-Position: refs/heads/master@{#12239}
This commit is contained in:
@ -268,9 +268,16 @@ final class EglBase10 extends EglBase {
|
||||
int[] numConfigs = new int[1];
|
||||
if (!egl.eglChooseConfig(
|
||||
eglDisplay, configAttributes, configs, configs.length, numConfigs)) {
|
||||
throw new RuntimeException("eglChooseConfig failed");
|
||||
}
|
||||
if (numConfigs[0] <= 0) {
|
||||
throw new RuntimeException("Unable to find any matching EGL config");
|
||||
}
|
||||
return configs[0];
|
||||
final EGLConfig eglConfig = configs[0];
|
||||
if (eglConfig == null) {
|
||||
throw new RuntimeException("eglChooseConfig returned null");
|
||||
}
|
||||
return eglConfig;
|
||||
}
|
||||
|
||||
// Return an EGLConfig, or die trying.
|
||||
|
||||
@ -228,9 +228,16 @@ public final class EglBase14 extends EglBase {
|
||||
int[] numConfigs = new int[1];
|
||||
if (!EGL14.eglChooseConfig(
|
||||
eglDisplay, configAttributes, 0, configs, 0, configs.length, numConfigs, 0)) {
|
||||
throw new RuntimeException("eglChooseConfig failed");
|
||||
}
|
||||
if (numConfigs[0] <= 0) {
|
||||
throw new RuntimeException("Unable to find any matching EGL config");
|
||||
}
|
||||
return configs[0];
|
||||
final EGLConfig eglConfig = configs[0];
|
||||
if (eglConfig == null) {
|
||||
throw new RuntimeException("eglChooseConfig returned null");
|
||||
}
|
||||
return eglConfig;
|
||||
}
|
||||
|
||||
// Return an EGLConfig, or die trying.
|
||||
|
||||
Reference in New Issue
Block a user