I finally had spent some time on this, and I do think it should be greatly simplified. See attached diff, on top of this MR. With it I get some failures running on Wine, and that's because of how we handle DEFAULT target type - it should be resolved to either HW or SW. The thing is that on Windows without physical GPU you still get two adapters, one marked software. Another failure I get is for supported formats, and for that on Windows, I get only two formats working - DXGI_FORMAT_R8G8B8A8_UNORM and DXGI_FORMAT_B8G8R8A8_UNORM, anything else fails.
I'll take a look at other target types next, @zhiyi let me know what you think. Tests should be also reduced, for example we don't need to iterate over large number of possible formats, I don't think it's useful.
[0001-d2d-hwnd_target-Simplify-IsSupported.txt](/uploads/db2d7523f532ebe577e42e7a23625d43/0001-d2d-hwnd_target-Simplify-IsSupported.txt)