public static void addDirtyRegion( JComponent c, int x, int y, int width, int height, DirtyRegionCallback callback ) {
		if( needsSpecialRepaint( c, x, y, width, height ) ) {
			int x2 = x + c.getX();
			int y2 = y + c.getY();
			for( Component p = c.getParent(); p != null; p = p.getParent() ) {
				if( x2 + width < p.getWidth() && y2 + height < p.getHeight() && p instanceof JComponent ) {
					callback.addDirtyRegion( (JComponent) p, x2, y2, width, height );
					return;
				}
				x2 += p.getX();
				y2 += p.getY();
			}
		}

		callback.addDirtyRegion( c, x, y, width, height );
	}
Similar to {@link #repaint(Component, int, int, int, int)},
but invokes callback instead of invoking {@link Component#repaint(int, int, int, int)}.
<p>
For use in custom repaint managers.

@since 3.5
flatlaf-core/src/main/java/com/formdev/flatlaf/util/HiDPIUtils.java