Component opaque mask

I had an idea, thought I’d put it out there in case there is any merit to it. If not, sorry for wasting time.

I often have child components that hold a bunch of controls. Think panels that hold sliders, etc. these panels may have rounded edges and sit over other elements in a gui that could trigger a repaint event. Now because of a few pixels of transparency in the corners, this panel and all its children can easily end up repainting themselves, when in reality only the corners have new pixels.

Would it be possible to implement something similar to what hitTest() does for mouse events? Where we can override some form of getOpaqueArea() to see if updates are required based on areas that are actually transparent, rather than it being a binary option on the whole component?