This is based on code from Sway, which is also MIT licensed hence compatible. This makes the surface damaging and rendering code easier to follow and makes it easier to import future changes to Sway as well.