summaryrefslogtreecommitdiff
path: root/vcl/source/opengl/OpenGLHelper.cxx
AgeCommit message (Collapse)AuthorFilesLines
2016-07-25opengl: add VCL_GL_WARN to write warnings into api trace fileTomaž Vajngerl1-4/+15
Change-Id: I416de926a769dccdf1c53072c1f7dda817c5402a Reviewed-on: https://gerrit.libreoffice.org/27496 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2016-05-25Use VCL_GL_INFO hereTor Lillqvist1-2/+2
Failing to open a cached shader binary is a no reason for a SAL_WARN. It is normal that they don't exist when first trying, that is the very nature of a 'cache'. Change-Id: Iaa40af11f0679b859f1fa8b246665c61640df379
2016-05-25Avoid redundancy: The same information was logged in readProgramBinary()Tor Lillqvist1-1/+0
Change-Id: Id5619c9c102ba72826265c1b5f46ddb58596b8b1
2016-05-25Don't claim to be reading a file before trying to open itTor Lillqvist1-2/+2
Change-Id: I8a3332c4b1acaa4dc69ff9349d2e9241fb4f340f
2016-05-21move glX stuff to X-only modulesCaolán McNamara1-85/+0
Change-Id: I8ca818dac72f0368b6af10c838603e63c7c85b1e
2016-03-07opengl: fix loading shader with preamble that uses #versionTomaž Vajngerl1-2/+2
The preamble was inserted into a false position so the shader could was constructed incorrectly and would fail to compile. Change-Id: I4c51adde9014a326bbe38a5d2d17dd0047e33195
2016-02-27log to the crashreporter whether we use OpenGLMarkus Mohrhard1-0/+3
Change-Id: I8fd2ffe5908074417aa5cfc00adbc54b6e9ed360
2016-02-06vcl: bmpacc.hxx -> bitmapaccess.hxxChris Sherlock1-1/+1
Change-Id: I4bb19d6103c4a6a902d86b62a857e3478493924c
2016-02-01Resolves: tdf#93821 assume mbNoSaveBackground as true everywhereCaolán McNamara1-1/+0
Change-Id: I126aa5e9b96299eb25c2240d097859b3c0756535
2016-01-06vcl: opengl - Kill the last glErrors on common paths.Michael Meeks1-0/+5
Re-work the makeSomeOpenGLContextCurrent logic into a shared function with the existing AcquireContext logic in the SalOpenGLGraphics impl. Use an OpenGLVCLContextZone placeholder to do both context and zone management - to include destructors into the zone. Fix a number of error cases around SalBitmaps where we did not have a GL context associated when allocating, and/or freeing textures.. Don't drag a (potentially) slower context around in the OpenGLSalBitmap when we're going to check / fetch a better VCL context anyway. Change-Id: Ibbb2358c47156cd078ad28b6aad4f03af36aaf23 Reviewed-on: https://gerrit.libreoffice.org/21127 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2016-01-01vcl: improve OpenGL debugging variously.Michael Meeks1-1/+2
Change-Id: I097f1c1fb7fb505b6859289997bff3562fc06ba6 Reviewed-on: https://gerrit.libreoffice.org/21027 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2015-12-24loplugin:unnecessaryvirtualNoel Grandin1-8/+0
and unwind some apparently now unused VCL OpenGL and GlyphCachePeer stuff. Change-Id: Ic85302d4e1ad4056dabc49c97a608891052e3167 Reviewed-on: https://gerrit.libreoffice.org/20920 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-12-11opengl: Add Geometry Shader support to OpenGLHelperEmmanuel Gil Peyrot1-3/+59
This is the ground work for some later transitions in slideshow. Change-Id: Ib200cf7fabd579256a5255b0fb5d8c4accf7d24b
2015-11-20loplugin:sallogareasStephan Bergmann1-6/+6
Change-Id: Ib1f06cb5f925535858bc14aab6f59ad7fd2a3a8d
2015-11-19readabilityTomaž Vajngerl1-1/+4
Change-Id: I8fbff3f86a543a58259408914bb78f992ad65864
2015-11-13OpenGL error codes are defined in hex, so show them as suchTor Lillqvist1-4/+3
Change-Id: I1f7fd98b243c49bfd90060b297bb2391cb102bb3
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann1-15/+15
Change-Id: I05e89f9896170d4df3d1377549ea074f06b884a0
2015-11-05use uno::Reference::set method instead of assignmentNoel Grandin1-1/+1
Change-Id: I31a69a997098eb1807361b8049c3312a4f287d75
2015-10-18Success is no reason to be scaredTor Lillqvist1-3/+3
Change-Id: If7ad24bf1f7442e86d424188bd78f332b1a351ff
2015-10-11Moggi thinks this mutex is unnecessary and I trust himTor Lillqvist1-3/+0
"Is the mutex really necessary? Normally outside of the chart OpenGL only the thread that has taken the SolarMutex should access the OpenGL code. In general we have bigger problems if several threads start rendering in parallel." Change-Id: I5f8fa8c771d5e2e0df4cfe903b15d00e5cc162b1
2015-10-09clang-analyzer-deadcode.DeadStoresStephan Bergmann1-1/+0
Change-Id: I8a6ea395192d31391868f44152ab3b543a07aeaa
2015-10-08Don't re-read the same glsl files over and over againTor Lillqvist1-4/+20
Change-Id: I10b4badaba01630e1a054b3d4d9cc4720822511a
2015-09-16Add debugging helpers to binary shader loading.Michael Meeks1-5/+4
Change-Id: I32b8d8ce0fbf824120c8afd288b728314cd74142 Reviewed-on: https://gerrit.libreoffice.org/18620 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2015-09-16GL paint-flushing guard re-work.Michael Meeks1-1/+45
Unfortunately, since we can have 2x SalGraphics' on a OutputDevice, and one of these can be a printer - things got very confused around which context to glFlush. This de-tangles the various reference-counts. Change-Id: I1062be0b02a91fc9009deaa3ec29c5dbb227df20 Reviewed-on: https://gerrit.libreoffice.org/18604 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2015-09-15loplugin:cstylecastStephan Bergmann1-3/+3
Change-Id: Ib87c2d84bc954e768a9a5165f528936aafa94887
2015-09-15WaE: loplugin:cstylecastTor Lillqvist1-4/+4
Change-Id: I08c31a7e097464da5df4fcda6637f442d147230f
2015-09-15tdf#93814: Added support for caching shader program binaries.Marco Cecchetti1-5/+262
Change-Id: I21c844b47282f6b3eec443933a86421a074e24df Reviewed-on: https://gerrit.libreoffice.org/18555 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2015-09-11coverity#1323754 we apparently can survive std::abort for a whileCaolán McNamara1-0/+1
so try and suppress this warning Change-Id: I096352af0116f1ba0911cc201eb884267095a797
2015-09-03tdf#93870 - GL accel. via VCL canvas for presentations when GL enabled.Michael Meeks1-0/+6
Change-Id: Ia31a88cb3d9e6baa987b22f77f407a3f592031f1 Reviewed-on: https://gerrit.libreoffice.org/18285 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2015-09-02tdf#93867 - clear current GL context before thread switch.Michael Meeks1-1/+1
Fixes regression from otherwise a nice cleanup in: d20092259c7ea63885a539f911788715f8147ee9 Also get polarity of debug logging only with a context right. Change-Id: Id322471f01e5656e758aefc57b0d4d5ad073ec54
2015-09-02Don't call GL debugging methods if there is no context.Michael Meeks1-15/+23
Change-Id: Ie6b824953b8ad19fd1b6a146cb6bf52bbb152ef7 Reviewed-on: https://gerrit.libreoffice.org/18276 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2015-09-02Add SAL_DISABLE_GL_WATCHDOG env. var for obvious reasons.Michael Meeks1-1/+2
Change-Id: Iec7cb6504a389972d8187954d5ed7aff94f2e01c
2015-09-02tdf#93850 - Defer watchdog during shader compiles.Michael Meeks1-16/+54
Shader compilation can take a while the first time; best not to disable GL at that point. Have more of a hair trigger at other times. Also explicitly exit if we appear to have hung in std::abort handling. Change-Id: I45f0873672f950fb3baba0ca859d854a0bb25064
2015-08-31tdf#93822 - disable horror legacy menu background saving for OpenGL.Michael Meeks1-0/+5
Change-Id: Icaa5fb197f3fa234da4538a2a7b21131cab89277
2015-08-31Extended GL painting debug tracing.Michael Meeks1-0/+1
Change-Id: I52158729d240ca3cb9e7977bc6d1f5acb14437ad
2015-08-31tdf#93798 - avoid apitrace provoked infinite loop dumping errors.Michael Meeks1-0/+8
Change-Id: I6c42e6a9ead90ed6fad2f289cd686a72cffa0c2d
2015-08-28tdf#93529 - add glDebugMessageInsert wrappers to help with API tracing.Michael Meeks1-0/+38
Change-Id: Icf75e0e477be1b2bbbe5095aee33e681d212be0b
2015-08-28Revert "tdf#93530 - the VCL GDI flushing abstraction should glFlush too."Michael Meeks1-9/+0
This reverts commit e16e64dd862c8f386f80de43ad68e831e169d49d. I somehow forgot that glFlush is context specific, (gl always gets me that way).
2015-08-27Fully drain glGetErrorStephan Bergmann1-4/+6
...according to <https://www.opengl.org/sdk/docs/man/html/glGetError.xhtml>: "To allow for distributed implementations, there may be several error flags. If any single error flag has recorded an error, the value of that flag is returned and that flag is reset to GL_NO_ERROR when glGetError is called. If more than one flag has recorded an error, glGetError returns and clears an arbitrary error flag value. Thus, glGetError should always be called in a loop, until it returns GL_NO_ERROR, if all error flags are to be reset." (The original code was flagged by clang-tidy's clang-analyzer-deadcode.DeadStores.) Change-Id: Ia64e2133b6a4581230b999d4b8b63aa59199ee32
2015-08-26tdf#93530 - the VCL GDI flushing abstraction should glFlush too.Michael Meeks1-0/+9
Change-Id: I45cb0e62278d8c3154ae8ad54ca4c93b3e177969 Reviewed-on: https://gerrit.libreoffice.org/18030 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2015-08-25tdf#93614 - detect hanging OpenGL drivers with a watchdog.Michael Meeks1-15/+112
If an OpenGL zone takes >2s to make progress, disable OpenGL. If an OpenGL zone takes >5s to make progress, abort the app. Change-Id: I776c06a3f8ba460ff9842a9130c21f9ee2147eee Reviewed-on: https://gerrit.libreoffice.org/17986 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2015-08-21tdf#93547 - Disable OpenGL if we have a SEGV on windows in that code.Michael Meeks1-0/+48
Annotate when we are in an OpenGL rendering zone. Check for this in the VCL signal handler, and force OpenGL off here if exception occurred inside an OpenGL code-path. Change-Id: I85a4b3d4a374593dc55d01a39ec4c7c3c262c332 Reviewed-on: https://gerrit.libreoffice.org/17881 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2015-08-11loplugin: defaultparamsNoel Grandin1-1/+1
Change-Id: I79a889c68e91712d2abdacc559c78813f730e623
2015-07-03tdf#88831 fix inverted textures when OpenGL is enabledTomaž Vajngerl1-1/+5
GLX returns a wrong value if the y coords are inverted. Most other programs don't even ask for this (gnome-shell for example) and just assumes "true" (and this works because most relevant X servers work like this). We make this more robust and assume true only if the returned value is GLX_DONT_CARE (-1). Change-Id: I4800b3364fd00f5f4a8f5a459472bfa8d97827ba
2015-06-17Replace boost::scoped_array<T> with std::unique_ptr<T[]>Takeshi Abe1-3/+3
This may reduce some degree of dependency on boost. Done by running a script like: git grep -l '#include *.boost/scoped_array.hpp.' \ | xargs sed -i -e 's@#include *.boost/scoped_array.hpp.@#include <memory>@' git grep -l '\(boost::\)\?scoped_array<\([^<>]*\)>' \ | xargs sed -i -e 's/\(boost::\)\?scoped_array<\([^<>]*\)>/std::unique_ptr<\2[]>/' ... and then killing duplicate or unnecessary includes, while changing manually m_xOutlineStylesCandidates in xmloff/source/text/txtimp.cxx, extensions/source/ole/unoconversionutilities.hxx, and extensions/source/ole/oleobjw.cxx. Change-Id: I3955ed3ad99b94499a7bd0e6e3a09078771f9bfd Reviewed-on: https://gerrit.libreoffice.org/16289 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-05-28new clang plugin: loopvartoosmallNoel Grandin1-2/+2
Idea from bubli - look for loops where the index variable is of such size that it cannot cover the range revealed by examining the length part of the condition. So far, I have only run the plugin up till the VCL module. Also the plugin deliberately excludes anything more complicated than a straightforward incrementing for loop. Change-Id: Ifced18b01c03ea537c64168465ce0b8287a42015
2015-04-24loplugin:simplifyboolStephan Bergmann1-1/+1
Change-Id: I8276e8b356ff26241613de64bcd90b5dbcd92f29
2015-03-16missing space in log messageMarkus Mohrhard1-1/+1
Change-Id: I464dbf8cf9c65f2dd5e88236be8ddf4c0676bfdd
2015-03-09coverity#1268023 Logically dead codeCaolán McNamara1-2/+1
Change-Id: I8fcda18101071db7dddc304c29e4130b04a70f89
2015-02-07Fixup --without-x buildRiccardo Magliocchetti1-1/+1
Accept gl linkage in hope of future offscreen mesa support. Avoid linking with GLX though. Change-Id: I4e666f60e74fe34075a8da9eeba95807cf8fe38c Signed-off-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/13452 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>