diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-07-20 14:46:55 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-07-25 17:47:08 +0000 |
commit | 8719660416986702c1ee9f65c4e347efa37ac770 (patch) | |
tree | b1840aa77b09b2f3ee7c12900eec220aedddede0 /tests | |
parent | cff39f181897520f92829adc1e4ed78233d8b7c5 (diff) |
macOS: Send expose event at drawRect and trigger updates via setNeedsDisplay
This changes the drawing model on macOS from the following:
1. Sending synchronous expose events directly from callbacks such as
windowDidOrderOnScreen and windowDidChangeOcclusionState
2. Waiting for a resulting flush of the backing store, and issuing
setNeedsDisplay as a response
3. Waiting for the asynchronous drawRect call in response to
setNeedsDisplay, where the backing store is finally drawn
to the window
To the following:
1. Issue setNeedsDisplay as a response to callbacks such as
windowDidOrderOnScreen and windowDidChangeOcclusionState,
when needed (in many cases this is automatic by AppKit)
2. Send synchronous expose events from the resulting drawRect
callback
3. Draw the backing store to the window when flushed
The new model matches how normal Cocoa application draw in response to
drawRect, and makes the backing store flush synchronous instead of having
to trigger a async setNeedsDisplay. This gives AppKit more information
about how much time we're spending in drawRect, as the actual drawing
and flushing all happens within the synchronous expose event.
Qt applications that draw outside of drawRect, e.g. in response to timers,
are still supported by manually locking focus of the view and flushing the
window at the end of the backingstore flush.
Task-number: QTBUG-50414
Change-Id: I2efb9ff8df51ab6e840ad20c497b71f53e21e1c2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions