RFR: 8377426: Adjust scene background to color scheme [v2]
Michael Strauß
mstrauss at openjdk.org
Thu Feb 12 23:01:54 UTC 2026
On Thu, 12 Feb 2026 22:09:12 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
> I've updated https://github.com/andy-goryachev-oracle/Test/blob/main/src/goryachev/bugs/Stage_Background_8377426.java with your examples, below are the results:
The flashes you're still observing are probably not black or white, but a mid-grey (which is the average color of the linear gradient). With gradients where one end is really bright and the other end is really dark, there's no good single-color approximation.
> Well, it does look better (if for a split second). I still not sure if it's worth all the additional code, but at least it's java and not native.
>
> Do you know why it has to flash in the first place? Why can't it render the content and _then_ show it?
The reason is that we ask the OS to open up a window, and after the window is shown, JavaFX begins to render the first image. So there's a natural delay between the window opening up and the arrival of the first pixels. I'm not aware of a way to reliably delay the window until the first frame is ready, because we need a window buffer to render the image (a D3D swap chain, or a Metal drawable), and that buffer is usually not available until the window is shown.
Another variant of the same problem is live resizing of a window, where you can sometimes observe that the rendered content lags behind the size of the window. On Windows, this effect is visible in almost all applications.
-------------
PR Comment: https://git.openjdk.org/jfx/pull/2068#issuecomment-3893864277
More information about the openjfx-dev
mailing list