From 21c59d0070fe24a8e04e52ce04d511a924a9932f Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Tue, 5 May 2009 00:59:23 -0700 Subject: get rid of android_native_buffer_t::getHandle() and replace it with an handle field this abstraction was not necessary. things are easier now. --- opengl/libagl/texture.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'opengl/libagl/texture.cpp') diff --git a/opengl/libagl/texture.cpp b/opengl/libagl/texture.cpp index 9bcbfdd244..118964340f 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(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(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 -- cgit v1.2.3-59-g8ed1b