RFR: 8187759: Background not refreshed when painting over a transparent JFrame [v4]

Tejesh R tr at openjdk.org
Tue Feb 20 07:56:54 UTC 2024


On Tue, 20 Feb 2024 07:21:18 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> This how it is done in  [RepaintManager](https://github.com/openjdk/jdk/blob/69a11c7f7ea7c4195a8ee56391bdf04c75bd8156/src/java.desktop/share/classes/javax/swing/RepaintManager.java#L1711), it uses background color of the component.
>
> That code was added by me to implement the shaped windows on macOS, that is the only platform we support the translucent backbuffer in RepaintManager. For the translucent backbuffer and even opaque component it is necessary to clear its content since the rendering inside of the components assumes the simple "fillrect" will clear the component which is not true if the composite is not Src.
> But probably at that place we always start rendering from the Window? in that case the usage of background is a right thing. I am not sure that the usage of the component background is a correct thing, and probably 0,0,0 should work better. 
> 
> I suggest to check that we do not fill the background twice, by the code added in the patch, and the code inside of the paintToOffscreen(). For example if there are the container and the component inside, if the component is not opaque and has no any content, will the container be fully visible? or we will see the background of the component(which should not be there).

Yeah, got your point. I will check that whether background is not filled twice. If yes then we have to use 0,0,0 to fill background else we will retain the component background color.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/17081#discussion_r1495375909


More information about the client-libs-dev mailing list