Merge "Optimize gatherTransparentRegions to account for transparent bg"