Better performance with rounded corners/shadows?


Ok, my understanding of JUCE rendering is that it uses a single native window, then JUCE handles all components (or “soft-windows”) inside that window. On Win32 this is problematic with non-opaque native window since UpdateLayeredWindow is used to draw the native window. To have nice looking rounded corners or cool shadowing effect this is needed but has a MAJOR drawback in performance (when doing a lot of redraws in the window).

One way to overcome this would be to have the possibility within JUCE to have a native window inside the main native window, so that the main native window is transparent, but the child window (with say 8 pixels margin inward) is not. This would make the transparent window only redraw whenever a change is made in that window (which would be like when the window is moved, or drawn into which would be done only at application start), but not if drawing is done inside the child window which is opaque. But can this be done, or are there aspects I have not thought of?


Yes, it’s a bit of a pain, though when vista is more established, I imagine the problem will go away.

You could probably embed an opaque window, though it’d be pretty messy to work out which bits get drawn in which window. That’s assuming, of course, that opaque windows actually work properly inside transparent ones, which isn’t certain, as the whole transparency thing is basically a big MS hack.