Initial attempt at dirty rectangle checking (performanceMode)

As discussed over in issue #1470