changed dirty regions to use CGRect