summaryrefslogtreecommitdiffstats
path: root/opengl
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-11-04 13:46:42 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-11-04 13:46:42 -0800
commitbd514158317c578194147963ba4ccbd53c19f8c8 (patch)
tree54a0e9a184ff2a5e4048855263548625d56c4cca /opengl
parent6a789e7e9eef94502b440e7e18b85a474e34cebd (diff)
parent4e88a07f971db53be9d52c33d4a279fed137d5d6 (diff)
downloadframeworks_native-bd514158317c578194147963ba4ccbd53c19f8c8.zip
frameworks_native-bd514158317c578194147963ba4ccbd53c19f8c8.tar.gz
frameworks_native-bd514158317c578194147963ba4ccbd53c19f8c8.tar.bz2
am 43606242: am 8e5e44e9: am 9a54d7dd: Merge change Ibbf945f3 into eclair
Merge commit '4360624241251035534a46449e23be38d9e6b03c' * commit '4360624241251035534a46449e23be38d9e6b03c': fix [2236832] software OpenGL ES driver doesn't work on sholes
Diffstat (limited to 'opengl')
-rw-r--r--opengl/libagl/egl.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp
index 80ddc02..b522e11 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;
}