summaryrefslogtreecommitdiffstats
path: root/opengl/libs/EGL/egl.cpp
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-27 15:38:40 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-27 15:38:40 -0700
commite1861133d51b9e6a6f658eb366630ad4f4d3ff8f (patch)
tree046aaac6d455ccd57d38f3a13df44ecd13ac0322 /opengl/libs/EGL/egl.cpp
parentd91450e1169b3a57b3507fe86d947de05549f4ed (diff)
parent3f2fd987b230740e1b28ccb541d1181cb2187ae6 (diff)
downloadframeworks_base-e1861133d51b9e6a6f658eb366630ad4f4d3ff8f.zip
frameworks_base-e1861133d51b9e6a6f658eb366630ad4f4d3ff8f.tar.gz
frameworks_base-e1861133d51b9e6a6f658eb366630ad4f4d3ff8f.tar.bz2
Merge commit 'korg/cupcake'
Conflicts: core/java/android/webkit/WebView.java core/java/android/widget/TwoLineListItem.java preloaded-classes
Diffstat (limited to 'opengl/libs/EGL/egl.cpp')
-rw-r--r--opengl/libs/EGL/egl.cpp35
1 files changed, 20 insertions, 15 deletions
diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp
index 687c8bc..0b4bcce 100644
--- a/opengl/libs/EGL/egl.cpp
+++ b/opengl/libs/EGL/egl.cpp
@@ -725,9 +725,8 @@ EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list,
egl_display_t const * const dp = get_display(dpy);
if (!dp) return setError(EGL_BAD_DISPLAY, EGL_FALSE);
- if (configs == 0) {
- *num_config = 0;
- return EGL_TRUE;
+ if (num_config==0) {
+ return setError(EGL_BAD_PARAMETER, EGL_FALSE);
}
EGLint n;
@@ -784,7 +783,9 @@ EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list,
if (res && n>0) {
// n has to be 0 or 1, by construction, and we already know
// which config it will return (since there can be only one).
- configs[0] = MAKE_CONFIG(i, index);
+ if (configs) {
+ configs[0] = MAKE_CONFIG(i, index);
+ }
*num_config = 1;
}
}
@@ -798,19 +799,23 @@ EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list,
if (cnx->dso) {
if (cnx->hooks->egl.eglChooseConfig(
dp->dpys[i], attrib_list, configs, config_size, &n)) {
- // now we need to convert these client EGLConfig to our
- // internal EGLConfig format. This is done in O(n log n).
- for (int j=0 ; j<n ; j++) {
- int index = binarySearch<EGLConfig>(
- dp->configs[i], 0, dp->numConfigs[i]-1, configs[j]);
- if (index >= 0) {
- configs[j] = MAKE_CONFIG(i, index);
- } else {
- return setError(EGL_BAD_CONFIG, EGL_FALSE);
+ if (configs) {
+ // now we need to convert these client EGLConfig to our
+ // internal EGLConfig format. This is done in O(n log n).
+ for (int j=0 ; j<n ; j++) {
+ int index = binarySearch<EGLConfig>(
+ dp->configs[i], 0, dp->numConfigs[i]-1, configs[j]);
+ if (index >= 0) {
+ if (configs) {
+ configs[j] = MAKE_CONFIG(i, index);
+ }
+ } else {
+ return setError(EGL_BAD_CONFIG, EGL_FALSE);
+ }
}
+ configs += n;
+ config_size -= n;
}
- configs += n;
- config_size -= n;
*num_config += n;
res = EGL_TRUE;
}