diff options
Diffstat (limited to 'opengl')
-rw-r--r-- | opengl/include/EGL/android_natives.h | 9 | ||||
-rw-r--r-- | opengl/libagl/egl.cpp | 19 | ||||
-rw-r--r-- | opengl/libagl/texture.cpp | 21 |
3 files changed, 15 insertions, 34 deletions
diff --git a/opengl/include/EGL/android_natives.h b/opengl/include/EGL/android_natives.h index 8db2bb3..b8465d5 100644 --- a/opengl/include/EGL/android_natives.h +++ b/opengl/include/EGL/android_natives.h @@ -157,13 +157,12 @@ struct android_native_buffer_t int stride; int format; int usage; + + void* reserved[2]; - void* reserved[3]; - - int (*getHandle)(struct android_native_buffer_t const * base, - buffer_handle_t* handle); + buffer_handle_t handle; - void* reserved_proc[7]; + void* reserved_proc[8]; }; diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp index 67dfd3e..720ba0b 100644 --- a/opengl/libagl/egl.cpp +++ b/opengl/libagl/egl.cpp @@ -274,26 +274,14 @@ 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; - buffer_handle_t bufferHandle; - err = buf->getHandle(buf, &bufferHandle); - if (err < 0) - return err; - - err = module->lock(module, bufferHandle, + int err = module->lock(module, buf->handle, usage, 0, 0, buf->width, buf->height, vaddr); return err; } status_t egl_window_surface_v2_t::unlock(android_native_buffer_t* buf) { - int err; - buffer_handle_t bufferHandle; - err = buf->getHandle(buf, &bufferHandle); - if (err < 0) - return err; - - err = module->unlock(module, bufferHandle); + int err = module->unlock(module, buf->handle); return err; } @@ -379,8 +367,7 @@ EGLBoolean egl_window_surface_v2_t::bindDrawSurface(ogles_context_t* gl) #ifdef LIBAGL_USE_GRALLOC_COPYBITS gl->copybits.drawSurfaceFd = -1; if (supportedCopybitsDestinationFormat(buffer.format)) { - buffer_handle_t handle; - this->buffer->getHandle(this->buffer, &handle); + buffer_handle_t handle = this->buffer->handle; if (handle != NULL) { private_handle_t* hand = private_handle_t::dynamicCast(handle); if (hand != NULL) { diff --git a/opengl/libagl/texture.cpp b/opengl/libagl/texture.cpp index 9bcbfdd..1189643 100644 --- a/opengl/libagl/texture.cpp +++ b/opengl/libagl/texture.cpp @@ -139,10 +139,9 @@ void ogles_lock_textures(ogles_context_t* c) gralloc_module_t const* module = reinterpret_cast<gralloc_module_t const*>(pModule); - buffer_handle_t bufferHandle; - native_buffer->getHandle(native_buffer, &bufferHandle); + void* vaddr; - int err = module->lock(module, bufferHandle, + int err = module->lock(module, native_buffer->handle, GRALLOC_USAGE_SW_READ_OFTEN, 0, 0, native_buffer->width, native_buffer->height, &vaddr); @@ -168,9 +167,8 @@ void ogles_unlock_textures(ogles_context_t* c) gralloc_module_t const* module = reinterpret_cast<gralloc_module_t const*>(pModule); - buffer_handle_t bufferHandle; - native_buffer->getHandle(native_buffer, &bufferHandle); - module->unlock(module, bufferHandle); + + module->unlock(module, native_buffer->handle); u.texture->setImageBits(NULL); c->rasterizer.procs.bindTexture(c, &(u.texture->surface)); } @@ -1547,13 +1545,10 @@ void glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image) */ #ifdef LIBAGL_USE_GRALLOC_COPYBITS tex->copybits_fd = -1; - buffer_handle_t handle; - if (native_buffer->getHandle(native_buffer, &handle) == 0) { - private_handle_t* hand; - if ((hand = private_handle_t::dynamicCast(handle)) != NULL) { - if (hand->usesPhysicallyContiguousMemory()) { - tex->copybits_fd = hand->fd; - } + private_handle_t* hand; + if ((hand = private_handle_t::dynamicCast(native_buffer->handle)) != NULL) { + if (hand->usesPhysicallyContiguousMemory()) { + tex->copybits_fd = hand->fd; } } #endif // LIBAGL_USE_GRALLOC_COPYBITS |