If two repaint boundaries mark themselves dirty, but the second one is a
child of the first, then the second one will get repainted by the first
and then when we come to paint it directly, we get confused because it
isn't dirty any more.
We ran into this in layout before. Apply the same fix. Also, apply the
same fix to composition while we're at it.