GradientFill can be implemented by drawing to a DIB, and then blting that DIB to the screen. This will reduce the number of calls to X from O(n) to O(1).
1. Is that a good idea? Any caveats? 2. Can that method be used elsewhere?
I'll try to implement it right away.
P.S. We do implement the alpha part of GradientFill the same as Windows. The comments might sugest otherwise.