Improve error message

The previous message indicated that the fault was due to an already-
connected window, which was misleading at times.

Bug 12439318

Change-Id: I1e0a042673dd245d1b0d237af963c52946803eb6
This commit is contained in:
Andy McFadden 2014-01-07 15:54:17 -08:00
parent 524672571f
commit d566ce3a26

View File

@ -408,9 +408,11 @@ EGLSurface eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config,
if (dp) {
EGLDisplay iDpy = dp->disp.dpy;
if (native_window_api_connect(window, NATIVE_WINDOW_API_EGL) != OK) {
ALOGE("EGLNativeWindowType %p already connected to another API",
window);
int result = native_window_api_connect(window, NATIVE_WINDOW_API_EGL);
if (result != OK) {
ALOGE("eglCreateWindowSurface: native_window_api_connect (win=%p) "
"failed (%#x) (already connected to another API?)",
window, result);
return setError(EGL_BAD_ALLOC, EGL_NO_SURFACE);
}