On Fri, 27 Aug 2021 17:34:25 GMT, Jose Pereda <jper...@openjdk.org> wrote:

>> I'm more worried about correctness than performance. Setting a clip does not 
>> necessarily imply that the clipped region should be cleared. So this feels a 
>> bit like a workaround for a missing `clearRect` elsewhere. I wonder if there 
>> is code somewhere that assumes that if the fill color is fully transparent 
>> it can skip the call to `clearRect`?
>
> I guess the assumption might be the other way around? Since the fill color 
> was not transparent, there was no need to clear the area, when rendering the 
> same solid rect at the new position?
> 
> If you check this 
> [comment](https://bugs.openjdk.java.net/browse/JDK-8090547?focusedCommentId=13808421&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13808421),
>  there is already a mention that `WCPageBackBufferImpl::copyArea` doesn't 
> care about the alpha channel.
> 
> The proposed patch: 
> 
>  texture.createGraphics().clearQuad(x+dx, y+dy, x+dx+w, y+dy+h);
> 
>  could work if we could apply it conditionally only for alpha == 0 (or maybe 
> also for alpha < 1).
> 
> My current approach with `clearRect` ultimately calls `clearQuad`, so both 
> might be doing the same after all.

I don't doubt that the area should be cleared. What I was questioning is 
whether this was the best place to do it? I'd be OK with it if you document it.

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

PR: https://git.openjdk.java.net/jfx/pull/563

Reply via email to