Here’s an updated masking patch that should apply cleanly against current trunk: masking-03.diff
Note that in this update, material colors aren’t working correctly. I’m pondering how best to address this and other drawing problems now.
Past couple days I’ve been committing some code cleanups to the non-sculpt drawing code. It’s still a lot of code to wade through, but it’s at least a little less verbose now.