diff options
author | Mathias Agopian <mathias@google.com> | 2009-07-31 14:47:00 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2009-07-31 14:47:00 -0700 |
commit | abac01052c1c40f8582fe9f010c2efe6013e25c6 (patch) | |
tree | 4662643547957b2f93fbb7f8e5c5d38addaaf56e /cmds | |
parent | 1a20bae18ce05a5a141810492549d351a82f6490 (diff) | |
download | frameworks_base-abac01052c1c40f8582fe9f010c2efe6013e25c6.zip frameworks_base-abac01052c1c40f8582fe9f010c2efe6013e25c6.tar.gz frameworks_base-abac01052c1c40f8582fe9f010c2efe6013e25c6.tar.bz2 |
be more robust when errors occur upon EGL surface creation (ie: don't crash)
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/bootanimation/BootAnimation.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp index f101007..008fa36 100644 --- a/cmds/bootanimation/BootAnimation.cpp +++ b/cmds/bootanimation/BootAnimation.cpp @@ -152,11 +152,13 @@ status_t BootAnimation::readyToRun() { eglChooseConfig(display, attribs, &config, 1, &numConfigs); surface = eglCreateWindowSurface(display, config, s.get(), NULL); - context = eglCreateContext(display, config, NULL, NULL); eglQuerySurface(display, surface, EGL_WIDTH, &w); eglQuerySurface(display, surface, EGL_HEIGHT, &h); - eglMakeCurrent(display, surface, surface, context); + + if (eglMakeCurrent(display, surface, surface, context) == EGL_FALSE) + return NO_INIT; + mDisplay = display; mContext = context; mSurface = surface; |