f814cc6a79
This convenience should be, according to the Apple docs, equivalent to
calling present from a scheduled handler. (which on its own makes it
unclear why we switched in the first place)
In practice it seems the two approaches are not identical. It looks
like that once a frame is submitted earlier than the next display link
callback, the throttling behavior we implement in beginFrame()
(waiting on the semaphore for the completion of the appropriate
command list etc.) starts exhibiting unexpected behavior, not
correctly throttling the thread to the refresh rate. Changing back to
presentDrawable does not exhibit this at all.
The suspicion is that presentDrawable is probably doing more than what
the docs suggest, and so is not fully equivalent to calling present
manually from a scheduled handler.
Therefore, switch to presentDrawable now, which restores the expected
cross-platform behavior, but make a note of the oddity, and also
prepare the hellominimalcrossgfxtriangle manual test to provide an
easy, self-contained application to allow experimenting in the future,
if needed.
This allows Qt Quick render thread animations to advance at the
expected speed (because the render thread is correctly throttled to
the refresh rate), even if the render thread decides to generate a new
frame right away, without waiting for the next display link update.
Without this patch, attempting to get updates not via requestUpdate(),
but by other means (timer etc.) leads to incorrect throttling, and so
the triangle in the test app is rotating faster than expected - but
only with Metal. Running with OpenGL on macOS or with any API on any
other platform the behavior will be correct. Even if scheduling
updates without display link is not efficient, and should be
discouraged, not doing so cannot break the core contract of vsync
throttling, i.e. the thread cannot run faster just because it renders
a frame not in response to an UpdateRequest.
Amends
|
||
---|---|---|
.. | ||
cmake/test_copy_file_if_different_command | ||
cocoa | ||
corelib/tools | ||
diaglib | ||
dialogs | ||
embeddedintoforeignwindow | ||
filetest | ||
foreignwindows | ||
gestures | ||
highdpi | ||
inputmethodhints | ||
keypadnavigation | ||
lance | ||
markdown | ||
mkspecs | ||
network_remote_stresstest | ||
network_stresstest | ||
qcursor | ||
qdesktopservices | ||
qgraphicsitem | ||
qgraphicsitemgroup | ||
qgraphicslayout/flicker | ||
qhttpnetworkconnection | ||
qimagereader | ||
qlayout | ||
qlocale | ||
qmetatype | ||
qmimedatabase | ||
qnetconmonitor | ||
qnetworkaccessmanager/qget | ||
qnetworkinformation | ||
qnetworkreply | ||
qopenglcontext | ||
qopengltextureblitter | ||
qopenglwidget | ||
qopenglwindow/multiwindow | ||
qprintdevice_dump | ||
qscreen | ||
qscreen_xrandr | ||
qssloptions | ||
qsslsocket | ||
qstorageinfo | ||
qsysinfo | ||
qt_poll | ||
qtabbar | ||
qtabletevent | ||
qtbug-8933 | ||
qtbug-52641 | ||
qtexteditlist | ||
qtexttableborders | ||
qtouchevent | ||
qvulkaninstance | ||
qwidget_zorder | ||
repaint | ||
rhi | ||
shortcuts | ||
socketengine | ||
startsystemmove | ||
textrendering | ||
touch | ||
touchGraphicsItem | ||
transientwindow | ||
triangulator | ||
unc | ||
wasm | ||
widgetgrab | ||
widgets | ||
windowactivation | ||
windowchildgeometry | ||
windowflags | ||
windowgeometry | ||
windowmodality | ||
windowtransparency | ||
xcb_gl_integration | ||
xembed-raster | ||
xembed-widgets | ||
CMakeLists.txt | ||
manual.pro |