On Thu, 21 Dec 2023 12:57:01 GMT, Florian Kirmaier <fkirma...@openjdk.org> 
wrote:

>> In some situations, a part of the SG is no longer rendered.
>> I created a test program that showcases this problem.
>> 
>> Explanation:
>> 
>> This can happen, when a part of the SG, is covered by another Node.
>> In this part, one node is totally covered, and the other node is visible.
>> 
>> When the totally covered Node is changed, then it is marked dirty and it's 
>> parent, recursively until an already dirty node is found.
>> Due to the Culling, this totally covered Node is not rendered - with the 
>> effect that the tree is never marked as Clean.
>> 
>> In this state, a Node is Dirty but not It's parent. Based on my CodeReview, 
>> this is an invalid state which should never happen.
>> 
>> In this invalid state, when the other Node is changed, which is visible, 
>> then the dirty state is no longer propagated upwards - because the recursive 
>> "NGNode.markTreeDirty" algorithm encounters a dirty node early.
>> 
>> This has the effect, that any SG changes in the visible Node are no longer 
>> rendered. Sometimes the situation repairs itself.
>> 
>> Useful parameters for further investigations:
>> -Djavafx.pulseLogger=true
>> -Dprism.printrendergraph=true
>> -Djavafx.pulseLogger.threshold=0
>> 
>> PR:
>> This PR ensures the dirty flag is set to false of the tree when the culling 
>> is used.
>> It doesn't seem to break any existing tests - but I'm not sure whether this 
>> is the right way to fix it.
>> It would be great to have some feedback on this solution - maybe guiding me 
>> to a better solution.
>> 
>> I could write a test, that just does the same thing as the test application, 
>> but checks every frame that these nodes are not dirty - but maybe there is a 
>> better way to test this.
>
> Florian Kirmaier has refreshed the contents of this pull request, and 
> previous commits have been removed. The incremental views will show 
> differences compared to the previous content of the PR. The pull request 
> contains one new commit since the last revision:
> 
>   JDK-8322619 Fix for rendering bug, related to overlap - culling - dirtynodes

I'd like to see an automated (probably robot-based) test, if it is feasible.

This will need careful review. 

Reviewers: @arapte @lukostyra

.idea/jpa-buddy.xml line 1:

> 1: <?xml version="1.0" encoding="UTF-8"?>

Please revert the addition of this file.

modules/javafx.graphics/src/main/java/com/sun/javafx/sg/prism/NGNode.java line 
2006:

> 2004:                     // If no culling bits are set for this region, this 
> group
> 2005:                     // does not intersect (nor is covered by) the region
> 2006:                     clearDirtyTree();

We'll need to look at this closely to ensure that there are no functional 
regressions, and that the performance impact is minimal.

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

PR Review: https://git.openjdk.org/jfx/pull/1310#pullrequestreview-1793117605
PR Review Comment: https://git.openjdk.org/jfx/pull/1310#discussion_r1434166637
PR Review Comment: https://git.openjdk.org/jfx/pull/1310#discussion_r1434169228

Reply via email to