-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.6.2
-
None
I am rendering WebEngineView into QQuickRenderControl. I need to wait until it actually paints the contents before rendering to avoid rendering a blank page.
I tried two approaches to detecting when it has rendered - requestAnimationFrame/MessageChannel as described here https://webperf.tips/tip/measuring-paint-time/
And PerformanceObserver/largest-contentful-paint as described here https://developer.mozilla.org/en-US/docs/Web/API/LargestContentfulPaint
Both of these techniques work when not using QQuickRenderControl. You can run the attached test-paint.qml (which uses test-paint.html) using the qml viewer:
> qml test-paint.qml qml: in runAfterFramePaint qml: onLoad qml: in requestAnimationFrame qml: after frame paint qml: [object LargestContentfulPaint]
When using QQuickRenderControl, neither of these events fire. Build the attached test application and run with raf-paint.html to test requestAnimationFrame or with lcp-paint.html to test largest-contentful-paint:
> ./rendercontrol ../raf-paint.html qml: onLoad qml: WebChannel [object Object] qml: runAfterFramePaint
> ./rendercontrol ../lcp-paint.html qml: onLoad qml: WebChannel [object Object]
Why do these not work when using QQuickRenderControl? Is there some other technique to detect when WebEngineView has painted so I can defer rendering into the QQuickRenderControl until after it has painted content?