summaryrefslogtreecommitdiff
path: root/vcl/source/opengl
AgeCommit message (Collapse)AuthorFilesLines
2016-07-25opengl: log device/driver info, remove unneeded info messagesTomaž Vajngerl1-3/+20
Change-Id: Ica3698d0dbff1ee7a1e822d2765eb4019ccef224 Reviewed-on: https://gerrit.libreoffice.org/27498 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
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-07-08if mpCurrentProgram and pProgram are NULL this crashesMarkus Mohrhard1-1/+1
See http://crashreport.libreoffice.org/stats/signature/OpenGLProgram::Reuse%28%29 Change-Id: I2d1c9d9faff05d0d57a2c217a9ee594b1c22b61d Reviewed-on: https://gerrit.libreoffice.org/27043 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-06-03tdf#100193: Check earlier and harder whether OpenGL is good enough on WindowsTor Lillqvist1-1/+16
If we notice early enough that OpenGL is broken or not good enough, we can disable it and terminate with EXITHELPER_NORMAL_RESTART. Not beautiful, but works. The earlier added check whether shader compilation and loading of shader program binaries from a cached file works is now just one of the aspects that are checked. Change-Id: I9382576cc607f1916f6002f1fa78a62e23180fe3
2016-06-02fix debugging buildCaolán McNamara1-1/+1
Change-Id: Idb1b1d50260a969446ac1385f93163bea6cf6b04
2016-05-29coverity#1362019 Uninitialized scalar variableCaolán McNamara1-0/+1
Change-Id: I18d913fc6e0131f0c31c9d0cfe0f39e1161035eb
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-24opengl: prevent seg. fault - VCL_GL_INFO still needs the contextTomaž Vajngerl1-1/+2
Change-Id: Iaf71104d85e8a0b8f5b101f614a6c4b90ce63f87 Reviewed-on: https://gerrit.libreoffice.org/25409 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
2016-05-21split GLWindow into platform dependent parts and move to respective backendsCaolán McNamara1-20/+8
Change-Id: I636d9bdac907000e4089aebdc5548ea89ec58083 Reviewed-on: https://gerrit.libreoffice.org/25252 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-05-21move glX stuff to X-only modulesCaolán McNamara1-85/+0
Change-Id: I8ca818dac72f0368b6af10c838603e63c7c85b1e
2016-05-21GLX_EXT_texture_from_pixmap path cannot be called...Caolán McNamara1-0/+5
slideshow mbHasTFPVisual is always false since commit eccaf91ec9c50d42ce98c90abe2c129bedbbc60e Date: Mon May 19 19:21:29 2014 +0200 use VCL's OpenGLContext for 3D transitions Change-Id: I510518461eb8bc9669d0de2679c34c473f66b175 and GLWindow fbc has always been null since that incarnation of opengl started, so even if mbHasTFPVisual was true it would crash. OpenGLHelper::GetPixmapFBConfig is *almost* the same as the old removed code for setting fbc, but if I use that then for me the transitions still don't work at all. Examining further shows GetPixmapFBConfig lacks the test for GLX_BIND_TO_MIPMAP_TEXTURE_EXT that the old code had. If I add than, then it "works", but examining *that*, reveals it only works because GLX_BIND_TO_MIPMAP_TEXTURE_EXT is unsupported on my rig, so the GLX_EXT_texture_from_pixmap code still doesn't get executed. I apparently can't test the original working configuration, and I'm not particularly interested in getting X working and I just wanted to make sure I didn't break that case, so... this removes the uncallable since 2014 code entirely rather than try to fix it. I suspect this may leave the cairo-canvas CanvasBitmap::getFastPropertyValue "1" branch now also dead Change-Id: I6727576056533fa54a4f82378954fb53891f5873
2016-05-21Split OpenGLContext up into SalInstance specific classesCaolán McNamara1-1033/+41
which, at least theoretically, allows there to be vclplug specific ones. i.e. a gtk3 specific one which doesn't assume gtk3 is running under X Change-Id: I6c007a87abbd3049b6fffc70d349e3b7ac445eec
2016-05-19Resolve: "TODO(Q1): Make GetSystemData method virtual"Caolán McNamara1-4/+4
and remove the casting silliness, allowing the removal of cairo_cairo.?xx If anything is to go wrong I'd guess it'll be the windows directx stuff. Change-Id: I3e22c07b9c26ade9b27a245fdd8408de540643f4
2016-05-19rename to two GetSystemData methods to find all call-sitesCaolán McNamara1-4/+4
anyplace calling GetSystemChildSystemData on a SystemChildWindow is definitely right anyplace calling GetWindowSystemData on a Window *might* have intended to call GetSystemChildSystemData on a Window casted back to an underlying SystemChildWindow. Change-Id: I7dcf3a50d0b7ed29bc08cfdb15cc0dcb86be8fa7 Reviewed-on: https://gerrit.libreoffice.org/25158 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-05-19merge duplicate codeCaolán McNamara1-21/+13
Change-Id: Iac8f5e9596300bbaaa4b2ce6c6fc4d11793745a5
2016-05-19opengl: track the state of blend, DrawArrays on OpenGLProgramTomaž Vajngerl1-1/+5
This adds tracking of GL_BLEND and glBlendFunc which are usually set when setting up the current draw call on OpenGLProgram with SetBlendFunc method. Until now the final draw call (glDrawArrays) was called outside of OpenGLProgram. This is a problem because we need to know if we did call SetBlendFunc or not between when we used or reused the current program. So we added DrawArrays to OpenGLProgram and refactored all draw calls in OpenGLSalGraphicsImpl to use this. From now on glDrawArrays should not be called directly but always through OpenGLProgram. Change-Id: I530b4b948af8a962669a3751e1a95ff3986ffec9 Reviewed-on: https://gerrit.libreoffice.org/25083 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2016-04-30opengl: track the state of glViewportTomaž Vajngerl1-2/+2
We don't want to set the viewport over and over again. Change-Id: I60b84a009d4058743e30587616604f9b6fc0f601 Reviewed-on: https://gerrit.libreoffice.org/24507 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2016-04-30opengl: sync scissor and stencil state, generic capability stateTomaž Vajngerl1-0/+1
Scissor and stencil test needed to be disabled in flush() (which means every postDraw call) because sometimes the state became out of sync with the current state. This commit adds sync() function which synchronises the actual OpenGL state and adds debugging mechanisms to warn when the state becomes out of sync (so we can inspect the exact moment in apitrace). Added a GenericCapabilityState for GL capabilities like GL_SCISSORS_TEST, GL_STENCIL_TEST, GL_BLEND,... and refactored existing ScissorState and StencilState to inherit from it. Change-Id: Ifc159108a5ce850c78a89b1f5b8d12ecdd84f459 Reviewed-on: https://gerrit.libreoffice.org/24506 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2016-04-30opengl: track state of active and bound textures in contextTomaž Vajngerl1-0/+3
Add TextureState which is responsible to track the state of texture binding (and unbinding) and changing the current active texture unit. This is necessary because all GL calls reset the internal state without checking what the current state actually is and this can accumulate to a large amount of overhead. We also unbound the textures (glBindTexture with 0 as ID) after every operation which is also a major unneeded overhead which is fixed by this commit. Change-Id: I770a6a744c0c41850c576b928f027375962088aa Reviewed-on: https://gerrit.libreoffice.org/24503 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2016-04-28vcl: fix loplugin:stylepoliceMiklos Vajna1-4/+4
Change-Id: I40455e04a5f69dc0956ccb01c48d8a40245a4506
2016-03-22tdf#84323: Make osl::Thread::wait more readableGurkaran1-2/+2
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ž 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-03-04-Werror,-WshadowStephan Bergmann1-4/+4
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 Mohrhard1-0/+3
Change-Id: I8fd2ffe5908074417aa5cfc00adbc54b6e9ed360
2016-02-17use consistent #define checks for the Windows platformNoel Grandin1-10/+10
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 ...danielt9981-2/+2
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 Sherlock1-1/+0
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 Sherlock2-2/+2
Change-Id: I4bb19d6103c4a6a902d86b62a857e3478493924c
2016-02-01Resolves: tdf#93821 assume mbNoSaveBackground as true everywhereCaolán McNamara1-1/+0
Change-Id: I126aa5e9b96299eb25c2240d097859b3c0756535
2016-01-26OpenGLWrapper is the right place for getBufferSwapCounter()Tor Lillqvist1-2/+2
Change-Id: I3f7db276ab00d5fa493f993736f1010e76fcbcc8
2016-01-26Put getBufferSwapCounter() in OpenGLWindow insteadTor Lillqvist1-4/+5
<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 Lillqvist1-0/+9
Change-Id: Iff29ac615ad4b6516790b1cbbde0215a3cd0efe6
2016-01-13We only use the prev pointerTor Lillqvist1-1/+0
(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 Meeks1-3/+1
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 Bergmann1-1/+1
Change-Id: Ic5bfc72c75745d0a4d9ff165d840ab51c90a8690
2016-01-06vcl: opengl - Kill the last glErrors on common paths.Michael Meeks2-0/+43
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 Lillqvist1-0/+2
Change-Id: I14628e9dee8651e87b4782057c4681fded5e4643
2016-01-05vcl: Ignore i965’s shader compiler debugEmmanuel Gil Peyrot1-0/+6
Change-Id: I94c5759d47a17e93f0614bfd95b52d64f9d2d896
2016-01-01vcl: improve OpenGL debugging variously.Michael Meeks2-1/+23
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-15Initialise bArbMultisampleSupported as falseTor Lillqvist1-1/+1
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 Meeks1-0/+1
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 Peyrot1-3/+59
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 Meeks1-0/+10
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 Meeks1-6/+7
Change-Id: I3db1d6792fcd51577f047b82029124ec825ea319
2015-12-08Bin the pointless and thin OS X specific wrapper namespace 'OpenGLWrapper'Tor Lillqvist1-6/+7
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 Bergmann2-19/+19
Change-Id: Ib1f06cb5f925535858bc14aab6f59ad7fd2a3a8d
2015-11-19readabilityTomaž Vajngerl1-1/+4
Change-Id: I8fbff3f86a543a58259408914bb78f992ad65864