summaryrefslogtreecommitdiff
path: root/vcl/source/opengl
AgeCommit message (Collapse)Author
2016-03-22tdf#84323: Make osl::Thread::wait more readableGurkaran
It is to improve the readability of calls to osl::Thread::wait. Change-Id: I025d89abf8e84ca73ba08f001be3f45b86c89957 Signed-off-by: Gurkaran <gurkran@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/23416 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-07opengl: fix loading shader with preamble that uses #versionTomaž Vajngerl
The preamble was inserted into a false position so the shader could was constructed incorrectly and would fail to compile. Change-Id: I4c51adde9014a326bbe38a5d2d17dd0047e33195
2016-03-04-Werror,-WshadowStephan Bergmann
Where wglChoosePixelFormatARB is defined as a macro expanding to __wglewChoosePixelFormatARB (as WGLEW_GET_FUN is just expanding to its argument), and __wglewChoosePixelFormatARB is declared in global scope in workdir/UnpackedTarball/glew/include/GL/wglew.h. itself) in workdir/UnpackedTarball/glew/include\GL/wglew.h Change-Id: I0c4d09e9112c2233d25a262ea1f2b35bdf49645c
2016-02-27log to the crashreporter whether we use OpenGLMarkus Mohrhard
Change-Id: I8fd2ffe5908074417aa5cfc00adbc54b6e9ed360
2016-02-17use consistent #define checks for the Windows platformNoel Grandin
stage 2 of replacing usage of various checks for the windows platform with the compiler-defined '_WIN32' macro In this stage we focus on replacing usage of the WIN macro Change-Id: Ie8a4a63198a6de96bd158ecd707dadafb9c8ea84 Reviewed-on: https://gerrit.libreoffice.org/22393 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-12tdf#95857 Sort out German plurals ...danielt998
Made a start in removing the incorrect 'Infos' German plural Change-Id: Ie989351a7473fc35b563e63ce6a4fb229093af60 Reviewed-on: https://gerrit.libreoffice.org/22301 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2016-02-09Remove excess newlinesChris Sherlock
A ridiculously fast way of doing this is: for i in $(pcregrep -l -M -r --include='.*[hc]xx$' \ --exclude-dir=workdir --exclude-dir=instdir '^ {3,}' .) do perl -0777 -i -pe 's/^ {3,}/ /gm' $i done Change-Id: Iebb93eccbee9e4fc5c4380474ba595858a27ac2c Reviewed-on: https://gerrit.libreoffice.org/22224 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-06vcl: bmpacc.hxx -> bitmapaccess.hxxChris Sherlock
Change-Id: I4bb19d6103c4a6a902d86b62a857e3478493924c
2016-02-01Resolves: tdf#93821 assume mbNoSaveBackground as true everywhereCaolán McNamara
Change-Id: I126aa5e9b96299eb25c2240d097859b3c0756535
2016-01-26OpenGLWrapper is the right place for getBufferSwapCounter()Tor Lillqvist
Change-Id: I3f7db276ab00d5fa493f993736f1010e76fcbcc8
2016-01-26Put getBufferSwapCounter() in OpenGLWindow insteadTor Lillqvist
<vcl/openglwin.hxx> is a more light-weight include file and including that causes less trouble on the various platforms. Change-Id: I5c9baa171278d291468ef45a47d9fdbc64326957
2016-01-26Add API to get the number of OpenGL buffer swaps, including through UNOTor Lillqvist
Change-Id: Iff29ac615ad4b6516790b1cbbde0215a3cd0efe6
2016-01-13We only use the prev pointerTor Lillqvist
(Why not use a std::list? Maybe there is some reason.) Change-Id: I09010726e9fe45cfa0f530a085c48ec8d3d02cfb
2016-01-06vcl: opengl - if we can't get the context we want, fallback properly.Michael Meeks
Fixes crash on Linux / NVidea with GL manually enabled. We can cope with a non-double-buffered context if we have to. Change-Id: Ic7968b8576cfe0efb10718058bc69db5b4daef95
2016-01-06loplugin:defaultparamsStephan Bergmann
Change-Id: Ic5bfc72c75745d0a4d9ff165d840ab51c90a8690
2016-01-06vcl: opengl - Kill the last glErrors on common paths.Michael Meeks
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-05Fix dbgutil build in case GL_DEBUG_SEVERITY_NOTIFICATION_ARB is undefinedTor Lillqvist
Change-Id: I14628e9dee8651e87b4782057c4681fded5e4643
2016-01-05vcl: Ignore i965’s shader compiler debugEmmanuel Gil Peyrot
Change-Id: I94c5759d47a17e93f0614bfd95b52d64f9d2d896
2016-01-01vcl: improve OpenGL debugging variously.Michael Meeks
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 Grandin
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-15Initialise bArbMultisampleSupported as falseTor Lillqvist
Otherwise the code doesn't make sense; InitMultisample() would return true even if no pixel format was chosen. Found by code reading by me and Emmanuel, not actually verified on non-multi-sample-capable hardware. Change-Id: I7197a1c72768bbf2c928193582104a82808ea53c
2015-12-11vcl: use a custom tag for VCL OpenGLContext's to avoid re-use.Michael Meeks
Other code is out of legacy mode now, so can't legacy as a proxy. Change-Id: Ie3807a3af680b707f2f08d058db955bc9cae6c2b Reviewed-on: https://gerrit.libreoffice.org/20647 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2015-12-11opengl: Add Geometry Shader support to OpenGLHelperEmmanuel Gil Peyrot
This is the ground work for some later transitions in slideshow. Change-Id: Ib200cf7fabd579256a5255b0fb5d8c4accf7d24b
2015-12-11tdf#93529 - move to a Mac-like double-buffered OpenGL model.Michael Meeks
This moves us to always rendering to an off-screen texture, and then (at idle) blitting this to the screen & swapping buffers. Ideally we should never see any rendering, or flicker again with this approach. Several fixes are included: + avoid multiple OpenGL contexts being created for the same window, created excessive flicker problems. + de-virtualize UseContext - which context we use is less critical. + kill 'mbOffscreen' distinction - all VCL rendering is offscreen. + implement 'doFlush' and high priority idle flushing. + bind stencil buffer for clipping vs. textures - fixing complex clopping when rendering to virtual-devices, and off-screen. + document environment. variables. + use white as default background glClear color, but red or random color for DBGUTIL. Change-Id: I6be08595b6c8deb7e6db0dbd81308b2c97d2b4ff
2015-12-11Get Double-buffered context creation working on linux.Michael Meeks
Change-Id: I3db1d6792fcd51577f047b82029124ec825ea319
2015-12-08Bin the pointless and thin OS X specific wrapper namespace 'OpenGLWrapper'Tor Lillqvist
Besides, the namespace was confusingly named the same as the public cross-platform OpenGLWrapper struct (which is effectively just a namespace, too). Change-Id: I9a5255ec446dcdb5086d92a742f29327d0780685
2015-11-20loplugin:sallogareasStephan Bergmann
Change-Id: Ib1f06cb5f925535858bc14aab6f59ad7fd2a3a8d
2015-11-19readabilityTomaž Vajngerl
Change-Id: I8fbff3f86a543a58259408914bb78f992ad65864
2015-11-19loplugin:nullptrStephan Bergmann
Change-Id: Ie461bc10ee2f7d2329a23c86bdc922839bea7974
2015-11-19Add OpenGLContext::UseNoProgram()Tor Lillqvist
Will be useful in cases where there is some external library code that uses shaders outside of our OpenGLContext. Change-Id: I59c57e3225f55d13e69b6a9b7c0db1a7487c586d
2015-11-19Improve SAL_WARN message readabilityTor Lillqvist
Change-Id: Ia9e1ea7a69e372725a4239fad2630b6f8bcb52e2
2015-11-17Check for OpenGL errors right where an error might be generatedTor Lillqvist
CHECK_GL_ERROR() is now zero-cost in a production build, so no reason to avoid it. Don't check for OpenGL errors after glX or wgl calls. They don't generate OpenGL errors but use the X and Win32 error mechanisms, as far as I see. Change-Id: I8f97ef434cbdc89d6e345a247456cfc4a1a82bb6
2015-11-16opengl: remove unused mbPixmap & glPix members.Michael Meeks
We use textures bound to FBO's for everything in recent times. Change-Id: I7c9068d75b3653a2ceff0056e2ade1f27955422f Reviewed-on: https://gerrit.libreoffice.org/19995 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2015-11-16Add comment to 'direct' parameter: un-related to double-buffering.Michael Meeks
Change-Id: I07002fd73fc004439aea75c5aca8ca3700ec1079 Reviewed-on: https://gerrit.libreoffice.org/19996 Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com> Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2015-11-13OpenGL error codes are defined in hex, so show them as suchTor Lillqvist
Change-Id: I1f7fd98b243c49bfd90060b297bb2391cb102bb3
2015-11-11Move checkExtension() to a more private locationTor Lillqvist
Change-Id: I9f8a4ca0991b59bb9b6af4d40e3136ce5c986731
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
Change-Id: I05e89f9896170d4df3d1377549ea074f06b884a0
2015-11-10Surely a 24-bit depth buffer is enoughTor Lillqvist
We asked for a 64-bit one, which is rather preposterous. And the comment claimed we asked for a 32-bit one. Funnily, this same odd code and comment is found in half a dozen code samples on the Internet... Copy pasta rules. Change-Id: Ie54a7b75e07cfe0ffd98ec330ce63158d2d15415
2015-11-10Add some assertions and improve commentsTor Lillqvist
Make sure the hardcoded indexes into the iAttributes array that we use mean what they are supposed to. Add comments about that, and fix one misleading comment. Change-Id: Ibb748b00782db4fcaf34f6c717075f6aff50651e
2015-11-05use uno::Reference::set method instead of assignmentNoel Grandin
Change-Id: I31a69a997098eb1807361b8049c3312a4f287d75
2015-10-19Speed up in-process caching of OpenGL shader programsTor Lillqvist
It seems to be fairly CPU intensive to calculate the MD5 digest of shader program source code. But we don't need to use that to look up a corrresponding program in the run-time in-process cache anyway. The shader names are unique, so it is enough to use that as key. Change-Id: I8fd9f5f875be14a82cd53daf8a2ca72bfd23beb6
2015-10-18Success is no reason to be scaredTor Lillqvist
Change-Id: If7ad24bf1f7442e86d424188bd78f332b1a351ff
2015-10-11Moggi thinks this mutex is unnecessary and I trust himTor Lillqvist
"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 Bergmann
Change-Id: I8a6ea395192d31391868f44152ab3b543a07aeaa
2015-10-08Don't re-read the same glsl files over and over againTor Lillqvist
Change-Id: I10b4badaba01630e1a054b3d4d9cc4720822511a
2015-09-30vcl: clean up before error returns in OpenGLContext::ImplInit()Michael Stahl
JunitTest_chart_unoapi fails here with "assert(!hasCurrent())" because the initialization apparently fails due to lack of a wglCreateContextAttribsARB in the VM, so ensure that the hTempRC is not active and also deleted in all cases. Change-Id: I7e03b95d1146af48a24e34692c3c2827298fccee
2015-09-16Add debugging helpers to binary shader loading.Michael Meeks
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 Meeks
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-16tdf#94213 - release offscreen texture properly on re-size.Michael Meeks
We need to ensure that we use an initialized context, and that (when we re-parent) we DeInit and so reset the previous OpenGLContext. Make UseContext more paranoid as well for good measure. Change-Id: Ia45334222045e5d2f48da47560fab8511223a9a5 Reviewed-on: https://gerrit.libreoffice.org/18601 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2015-09-15loplugin:cstylecastStephan Bergmann
Change-Id: Ib87c2d84bc954e768a9a5165f528936aafa94887