RFR: 8322619: Parts of SG no longer update during rendering - overlapping - culling - dirty [v4]
Ambarish Rapte
arapte at openjdk.org
Wed Jul 3 20:29:23 UTC 2024
On Wed, 3 Jul 2024 16:26:39 GMT, eduardsdv <duke at openjdk.org> wrote:
>> This is an alternative solution to the PR: https://github.com/openjdk/jfx/pull/1310.
>>
>> This solution is based on the invariant that if a node is marked as dirty, all ancestors must also be marked as dirty and that if an ancestor is marked as clean, all descendants must also be marked as clean.
>> Therefore I removed the ``clearDirtyTree()`` method and put its content to the ``clearDirty()`` method.
>>
>> Furthermore, since dirty flag is only used when rendering by ``ViewPainter``, it should also be deleted by ``ViewPainter`` only.
>> This guarantees:
>> 1. that all dirty flags are removed after rendering, and
>> 2. that no dirty flags are removed when a node is rendered, e.g. by creating a snapshot or printing.
>> Therefore I removed all calls of the methods ``clearDirty()`` and ``clearDirtyTree()`` from all other classes except the ``ViewerPainter``.
>>
>> The new version of the ``clearDirty()`` method together with calling it from the ``ViewerPainter`` needs to visit far fewer nodes compared to the version prior this PR.
>>
>> The supplied test checks that the nodes are updated even if they are partially covered, which led to the error in the version before the PR. The test can be started with:
>> ``gradlew -PFULL_TEST=true -PUSE_ROBOT=true :systemTests:test --tests NGNodeDirtyFlagTest``
>
> eduardsdv has updated the pull request incrementally with four additional commits since the last revision:
>
> - JDK-8322619: Move to the test.robot.com.sun.prism package and use TOLERANCE when comparing colors
> - JDK-8322619: Add copyright header
> - JDK-8322619: Add waiting for rendering before taking a snapshot
> - JDK-8322619: Remove unused field; Add stage.setAlwaysOnTop(..); stage.initStyle(..)
The newer version still fails on my Mac machine.
Attaching modified test that executes as expected on my Windows and Mac machines.
The main change that makes it work on Mac is the change in `checkColor()` method.
There are some additional minor changes, and I recommend to keep those.
Please do test on your machines.
[NGNodeDirtyFlagTest.java.zip](https://github.com/user-attachments/files/16090444/NGNodeDirtyFlagTest.java.zip)
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1451#issuecomment-2207192990
More information about the openjfx-dev
mailing list