Well, GradientRectangles seem to be the thing slowing down the KH2 demo. I have a plan though... It involves creating a static gradient texture, preferably the size of the screen and then scaling it to the places I want it blitted... It might just do well enough or completely fail. The bad thing is the worst case secnario is that each frame the colors change: such as a gradient background fading from one color to the next. I don't know what else... I might have to create a custom GLSL shader for fast gradients.
I have no idea how you are doing it, but in ye-olde software-rendering TurboSphere I was doing pretty well with just doing a pixel-by-pixel, line-by-line gradient rectangle. Just vertical gradient lines, each one having the top and bottom colors of the top and bottom colors respectively blended with weighting.
Also...in OpenGL I am now just using array drawing and four unsigned byte colors. Of course, the array drawing technique (which I use exclusively, unfortunately) is very fast approaching (if not already) deprecated OpenGL. But it is very, very fast. I'm 100% sure there is a way to do this using buffer objects and GL, no custom shaders just for it (and still very fast). But I really need to learn to properly use buffers before I could show how it would be done!
Well, at least I'm happy that windowstyles don't have an off by one issue, even on 2x scaling. However, lines are not scaling. In OpenGL, lines are not pixels per-se they are entities. I'll need to find a good way of drawing pixel-sized lines.
I hear you, I've got the same problem. It really bothers me that the end points of lines simply cannot be specified as pixels proper, and so all my lines go to pixel corners (this causes off-by-one problems in very certain circumstances in TurboSphere, but only with lines that aren't straight). But what really grinds my gears, and this is my only complaint against OpenGL, is how line drawing affects scaling.
You can set the GL Line Size. But it changes the width, which is not precisely what I expect from 2x scaling, I want each 'pixel' as the engine sees it to be a 2x2 pixel block, and draw the same with that in mind as it would without scaling.
My best solution so far is to just use Bresenham's algorithm (with an assumed half resolution), double the point size, and blit a series of points...but even then, things like triangles, circles (any poly, really), transform or rotate blits, and textures still aren't properly drawn as if the whole resolution is just half what it actually is. Honestly I think that a shader is the best solution to this, I've come to the conclusion that there's nothing built directly into OpenGL that does this properly (and fast enough!)
I did try doing all drawing on a framebuffer and drawing that to the screen at double res, but that is one: slower than I expected (by far) and two: still not perfect.