diff options
| author | 2009-11-04 15:45:39 -0500 | |
|---|---|---|
| committer | 2009-11-04 15:45:39 -0500 | |
| commit | d5bee934312bf339e6fd2eff118d7bb63bf944ce (patch) | |
| tree | aee28b171b44bad968e739cd2252e00bae0bd99e /opengl/libagl/egl.cpp | |
| parent | 495560eab97ff3c2283fd4a4367ff379629b8543 (diff) | |
| parent | bc4929117d0b07fec2f0986f38641eecc9f20d55 (diff) | |
Merge change Ibbf945f3 into eclair
* changes:
fix [2236832] software OpenGL ES driver doesn't work on sholes
Diffstat (limited to 'opengl/libagl/egl.cpp')
| -rw-r--r-- | opengl/libagl/egl.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp index 80ddc0280f..b522e112e7 100644 --- a/opengl/libagl/egl.cpp +++ b/opengl/libagl/egl.cpp @@ -40,6 +40,7 @@ #include <pixelflinger/pixelflinger.h> #include <private/ui/android_natives_priv.h> +#include <private/ui/sw_gralloc_handle.h> #include <hardware/copybit.h> @@ -449,15 +450,26 @@ void egl_window_surface_v2_t::disconnect() status_t egl_window_surface_v2_t::lock( android_native_buffer_t* buf, int usage, void** vaddr) { - int err = module->lock(module, buf->handle, - usage, 0, 0, buf->width, buf->height, vaddr); + int err; + if (sw_gralloc_handle_t::validate(buf->handle) < 0) { + err = module->lock(module, buf->handle, + usage, 0, 0, buf->width, buf->height, vaddr); + } else { + sw_gralloc_handle_t const* hnd = + reinterpret_cast<sw_gralloc_handle_t const*>(buf->handle); + *vaddr = (void*)hnd->base; + err = NO_ERROR; + } return err; } status_t egl_window_surface_v2_t::unlock(android_native_buffer_t* buf) { if (!buf) return BAD_VALUE; - int err = module->unlock(module, buf->handle); + int err = NO_ERROR; + if (sw_gralloc_handle_t::validate(buf->handle) < 0) { + err = module->unlock(module, buf->handle); + } return err; } |