Merge "Add correct damage and visible regions for cached buffers." into sc-dev