imported patch from bug 959089, separate graphic buffer allocation
Add kitkat fixups and logging