May 2017
Beginner to intermediate
470 pages
10h 49m
English
As we mentioned previously, the Gralloc module can be used to allocate and release graphic buffers. Now that we have learnt how to allocate buffers from framebuffer devices or system memory, let's have a look at how to release graphic buffers.
To release graphic buffers, the gralloc_free function is used:
static int gralloc_free(alloc_device_t* dev, buffer_handle_t handle) { if (private_handle_t::validate(handle) < 0) return -EINVAL; private_handle_t const* hnd = reinterpret_cast<private_handle_t const*> (handle); if (hnd->flags & private_handle_t::PRIV_FLAGS_FRAMEBUFFER) { // free this buffer private_module_t* m = reinterpret_cast<private_module_t*>( dev->common.module); const size_t bufferSize = m->finfo.line_length ...Read now
Unlock full access