Bug 1022059. Rewrite MergeRects in a saner, more like pixman style. r=mwoodrow

--HG--
extra : rebase_source : 8fdaf374b8757f33c7df8905a84ad1055a05a591