On Tue, 20 Feb 2024 05:36:55 GMT, Tejesh R <t...@openjdk.org> wrote:

>> Since this is an intermediate buffer its content should not affect the 
>> rendering, so it should contain only the image rendered by the component 
>> itself.
>
> 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 iside 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).

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

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

Reply via email to