DirectCompositionChildSurfaceWin switches between IDCompositionSurface and swap chain depending on whether the current frame has overlays or not.
jbauman@ found that IDCompositionSurface is less power efficient than swap chains. This is the reason we use swap chain when there are no overlays. We should try to use
IDCompositionSurface is required if we want to synchronize presentation (and rendering) with DirectComposition visual tree commit. This is needed if updating the visual tree exposes out of date (or unrendered) regions of the root surface. This can happen in two cases:
1) Video overlay changes its bounds on screen.
2) Window is resized.
For case 1) we should fallback to GLRenderer if the video bounds change with one caveat: we should manually synchronize swap chain presentation when switching between overlays and GLRenderer. We do this today for the "first present" of the swap chain which happens when recreating the swap chain after switching.
For case 2) we don't need to handle it separately because we already synchronize presentation because we recreate the swap chain on resize.
Additional benefits of this change would be:
1) Being able to always use swap chain presentation feedback. We want to replace GPU fence based feedback which has high CPU usage with this.
2) Code simplification: the logic to switch is pretty complicated.
First step would be to measure the power difference. Should be easy to disable the IDCompositionSurface path.