Bug Hunting Session
Bug 94213 - horrible flickering on window resize
Summary: horrible flickering on window resize
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
5.0.2.1 rc
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.1.0 target:5.0.2
Keywords:
Depends on: 94252
Blocks: VCL-OpenGL
  Show dependency treegraph
 
Reported: 2015-09-14 16:55 UTC by Michael Meeks
Modified: 2016-10-25 19:17 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Meeks 2015-09-14 16:55:09 UTC
When in GL mode - if you re-size the whole window, there is some quite horrible re-render flickering caused by erroneous glFlush-ing forcing render / display of partially completed contents. Adding a simple Begin/End paint pair around the rendering and re-sizing fixes that though - this simply defers the glFlush until we're done => flicker free frames.
Comment 1 Commit Notification 2015-09-14 17:00:21 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4a55670e2453cdb9895f51bbd4051f7004d768c5

tdf#94213 - defer glFlushing until we've re-rendered after a re-size.

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 2 Cor Nouws 2015-09-14 18:16:23 UTC
(I even saw this with OpenGL not enabled..
Resizing an presentation. Didn't do any additional tests though)
Comment 3 Michael Meeks 2015-09-15 22:57:03 UTC
This is a pretty grim issue, but showing up some other rather useful drop-offs. It appears that patch #1 fixes the re-sizing for the first window rather nicely. 

https://gerrit.libreoffice.org/18601 tdf#94213 - release offscreen texture properly on re-size.
    Then fixes the unit test breakage from patch #1 - make check passes again.

Unfortunately (and amazingly) the 2nd window behaves differently to the 1st window - (the first window includes a shell that has been converted into a document type). After some hours of head scratching & debugging it seems this is
almost certainly related to virtual-device re-use when a VirtualDevice's OpenGLContext is associated with a window that is not the window we want to render to - then ... we get issues, and undesirable context switches - which in turn appear to cause flicker. It is assumed that a GL context switch implies a glFlush (which we're trying to avoid at all costs to avoid flicker - at least until the double buffering is perfect & enabled).

So:

https://gerrit.libreoffice.org/18602 tdf#94213 - calc re-size flicker turns out to be the status bar.

Fixes calc for re-sizing - by turning off some un-necessary virtual-dev bits in the status bar, and also forcing an invalidate on device re-size; that appears to affect only the widget in the top-left corner that doesn't move or re-size when the window shrinks vertically ...
Comment 4 Commit Notification 2015-09-15 23:55:18 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a60db559d409514fb93af0167c543ad2f852b499

tdf#94213 - calc re-size flicker turns out to be the status bar.

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2015-09-16 02:00:46 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6f0f4ee720ef1e8262731f59f254b83d5bdd058c

tdf#94213 - release offscreen texture properly on re-size.

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 6 Michael Meeks 2015-09-16 07:09:22 UTC
> (I even saw this with OpenGL not enabled. Resizing an presentation.
> Didn't do any additional tests though)

There is a similar, but far less irritating flicker in 4.4 - though 4.4 doesn't clear the background to black before rendering, so much less noticable I think =) OpenGL default to on on Windows with suitable modern hardware in 5.0.2 (FWIW).
Comment 7 Commit Notification 2015-09-16 09:14:27 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4af40495b7dcdac3add67c634dde75c896e370d9

tdf#94213 - cleanup associated GL contexts properly when DCs released.

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 8 Michael Meeks 2015-09-16 11:00:54 UTC
Mostly fixed by now - though there are a number of patches needed; ideally we can render the windows without a context switch now - although sometimes when sizing something lumpy happens to the toolbar (some expander widget or somesuch) which gives an occasional stall. Nevertheless, it looks rather better than 4.4 at its worst.
Comment 9 Commit Notification 2015-09-16 12:30:37 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=b62f83c88b725d936b09cdd28a5ab625ac7c6d3e&h=libreoffice-5-0

tdf#94213 - defer glFlushing until we've re-rendered after a re-size.

It will be available in 5.0.3.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2015-09-16 12:30:40 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f7554e3e6ff17c850f444bd58767e68e8741387a&h=libreoffice-5-0

tdf#94213 - calc re-size flicker turns out to be the status bar.

It will be available in 5.0.3.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2015-09-16 16:10:07 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "libreoffice-5-0-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d6698cca4e22341a81573d9926ade127230e12a6&h=libreoffice-5-0-2

tdf#94213 - defer glFlushing until we've re-rendered after a re-size.

It will be available in 5.0.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2015-09-16 16:25:48 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "libreoffice-5-0-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=41c56c26285307eb451819d49c47d7623c4555e2&h=libreoffice-5-0-2

tdf#94213 - calc re-size flicker turns out to be the status bar.

It will be available in 5.0.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.