diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2019-10-18 16:23:48 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-02-17 12:14:38 +0100 |
commit | 0912459c9d3f2433aae10cb569f1020868edaeb5 (patch) | |
tree | fc7f7edad5c5d9d3f034d6e15e8e1e3b5e6a5851 /tests/auto | |
parent | 66e06b296357c12f037762ce50092dd230873e32 (diff) |
macOS: Skip NSOpenGLContext flush if window exposed size is out of sync
Some clients such as QOpenGLWidget will end up drawing and flushing
during the resize event, which for GL will result in an immediate update
on the screen. The problem is that the underlying Core Animation layer,
and the window's frame, has not been visually updated yet to the new
size, so we end up drawing "ahead" of what the window server is showing
the user.
Ideally we'd be able to present the GL drawing in a transaction, in sync
with the drawing of the window frame, but this API is only available for
CAMetalLayer and CAEAGLLayer.
As a workaround we detect when the exposed size is out of sync with the
window geometry, and skip the flush until the exposed size has caught
up. We know this will happen eventually as AppKit will always ask us
to display after a resize.
Change-Id: I1739ac8878b3fc6820a55dd017ddd170fd5f55d6
Fixes: QTBUG-79139
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit f39230fcac4de01f26945bde16c3a10c5ac74afb)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'tests/auto')
0 files changed, 0 insertions, 0 deletions