Turns out the clipping needed a lot of attention, especially using transformed components (e.g. ComponentTransformsDemo). Direct2D does support rectangular clipping, but that clips differently when transformed (see PushAxisAlignedClip), so that won’t work.
I rewrote all the clipping to use geometry layers, which cleaned the code up nicely. I’ll need to test the performance more thoroughly, but so far it works fine.
I found a bug in the path rendering; every call to ID2D1GeometrySink::BeginFigure needs to be matched with a call to EndFigure, but sometimes JUCE paths can have a startNewSubPath marker without a matching closePath (see the toolbar tab in the WidgetsDemo). That just needed a little extra logic.
restoreState wasn’t restoring the last brush color; that’s fixed. There are probably other issues with popping the Graphics stack and restoring the previous state properly.
All pushed to Github.