Bug 1049138 - Use the cairo surface format to determine gfx format when able. r=jmuizelaar, a=bajaj