RFR: 8238954: Improve performance of tiled snapshot rendering [v16]
kcr at openjdk.java.net
Wed Jul 1 17:54:31 UTC 2020
On Wed, 1 Jul 2020 16:20:53 GMT, Frederic Thevenet <github.com+7450507+fthevenet at openjdk.org> wrote:
>> Issue JDK-8088198, where an exception would be thrown when trying to capture a snapshot whose final dimensions would be
>> larger than the running platform's maximum supported texture size, was addressed in openjfx14. The fix, based around
>> the idea of capturing as many tiles of the maximum possible size and re-compositing the final snapshot out of these, is
>> currently only attempted after the original, non-tiled, strategy has already failed. This was decided to avoid any risk
>> of regressions, either in terms of performances and correctness, while still offering some relief to the original
>> issue. This follow-on issue aims to propose a fix to the original issue, that is able to correctly decide on the best
>> snapshot strategy (tiled or not) to adopt before applying it and ensure best performances possible when tiling is
>> necessary while still introducing no regressions compared to the original solution.
> Frederic Thevenet has updated the pull request incrementally with two additional commits since the last revision:
> - Mark variables as final
> - Using for loops instead of while
Looks good. Sanity tested on all three platforms.
modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/QuantumToolkit.java line 1589:
> 1588: int mTileWidth = computeTileSize(w, maxTextureSize);
> 1589: int mTileHeight = computeTileSize(h, maxTextureSize);
> 1590: IntBuffer buffer = IntBuffer.allocate(mTileWidth * mTileHeight);
I'll test it soon. Since these variables no longer change, maybe you could make them `final`?
Marked as reviewed by kcr (Lead).
More information about the openjfx-dev