Refactor gralloc to reduce usage of global variables and remove macros am: 42b24c4513 am: 07c8ed8581
am: 35c5c0b62a

Change-Id: If4b902bad0621d9fa6e68163b803d39207f6b7a3