There are two steps in “repainting” a translucent Swing window on Windows. First is to render swing stuff into the swing back buffer, the second is to update the window representation using win32’s UpdateLayeredWindow.
Prior to 6u18 on any update we’d repaint whole window into the backbuffer. So even if you had a blinking cursor, it’d re-render the whole thing. So that’s fixed in 6u18 (btw, you could try it out http://download.java.net/jdk6/binaries/ ) - it only repaints what’s needed into the persistent back-buffer. This does help, especially if repainting itself is costly (like in case of javafx apps where there could be effects and transforms and stuff).
But we still have to copy whole back buffer into the layered window. AFAIK there’s no way to update only a part of layered window., so the whole window has to be updated every time. The sucky part is that the swing backbuffer could be in vram, which means that sucking it in and copying into a layered window through system memory could be very slow (better on pcix bus, which is where we let the hw-acceleration enabled for translucent windows). You’d think we could always disable hw accelerated backbuffer for translucent windows and save ourselves a vram->sysmem copy, but it’d be very bad for JavaFX apps which need hw acceleration for effects (otherwise they’d be done in software, which is even slower than copying from vram to system).
Basically, on Windows layered windows were never intended to be used for animated content (especially for larger sizes windows). This is from msdn docs for LayeredWindows: “For best drawing performance by the layered window and any underlying windows, the layered window should be as small as possible.”. But apparently designers looove rounder corners on their windows, so they just slap it on without any concern for performance implications (just like they should), but engineering is supposed keep them in reign…
Dmitri