Merge change Ibbf945f3 into eclair
* changes: fix [2236832] software OpenGL ES driver doesn't work on sholes
This commit is contained in:
@@ -40,6 +40,7 @@
|
|||||||
#include <pixelflinger/pixelflinger.h>
|
#include <pixelflinger/pixelflinger.h>
|
||||||
|
|
||||||
#include <private/ui/android_natives_priv.h>
|
#include <private/ui/android_natives_priv.h>
|
||||||
|
#include <private/ui/sw_gralloc_handle.h>
|
||||||
|
|
||||||
#include <hardware/copybit.h>
|
#include <hardware/copybit.h>
|
||||||
|
|
||||||
@@ -449,15 +450,26 @@ void egl_window_surface_v2_t::disconnect()
|
|||||||
status_t egl_window_surface_v2_t::lock(
|
status_t egl_window_surface_v2_t::lock(
|
||||||
android_native_buffer_t* buf, int usage, void** vaddr)
|
android_native_buffer_t* buf, int usage, void** vaddr)
|
||||||
{
|
{
|
||||||
int err = module->lock(module, buf->handle,
|
int err;
|
||||||
usage, 0, 0, buf->width, buf->height, vaddr);
|
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;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
status_t egl_window_surface_v2_t::unlock(android_native_buffer_t* buf)
|
status_t egl_window_surface_v2_t::unlock(android_native_buffer_t* buf)
|
||||||
{
|
{
|
||||||
if (!buf) return BAD_VALUE;
|
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;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user