summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-07-31 14:47:00 -0700
committerMathias Agopian <mathias@google.com>2009-07-31 14:47:00 -0700
commitabac01052c1c40f8582fe9f010c2efe6013e25c6 (patch)
tree4662643547957b2f93fbb7f8e5c5d38addaaf56e /cmds
parent1a20bae18ce05a5a141810492549d351a82f6490 (diff)
downloadframeworks_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.cpp6
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;