Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(483)

Unified Diff: webrtc/api/android/java/src/org/webrtc/EglBase14.java

Issue 2338033002: Android EglBase: Include EGL error code in exceptions (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/api/android/java/src/org/webrtc/EglBase10.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/android/java/src/org/webrtc/EglBase14.java
diff --git a/webrtc/api/android/java/src/org/webrtc/EglBase14.java b/webrtc/api/android/java/src/org/webrtc/EglBase14.java
index 3398c11eb432de634c5d29e42bcb57d082b67973..b1e1772256ced712f92d3182bbbe559162353648 100644
--- a/webrtc/api/android/java/src/org/webrtc/EglBase14.java
+++ b/webrtc/api/android/java/src/org/webrtc/EglBase14.java
@@ -82,7 +82,8 @@ public final class EglBase14 extends EglBase {
int[] surfaceAttribs = {EGL14.EGL_NONE};
eglSurface = EGL14.eglCreateWindowSurface(eglDisplay, eglConfig, surface, surfaceAttribs, 0);
if (eglSurface == EGL14.EGL_NO_SURFACE) {
- throw new RuntimeException("Failed to create window surface");
+ throw new RuntimeException(
+ "Failed to create window surface: 0x" + Integer.toHexString(EGL14.eglGetError()));
}
}
@@ -101,7 +102,8 @@ public final class EglBase14 extends EglBase {
eglSurface = EGL14.eglCreatePbufferSurface(eglDisplay, eglConfig, surfaceAttribs, 0);
if (eglSurface == EGL14.EGL_NO_SURFACE) {
throw new RuntimeException(
- "Failed to create pixel buffer surface with size: " + width + "x" + height);
+ "Failed to create pixel buffer surface with size " + width + "x" + height
+ + ": 0x" + Integer.toHexString(EGL14.eglGetError()));
}
}
@@ -165,7 +167,8 @@ public final class EglBase14 extends EglBase {
}
synchronized (EglBase.lock) {
if (!EGL14.eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext)) {
- throw new RuntimeException("eglMakeCurrent failed");
+ throw new RuntimeException(
+ "eglMakeCurrent failed: 0x" + Integer.toHexString(EGL14.eglGetError()));
}
}
}
@@ -176,7 +179,8 @@ public final class EglBase14 extends EglBase {
synchronized (EglBase.lock) {
if (!EGL14.eglMakeCurrent(
eglDisplay, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_CONTEXT)) {
- throw new RuntimeException("eglDetachCurrent failed");
+ throw new RuntimeException(
+ "eglDetachCurrent failed: 0x" + Integer.toHexString(EGL14.eglGetError()));
}
}
}
@@ -208,11 +212,13 @@ public final class EglBase14 extends EglBase {
private static EGLDisplay getEglDisplay() {
EGLDisplay eglDisplay = EGL14.eglGetDisplay(EGL14.EGL_DEFAULT_DISPLAY);
if (eglDisplay == EGL14.EGL_NO_DISPLAY) {
- throw new RuntimeException("Unable to get EGL14 display");
+ throw new RuntimeException(
+ "Unable to get EGL14 display: 0x" + Integer.toHexString(EGL14.eglGetError()));
}
int[] version = new int[2];
if (!EGL14.eglInitialize(eglDisplay, version, 0, version, 1)) {
- throw new RuntimeException("Unable to initialize EGL14");
+ throw new RuntimeException(
+ "Unable to initialize EGL14: 0x" + Integer.toHexString(EGL14.eglGetError()));
}
return eglDisplay;
}
@@ -223,7 +229,8 @@ 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");
+ throw new RuntimeException(
+ "eglChooseConfig failed: 0x" + Integer.toHexString(EGL14.eglGetError()));
}
if (numConfigs[0] <= 0) {
throw new RuntimeException("Unable to find any matching EGL config");
@@ -249,7 +256,8 @@ public final class EglBase14 extends EglBase {
eglContext = EGL14.eglCreateContext(eglDisplay, eglConfig, rootContext, contextAttributes, 0);
}
if (eglContext == EGL14.EGL_NO_CONTEXT) {
- throw new RuntimeException("Failed to create EGL context");
+ throw new RuntimeException(
+ "Failed to create EGL context: 0x" + Integer.toHexString(EGL14.eglGetError()));
}
return eglContext;
}
« no previous file with comments | « webrtc/api/android/java/src/org/webrtc/EglBase10.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698