Bug 93839 - vdevs shared OpenGLContexts - end up broken.
Summary: vdevs shared OpenGLContexts - end up broken.
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.1.0 target:5.0.2
Keywords:
Depends on:
Blocks: VCL-OpenGL
  Show dependency treegraph
 
Reported: 2015-09-01 13:56 UTC by Michael Meeks
Modified: 2016-10-25 19:24 UTC (History)
2 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-01 13:56:37 UTC
VirtualDevices - pick the current OpenGLContext to use - and associate that with their SalGraphics by taking a ref-count. This is well and good, we don't want to (horribly expensively) swap GL contexts when we use a vdev.

Unfortunately, when the window owning the DC and hWnd which that context is associated with is released the - often we're left with a OpenGLContext still in use with several VirtualDevices.

Amazingly this continues to work for a time - a long time on Linux, a short time on Windows - until eventually - bang: things stop working. GL spews wgl context binding errors and ... life is bad.

Luckily in this case we can reset the OpenGLContext and force it to initialize afresh the next time we hit a draw method; fix to follow.

This should rid us of random black bits that are not rendering, and/or which show up after a while.
Comment 1 Commit Notification 2015-09-01 14:07:42 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "master":

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

tdf#93839 - Encourage vdevs to pick up new GL Contexts when they go invalid.

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 Michael Meeks 2015-09-01 14:12:01 UTC
And of course thanks to Markus for describing the problem so accurately & making the fix easy =)
Comment 3 Commit Notification 2015-09-01 14:34:22 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=eb9e5a863336f9c1a28f5ad59d7e143b16b543fe&h=libreoffice-5-0

tdf#93839 - Encourage vdevs to pick up new GL Contexts when they go invalid.

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 4 Commit Notification 2015-09-02 10:40:58 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "master":

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

tdf#93839 - Encourage vdevs to pick up new GL Contexts for Linux.

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 Michael Meeks 2015-09-02 10:41:42 UTC
So - I hope - fixed =)
Comment 6 Commit Notification 2015-09-02 14:22:36 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=50e82134148673583c42a3ddb2ce5c6cf0b01767&h=libreoffice-5-0

tdf#93839 - Encourage vdevs to pick up new GL Contexts for Linux.

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.