Changes

Jump to: navigation, search

Platform/GFX/Gralloc

542 bytes added, 18:41, 16 May 2013
How Gralloc buffers are created and refcounted (non Mozilla-specific)
The GraphicBuffer constructors take a "usage" bitfield. We should always pass HW_TEXTURE there, as we always want to use gralloc buffers as the backing surface of OpenGL textures. We also want to pass the right SW_READ_ and SW_WRITE_ flags.
 
The usage flag is some kind of hint for performance optimization. When you use SW flags, it may just disable all possible optimize there. Since CPU usually cache data into register, when we want to lock the buffer for read/write, it have to maintain the cache for correct data. However, other hardware that can use GraphicBuffer on Android e.g. Codec, Camera, GPU do not cache data. It locks/unlocks the buffer in a faster fashion.
 
It may helps on perforamce if we can use the usage flag correctly to describe our purpose about the buffer.
== How we create Gralloc buffers ==
Confirm
157
edits

Navigation menu