RFR: 8335748: Rippling of frame on scrolling
Kevin Rushforth
kcr at openjdk.org
Fri Nov 21 19:50:21 UTC 2025
On Thu, 20 Nov 2025 11:37:53 GMT, Ambarish Rapte <arapte at openjdk.org> wrote:
> **Issue:**
> With metal pipeline, frame tearing is observed when scrolling the content. Perform small fling gesture scrolls for observing the issue, the issue occurs/observed easily when scroll is coming to and end.
>
> **Cause:**
> vsync is not enabled for metal pipeline.
>
> **Fix:**
> 1. Enable vsync for metal pipeline. The vsync shall be enabled by default. It can be disabled with `-Djavafx.animation.fullspeed=true`.
> 2. Synchronize the access to offline render target texture.
> 2.1 The `GlassMTLFrameBufferObject._texture` object is created and destroyed by **QuantumRenderer** thread, and
> 2.2 `GlassMTLFrameBufferObject._texture` is also accessed on **Appkit** thread through function `GlassLayerMTL.blitToScreen()`
> 2.3 NSLock is created to synchronize the acess
> 2.4 Without this synchronization, a crash could occur in scenario when JavaFX app window is moved between screens that differ in refresh rate.
>
> **Verification:**
> 1. Test that no frame tearing is observed, when scrolling(easy to test with small fling scrolls)
> 2. Test no issue observed when moving window among screens.
> 3. General sanity testing of UI.
>
> **Test:**
> A unit or system test is not possible for this scenario.
LGTM. On my Intel MacBook Pro with discrete graphics I can see the tearing without your fix and it looks good with the fix.
-------------
Marked as reviewed by kcr (Lead).
PR Review: https://git.openjdk.org/jfx/pull/1978#pullrequestreview-3494146974
More information about the openjfx-dev
mailing list