Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 1 | /* |
| 2 | ** Copyright 2007, The Android Open Source Project |
| 3 | ** |
| 4 | ** Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | ** you may not use this file except in compliance with the License. |
| 6 | ** You may obtain a copy of the License at |
| 7 | ** |
| 8 | ** http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | ** |
| 10 | ** Unless required by applicable law or agreed to in writing, software |
| 11 | ** distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | ** See the License for the specific language governing permissions and |
| 14 | ** limitations under the License. |
| 15 | */ |
| 16 | |
Mathias Agopian | 4b9511c | 2011-11-13 23:52:47 -0800 | [diff] [blame] | 17 | #include <string.h> |
| 18 | |
Jamie Gennis | aca51c0 | 2011-11-03 17:42:43 -0700 | [diff] [blame] | 19 | #include "egl_cache.h" |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 20 | #include "egl_display.h" |
| 21 | #include "egl_object.h" |
| 22 | #include "egl_tls.h" |
| 23 | #include "egl_impl.h" |
| 24 | #include "Loader.h" |
| 25 | |
| 26 | // ---------------------------------------------------------------------------- |
| 27 | namespace android { |
| 28 | // ---------------------------------------------------------------------------- |
| 29 | |
Mathias Agopian | 4b9511c | 2011-11-13 23:52:47 -0800 | [diff] [blame] | 30 | static char const * const sVendorString = "Android"; |
| 31 | static char const * const sVersionString = "1.4 Android META-EGL"; |
| 32 | static char const * const sClientApiString = "OpenGL ES"; |
| 33 | |
| 34 | // this is the list of EGL extensions that are exposed to applications |
| 35 | // some of them are mandatory because used by the ANDROID system. |
| 36 | // |
| 37 | // mandatory extensions are required per the CDD and not explicitly |
| 38 | // checked during EGL initialization. the system *assumes* these extensions |
| 39 | // are present. the system may not function properly if some mandatory |
| 40 | // extensions are missing. |
| 41 | // |
| 42 | // NOTE: sExtensionString MUST be have a single space as the last character. |
| 43 | // |
| 44 | static char const * const sExtensionString = |
| 45 | "EGL_KHR_image " // mandatory |
| 46 | "EGL_KHR_image_base " // mandatory |
| 47 | "EGL_KHR_image_pixmap " |
| 48 | "EGL_KHR_gl_texture_2D_image " |
| 49 | "EGL_KHR_gl_texture_cubemap_image " |
| 50 | "EGL_KHR_gl_renderbuffer_image " |
| 51 | "EGL_KHR_fence_sync " |
| 52 | "EGL_NV_system_time " |
| 53 | "EGL_ANDROID_image_native_buffer " // mandatory |
| 54 | ; |
| 55 | |
| 56 | // extensions not exposed to applications but used by the ANDROID system |
| 57 | // "EGL_ANDROID_recordable " // mandatory |
| 58 | // "EGL_ANDROID_blob_cache " // strongly recommended |
| 59 | |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 60 | extern void initEglTraceLevel(); |
Siva Velusamy | b13c78f | 2012-03-09 14:51:28 -0800 | [diff] [blame] | 61 | extern void initEglDebugLevel(); |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 62 | extern void setGLHooksThreadSpecific(gl_hooks_t const *value); |
| 63 | |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 64 | // ---------------------------------------------------------------------------- |
| 65 | |
| 66 | egl_display_t egl_display_t::sDisplay[NUM_DISPLAYS]; |
| 67 | |
| 68 | egl_display_t::egl_display_t() : |
Mathias Agopian | 7773c43 | 2012-02-13 20:06:08 -0800 | [diff] [blame] | 69 | magic('_dpy'), refs(0) { |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 70 | } |
| 71 | |
| 72 | egl_display_t::~egl_display_t() { |
| 73 | magic = 0; |
Jamie Gennis | 7660108 | 2011-11-06 14:14:33 -0800 | [diff] [blame] | 74 | egl_cache_t::get()->terminate(); |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 75 | } |
| 76 | |
| 77 | egl_display_t* egl_display_t::get(EGLDisplay dpy) { |
| 78 | uintptr_t index = uintptr_t(dpy)-1U; |
| 79 | return (index >= NUM_DISPLAYS) ? NULL : &sDisplay[index]; |
| 80 | } |
| 81 | |
| 82 | void egl_display_t::addObject(egl_object_t* object) { |
| 83 | Mutex::Autolock _l(lock); |
| 84 | objects.add(object); |
| 85 | } |
| 86 | |
Mathias Agopian | 5b287a6 | 2011-05-16 18:58:55 -0700 | [diff] [blame] | 87 | void egl_display_t::removeObject(egl_object_t* object) { |
| 88 | Mutex::Autolock _l(lock); |
| 89 | objects.remove(object); |
| 90 | } |
| 91 | |
Mathias Agopian | f0480de | 2011-11-13 20:50:07 -0800 | [diff] [blame] | 92 | bool egl_display_t::getObject(egl_object_t* object) const { |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 93 | Mutex::Autolock _l(lock); |
| 94 | if (objects.indexOf(object) >= 0) { |
Mathias Agopian | f0480de | 2011-11-13 20:50:07 -0800 | [diff] [blame] | 95 | if (object->getDisplay() == this) { |
| 96 | object->incRef(); |
| 97 | return true; |
| 98 | } |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 99 | } |
| 100 | return false; |
| 101 | } |
| 102 | |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 103 | EGLDisplay egl_display_t::getFromNativeDisplay(EGLNativeDisplayType disp) { |
| 104 | if (uintptr_t(disp) >= NUM_DISPLAYS) |
| 105 | return NULL; |
| 106 | |
| 107 | return sDisplay[uintptr_t(disp)].getDisplay(disp); |
| 108 | } |
| 109 | |
| 110 | EGLDisplay egl_display_t::getDisplay(EGLNativeDisplayType display) { |
| 111 | |
| 112 | Mutex::Autolock _l(lock); |
| 113 | |
| 114 | // get our driver loader |
| 115 | Loader& loader(Loader::getInstance()); |
| 116 | |
Mathias Agopian | ada798b | 2012-02-13 17:09:30 -0800 | [diff] [blame] | 117 | egl_connection_t* const cnx = &gEGLImpl; |
| 118 | if (cnx->dso && disp.dpy == EGL_NO_DISPLAY) { |
| 119 | EGLDisplay dpy = cnx->egl.eglGetDisplay(display); |
| 120 | disp.dpy = dpy; |
| 121 | if (dpy == EGL_NO_DISPLAY) { |
| 122 | loader.close(cnx->dso); |
| 123 | cnx->dso = NULL; |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 124 | } |
| 125 | } |
| 126 | |
| 127 | return EGLDisplay(uintptr_t(display) + 1U); |
| 128 | } |
| 129 | |
| 130 | EGLBoolean egl_display_t::initialize(EGLint *major, EGLint *minor) { |
| 131 | |
| 132 | Mutex::Autolock _l(lock); |
| 133 | |
| 134 | if (refs > 0) { |
| 135 | if (major != NULL) |
| 136 | *major = VERSION_MAJOR; |
| 137 | if (minor != NULL) |
| 138 | *minor = VERSION_MINOR; |
| 139 | refs++; |
| 140 | return EGL_TRUE; |
| 141 | } |
| 142 | |
| 143 | #if EGL_TRACE |
| 144 | |
| 145 | // Called both at early_init time and at this time. (Early_init is pre-zygote, so |
| 146 | // the information from that call may be stale.) |
| 147 | initEglTraceLevel(); |
Siva Velusamy | b13c78f | 2012-03-09 14:51:28 -0800 | [diff] [blame] | 148 | initEglDebugLevel(); |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 149 | |
| 150 | #endif |
| 151 | |
| 152 | setGLHooksThreadSpecific(&gHooksNoContext); |
| 153 | |
| 154 | // initialize each EGL and |
| 155 | // build our own extension string first, based on the extension we know |
| 156 | // and the extension supported by our client implementation |
Mathias Agopian | ada798b | 2012-02-13 17:09:30 -0800 | [diff] [blame] | 157 | |
| 158 | egl_connection_t* const cnx = &gEGLImpl; |
| 159 | cnx->major = -1; |
| 160 | cnx->minor = -1; |
| 161 | if (cnx->dso) { |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 162 | |
| 163 | #if defined(ADRENO130) |
| 164 | #warning "Adreno-130 eglInitialize() workaround" |
| 165 | /* |
| 166 | * The ADRENO 130 driver returns a different EGLDisplay each time |
| 167 | * eglGetDisplay() is called, but also makes the EGLDisplay invalid |
| 168 | * after eglTerminate() has been called, so that eglInitialize() |
| 169 | * cannot be called again. Therefore, we need to make sure to call |
| 170 | * eglGetDisplay() before calling eglInitialize(); |
| 171 | */ |
| 172 | if (i == IMPL_HARDWARE) { |
Mathias Agopian | ada798b | 2012-02-13 17:09:30 -0800 | [diff] [blame] | 173 | disp[i].dpy = cnx->egl.eglGetDisplay(EGL_DEFAULT_DISPLAY); |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 174 | } |
| 175 | #endif |
| 176 | |
Mathias Agopian | ada798b | 2012-02-13 17:09:30 -0800 | [diff] [blame] | 177 | EGLDisplay idpy = disp.dpy; |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 178 | if (cnx->egl.eglInitialize(idpy, &cnx->major, &cnx->minor)) { |
Mathias Agopian | ada798b | 2012-02-13 17:09:30 -0800 | [diff] [blame] | 179 | //ALOGD("initialized dpy=%p, ver=%d.%d, cnx=%p", |
| 180 | // idpy, cnx->major, cnx->minor, cnx); |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 181 | |
| 182 | // display is now initialized |
Mathias Agopian | ada798b | 2012-02-13 17:09:30 -0800 | [diff] [blame] | 183 | disp.state = egl_display_t::INITIALIZED; |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 184 | |
| 185 | // get the query-strings for this display for each implementation |
Mathias Agopian | ada798b | 2012-02-13 17:09:30 -0800 | [diff] [blame] | 186 | disp.queryString.vendor = cnx->egl.eglQueryString(idpy, |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 187 | EGL_VENDOR); |
Mathias Agopian | ada798b | 2012-02-13 17:09:30 -0800 | [diff] [blame] | 188 | disp.queryString.version = cnx->egl.eglQueryString(idpy, |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 189 | EGL_VERSION); |
Mathias Agopian | ada798b | 2012-02-13 17:09:30 -0800 | [diff] [blame] | 190 | disp.queryString.extensions = cnx->egl.eglQueryString(idpy, |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 191 | EGL_EXTENSIONS); |
Mathias Agopian | ada798b | 2012-02-13 17:09:30 -0800 | [diff] [blame] | 192 | disp.queryString.clientApi = cnx->egl.eglQueryString(idpy, |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 193 | EGL_CLIENT_APIS); |
| 194 | |
| 195 | } else { |
Mathias Agopian | ada798b | 2012-02-13 17:09:30 -0800 | [diff] [blame] | 196 | ALOGW("eglInitialize(%p) failed (%s)", idpy, |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 197 | egl_tls_t::egl_strerror(cnx->egl.eglGetError())); |
| 198 | } |
| 199 | } |
| 200 | |
Mathias Agopian | 4b9511c | 2011-11-13 23:52:47 -0800 | [diff] [blame] | 201 | // the query strings are per-display |
| 202 | mVendorString.setTo(sVendorString); |
| 203 | mVersionString.setTo(sVersionString); |
| 204 | mClientApiString.setTo(sClientApiString); |
| 205 | |
Mathias Agopian | 7773c43 | 2012-02-13 20:06:08 -0800 | [diff] [blame] | 206 | // we only add extensions that exist in the implementation |
Mathias Agopian | 4b9511c | 2011-11-13 23:52:47 -0800 | [diff] [blame] | 207 | char const* start = sExtensionString; |
| 208 | char const* end; |
| 209 | do { |
| 210 | // find the space separating this extension for the next one |
| 211 | end = strchr(start, ' '); |
| 212 | if (end) { |
| 213 | // length of the extension string |
| 214 | const size_t len = end - start; |
Mathias Agopian | f3ae82d | 2011-11-16 16:49:25 -0800 | [diff] [blame] | 215 | if (len) { |
| 216 | // NOTE: we could avoid the copy if we had strnstr. |
| 217 | const String8 ext(start, len); |
Mathias Agopian | ada798b | 2012-02-13 17:09:30 -0800 | [diff] [blame] | 218 | // now look for this extension |
| 219 | if (disp.queryString.extensions) { |
| 220 | // if we find it, add this extension string to our list |
| 221 | // (and don't forget the space) |
| 222 | const char* match = strstr(disp.queryString.extensions, ext.string()); |
| 223 | if (match && (match[len] == ' ' || match[len] == 0)) { |
| 224 | mExtensionString.append(start, len+1); |
Mathias Agopian | f3ae82d | 2011-11-16 16:49:25 -0800 | [diff] [blame] | 225 | } |
Mathias Agopian | 4b9511c | 2011-11-13 23:52:47 -0800 | [diff] [blame] | 226 | } |
| 227 | } |
| 228 | // process the next extension string, and skip the space. |
| 229 | start = end + 1; |
| 230 | } |
| 231 | } while (end); |
| 232 | |
Jamie Gennis | aca51c0 | 2011-11-03 17:42:43 -0700 | [diff] [blame] | 233 | egl_cache_t::get()->initialize(this); |
| 234 | |
Mathias Agopian | 7773c43 | 2012-02-13 20:06:08 -0800 | [diff] [blame] | 235 | refs++; |
| 236 | if (major != NULL) |
| 237 | *major = VERSION_MAJOR; |
| 238 | if (minor != NULL) |
| 239 | *minor = VERSION_MINOR; |
| 240 | return EGL_TRUE; |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 241 | } |
| 242 | |
| 243 | EGLBoolean egl_display_t::terminate() { |
| 244 | |
| 245 | Mutex::Autolock _l(lock); |
| 246 | |
| 247 | if (refs == 0) { |
| 248 | return setError(EGL_NOT_INITIALIZED, EGL_FALSE); |
| 249 | } |
| 250 | |
| 251 | // this is specific to Android, display termination is ref-counted. |
| 252 | if (refs > 1) { |
| 253 | refs--; |
| 254 | return EGL_TRUE; |
| 255 | } |
| 256 | |
| 257 | EGLBoolean res = EGL_FALSE; |
Mathias Agopian | ada798b | 2012-02-13 17:09:30 -0800 | [diff] [blame] | 258 | egl_connection_t* const cnx = &gEGLImpl; |
| 259 | if (cnx->dso && disp.state == egl_display_t::INITIALIZED) { |
| 260 | if (cnx->egl.eglTerminate(disp.dpy) == EGL_FALSE) { |
| 261 | ALOGW("eglTerminate(%p) failed (%s)", disp.dpy, |
| 262 | egl_tls_t::egl_strerror(cnx->egl.eglGetError())); |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 263 | } |
Mathias Agopian | ada798b | 2012-02-13 17:09:30 -0800 | [diff] [blame] | 264 | // REVISIT: it's unclear what to do if eglTerminate() fails |
Mathias Agopian | ada798b | 2012-02-13 17:09:30 -0800 | [diff] [blame] | 265 | disp.state = egl_display_t::TERMINATED; |
Mathias Agopian | ada798b | 2012-02-13 17:09:30 -0800 | [diff] [blame] | 266 | res = EGL_TRUE; |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 267 | } |
| 268 | |
Mathias Agopian | 5b287a6 | 2011-05-16 18:58:55 -0700 | [diff] [blame] | 269 | // Mark all objects remaining in the list as terminated, unless |
| 270 | // there are no reference to them, it which case, we're free to |
| 271 | // delete them. |
| 272 | size_t count = objects.size(); |
Steve Block | 32397c1 | 2012-01-05 23:22:43 +0000 | [diff] [blame] | 273 | ALOGW_IF(count, "eglTerminate() called w/ %d objects remaining", count); |
Mathias Agopian | 5b287a6 | 2011-05-16 18:58:55 -0700 | [diff] [blame] | 274 | for (size_t i=0 ; i<count ; i++) { |
| 275 | egl_object_t* o = objects.itemAt(i); |
| 276 | o->destroy(); |
| 277 | } |
| 278 | |
| 279 | // this marks all object handles are "terminated" |
| 280 | objects.clear(); |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 281 | |
| 282 | refs--; |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 283 | return res; |
| 284 | } |
| 285 | |
Mathias Agopian | fb87e54 | 2012-01-30 18:20:52 -0800 | [diff] [blame] | 286 | void egl_display_t::loseCurrent(egl_context_t * cur_c) |
| 287 | { |
| 288 | if (cur_c) { |
Mathias Agopian | a4b2c04 | 2012-02-03 15:24:51 -0800 | [diff] [blame] | 289 | egl_display_t* display = cur_c->getDisplay(); |
| 290 | if (display) { |
| 291 | display->loseCurrentImpl(cur_c); |
| 292 | } |
| 293 | } |
| 294 | } |
Mathias Agopian | fb87e54 | 2012-01-30 18:20:52 -0800 | [diff] [blame] | 295 | |
Mathias Agopian | a4b2c04 | 2012-02-03 15:24:51 -0800 | [diff] [blame] | 296 | void egl_display_t::loseCurrentImpl(egl_context_t * cur_c) |
| 297 | { |
| 298 | // by construction, these are either 0 or valid (possibly terminated) |
| 299 | // it should be impossible for these to be invalid |
| 300 | ContextRef _cur_c(cur_c); |
| 301 | SurfaceRef _cur_r(cur_c ? get_surface(cur_c->read) : NULL); |
| 302 | SurfaceRef _cur_d(cur_c ? get_surface(cur_c->draw) : NULL); |
Mathias Agopian | fb87e54 | 2012-01-30 18:20:52 -0800 | [diff] [blame] | 303 | |
Mathias Agopian | a4b2c04 | 2012-02-03 15:24:51 -0800 | [diff] [blame] | 304 | { // scope for the lock |
| 305 | Mutex::Autolock _l(lock); |
Mathias Agopian | fb87e54 | 2012-01-30 18:20:52 -0800 | [diff] [blame] | 306 | cur_c->onLooseCurrent(); |
| 307 | |
Mathias Agopian | fb87e54 | 2012-01-30 18:20:52 -0800 | [diff] [blame] | 308 | } |
Mathias Agopian | a4b2c04 | 2012-02-03 15:24:51 -0800 | [diff] [blame] | 309 | |
| 310 | // This cannot be called with the lock held because it might end-up |
| 311 | // calling back into EGL (in particular when a surface is destroyed |
| 312 | // it calls ANativeWindow::disconnect |
| 313 | _cur_c.release(); |
| 314 | _cur_r.release(); |
| 315 | _cur_d.release(); |
Mathias Agopian | fb87e54 | 2012-01-30 18:20:52 -0800 | [diff] [blame] | 316 | } |
| 317 | |
| 318 | EGLBoolean egl_display_t::makeCurrent(egl_context_t* c, egl_context_t* cur_c, |
| 319 | EGLSurface draw, EGLSurface read, EGLContext ctx, |
| 320 | EGLSurface impl_draw, EGLSurface impl_read, EGLContext impl_ctx) |
| 321 | { |
Mathias Agopian | fb87e54 | 2012-01-30 18:20:52 -0800 | [diff] [blame] | 322 | EGLBoolean result; |
Mathias Agopian | a4b2c04 | 2012-02-03 15:24:51 -0800 | [diff] [blame] | 323 | |
| 324 | // by construction, these are either 0 or valid (possibly terminated) |
| 325 | // it should be impossible for these to be invalid |
| 326 | ContextRef _cur_c(cur_c); |
| 327 | SurfaceRef _cur_r(cur_c ? get_surface(cur_c->read) : NULL); |
| 328 | SurfaceRef _cur_d(cur_c ? get_surface(cur_c->draw) : NULL); |
| 329 | |
| 330 | { // scope for the lock |
| 331 | Mutex::Autolock _l(lock); |
Mathias Agopian | fb87e54 | 2012-01-30 18:20:52 -0800 | [diff] [blame] | 332 | if (c) { |
Mathias Agopian | a4b2c04 | 2012-02-03 15:24:51 -0800 | [diff] [blame] | 333 | result = c->cnx->egl.eglMakeCurrent( |
Mathias Agopian | ada798b | 2012-02-13 17:09:30 -0800 | [diff] [blame] | 334 | disp.dpy, impl_draw, impl_read, impl_ctx); |
Mathias Agopian | a4b2c04 | 2012-02-03 15:24:51 -0800 | [diff] [blame] | 335 | if (result == EGL_TRUE) { |
| 336 | c->onMakeCurrent(draw, read); |
| 337 | } |
| 338 | } else { |
| 339 | result = cur_c->cnx->egl.eglMakeCurrent( |
Mathias Agopian | ada798b | 2012-02-13 17:09:30 -0800 | [diff] [blame] | 340 | disp.dpy, impl_draw, impl_read, impl_ctx); |
Mathias Agopian | a4b2c04 | 2012-02-03 15:24:51 -0800 | [diff] [blame] | 341 | if (result == EGL_TRUE) { |
| 342 | cur_c->onLooseCurrent(); |
| 343 | } |
Mathias Agopian | fb87e54 | 2012-01-30 18:20:52 -0800 | [diff] [blame] | 344 | } |
| 345 | } |
Mathias Agopian | a4b2c04 | 2012-02-03 15:24:51 -0800 | [diff] [blame] | 346 | |
| 347 | if (result == EGL_TRUE) { |
| 348 | // This cannot be called with the lock held because it might end-up |
| 349 | // calling back into EGL (in particular when a surface is destroyed |
| 350 | // it calls ANativeWindow::disconnect |
| 351 | _cur_c.release(); |
| 352 | _cur_r.release(); |
| 353 | _cur_d.release(); |
| 354 | } |
| 355 | |
Mathias Agopian | fb87e54 | 2012-01-30 18:20:52 -0800 | [diff] [blame] | 356 | return result; |
| 357 | } |
Mathias Agopian | 518ec11 | 2011-05-13 16:21:08 -0700 | [diff] [blame] | 358 | |
| 359 | // ---------------------------------------------------------------------------- |
| 360 | }; // namespace android |
| 361 | // ---------------------------------------------------------------------------- |