summaryrefslogtreecommitdiff
path: root/vcl/inc/opengl
AgeCommit message (Collapse)Author
2016-02-25opengl: shader based polyline rendering - fixes tdf#97137 for OGLTomaž Vajngerl
Adds native opengl polyline rendering to draw polylines, line joins and line caps as triangle strips. The vertex shader allows for the dynamic line width by calculating the correct vertex posiitons, and the fragment shader is used for anti-aliasing. Change-Id: If7982c828cae1fae59c57194c8ac77e5ad7f1d26
2016-02-22tdf#82577: Remove prex.h and postx.h wrapper headersJorenz Paragas
Include the X11 headers directly in files that used to include those wrappers, and add the Pixel typedef to files that use it. prex.h included headers that a file including prex.h might not need at all, so when replacing prex.h and postx.h includes, try including only X11 headers that are actually needed in their place. Also fix saldisp.hxx and i18n_xkb.cxx relying on indirectly included X11 headers. Change-Id: If0c30c7facc28db7f2e410b5e6f1d52d8c7cdfd3 Reviewed-on: https://gerrit.libreoffice.org/22132 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-02-15Unit test for opengl blocklist parsing and evaluatingTomaž Vajngerl
Parsing unit test checks that the xml values are parsed correctly and that the DriverInfo structure is populated with the expected values. Evaluate unit test checks that blacklisting / whitelisting logic blocks OS/vendor/driver/device as expected. Change-Id: Ib1b0926606f0835207c324193bbe19ba83f86bdc Reviewed-on: https://gerrit.libreoffice.org/22371 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2016-02-13vcl: include vcl headers via triangular brackets instead of quotesChris Sherlock
Change-Id: I311f7db622ce341527fe12a92b516f800b602f92
2016-02-10opengl: remove unneeded mnBufWidth{Height} from OpenGLSalBitmapTomaž Vajngerl
Change-Id: Idf445b9f6b403a0d37650c14e17b7d754451edf1 Reviewed-on: https://gerrit.libreoffice.org/22258 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2016-02-09tdf#97666 -opengl: convert the bitmap to 8bit grays using GL shaderTomaž Vajngerl
Change-Id: I4d48d29ab752814f71c697a201e70a26ae937775 Reviewed-on: https://gerrit.libreoffice.org/22223 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
2016-02-08tdf#97458 - remove unused intel opengl driver version special-casing.Michael Meeks
Change-Id: I938bcab02edb37a5e7d72f1551867e0f5a4dd89b Reviewed-on: https://gerrit.libreoffice.org/22215 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Bryan Quigley <gquigs@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2016-01-26vcl: replace boost::shared_array with std::shared_ptrMichael Stahl
Add o3tl::make_shared_array() to create the shared_ptr with the right deleter. The main difference then is that shared_array has operator[], but this code didn't even use it. Change-Id: I500ffc2f92b99c2a3924c0cdcdaa101956b69add
2016-01-18basebmp now only used from vcl/headless codeCaolán McNamara
Change-Id: I068d404431d3565f6ad5741edbd3693225824a4d
2016-01-13This stuff is private to vclTor Lillqvist
Change-Id: I623da89ea390a07bd6a3236b5c099be094a7acde
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: fix lifecycle errors & memory corruption.Michael Meeks
FixedTextureAtlasManager should use ref-counted textures properly. Also - dispose embedded textures early in VCL shutdown while we have a valid OpenGLContext. Also - dispose the native widget control cache earlier too. Change-Id: Id3f7a1c3b331496616f36cbf02f83737505278a5 Reviewed-on: https://gerrit.libreoffice.org/21148 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
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>
2015-12-21loplugin:unusedmethodsNoel Grandin
Change-Id: Ifafdaf6da0225f244853a0042a6458643b570623
2015-12-19coverity#1343636 Uninitialized scalar fieldCaolán McNamara
Change-Id: Ibef02c68869d548507fb36aeba7e4dc9a6110cab
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-08Rename OpenGLSalBitmap::makeCurrent() to makeSomeOpenGLContextCurrent()Tor Lillqvist
The function does not, in any way, as far as I see, make the OpenGLSalBitmap object "current". It picks one OpenGLContext object and makes that current. So, rename it to be less misleading. Am I missing something? Change-Id: Ia9f8e2415e1075dd5892cd40140e6ad764feeaa4
2015-12-08Bin pointless and actually wrong commentTor Lillqvist
Change-Id: Ie38ed19ea1637ae25846eef8a3e779d7b3bfe1df
2015-11-23establish that Virtual Devices either match Physical Device depth or ...Caolán McNamara
are 1 or (rarely) 8 bit and lock that down. Change-Id: I3d946ebef34ffb71c5adea7aa420af50e9584e05
2015-11-20opengl: fix blocklist parsingTomaž Vajngerl
Devices weren't copied correctly - delete copy constructor as it is not needed. Split parsing to more methods so it is more readable. Parse vendor name (ati, intel, ...) and convert to vendorId Change-Id: I91ed7d8c5713dec160e217defb27f25cd3e8178c
2015-11-19opengl: support Win 10 in black/white listingTomaž Vajngerl
Change-Id: I9a3055fc60f738ab941816e40f4dd147deedafbe
2015-11-18com::sun::star->css in vcl/Noel Grandin
Change-Id: Ifad76177673cf93746ba221838be80ff76fed228 Reviewed-on: https://gerrit.libreoffice.org/20032 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-10-12Replace "SAL_OVERRIDE" with "override" in LIBO_INTERNAL_ONLY codeStephan Bergmann
Change-Id: I2ea407acd763ef2d7dae2d3b8f32525523ac8274
2015-10-12Replace "SAL_DELETED_FUNCTION" with "= delete" in LIBO_INTERNAL_ONLY codeStephan Bergmann
Change-Id: I328ac7a95ccc87732efae48b567a0556865928f3
2015-10-12opengl: remove code duplication when rendering a texture comboTomaž Vajngerl
Change-Id: Ic184e0e96103bb63322c8aaf8758c4c8f423e0b9
2015-10-02loplugin:unusedmethods in vclNoel Grandin
Change-Id: Ib404310761fd555b033ab6594ba8636d37f23463 Reviewed-on: https://gerrit.libreoffice.org/19074 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-09-16opengl: this doesn't really do anything as data is null anywayTomaž Vajngerl
Change-Id: Iacd75beecc14023173a9aa52a30298bbfe787d61
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-15tdf#93814: Added support for caching shader program binaries.Marco Cecchetti
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-08tdf#94006 - re-factor to use rtl::Reference for OpenGLContexts.Michael Meeks
Don't use rtl::Reference for the global / list state, so the ref-count reflects the number of real users. Hold a reference during ~OpenGLContext. Change-Id: I4e57a7246159acd58ae7d5a0dfc8704b9795c894
2015-09-01More useful param typeStephan Bergmann
...for arg that ultimately ends up as const GLVoid *pixels arg to glTexImage2D Change-Id: I69ba2f1dd397fa103f3f59638bec727add3caed7
2015-09-01WaE: 'updateChecksum' overrides a member function but is not marked 'override'Tor Lillqvist
Change-Id: Ic2230e1d1f54e27d4189fc56b525a7e76ddab649
2015-09-01gl-checksum: added a minimum size check for using GL versionMarco Cecchetti
(nWidth * nHeight) < (1024*768) || nWidth < 128 || nHeight < 128 Change-Id: Iedda6a333958c76c19b837890eb3fa28e631bc90
2015-09-01Added support for computing 64-bit checksum of bitmap in OpenGLMarco Cecchetti
Added a C++ and a GLSL implementation of a 64-bit CRC algorithm. Changed hardcoded checksum value in ooxmlimport unit test (testN777345). Change-Id: I16bb985a14866775efda49e21fe033ff64645896
2015-08-31tdf#93772 - handle framebuffer unbinding on GL context switch.Michael Meeks
Also start gl tests in vcldemo: $ SAL_FORCEGL=1 vcldemo --gltests Change-Id: I8f0022770d57cd60c830659e3f7fcc0721320a10 Reviewed-on: https://gerrit.libreoffice.org/18132 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2015-08-31tdf#93751 - ensure textures are unbound from framebuffers post destroy.Michael Meeks
Change-Id: I81aec0e6f8db57905826c54c3442528be6068700
2015-08-26vcl OpenGL program: Cache mvp matrix to reduce ~200 api calls per frame.Lubosz Sarnecki
(cherry picked from commit e3cd97ce0b2e153b8b6812cc66f2e7d33504a7da) Conflicts: vcl/opengl/program.cxx Change-Id: I86ae50bd8d2148e86a6c8fc0821d3e2bc29a0cd4
2015-08-25tdf#93614 - detect hanging OpenGL drivers with a watchdog.Michael Meeks
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-25Nitpick: Follow our header guard naming conventionTor Lillqvist
Change-Id: I939d36dbb0a298f8181367f74001115ef89d5bc2
2015-08-24include vectorCaolán McNamara
Change-Id: I84f571c0564b33a5b647a270c567959b415b3747
2015-08-24opengl: push mask coords to the shaders along the image coordsTomaž Vajngerl
If using the same texture to store the image and mask data (for example when using texture atlas) the mask and image (RGB) coords aren't the same anymore. With this commit we always define the mask coords separately. Change-Id: Ie33f87a6e9ab398972c6a3d5938e5f1364c82d36
2015-08-24Fixed (fixed size) texture atlas for "caching" OpenGL texuresTomaž Vajngerl
Change-Id: I7fe90c0a0033b4d9a341a4f0b8356d7f7133e93e
2015-08-24save texture to file as a PNG imageTomaž Vajngerl
Change-Id: I5605b80f95d89599efe58cf65e1ce3f3581d401f
2015-08-21tdf#93547 - Disable OpenGL if we have a SEGV on windows in that code.Michael Meeks
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-07opengl: cache native widget textures also for WindowsTomaž Vajngerl
Change-Id: I476f0ffaef383f3227c0c12b50fcdebf393190f6 Reviewed-on: https://gerrit.libreoffice.org/17487 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
2015-08-03opengl: when scaling, create a new texture with equal settingsTomaž Vajngerl
Change-Id: Id0258fe0db89aa06b91233ae2052f018d606cc74
2015-07-24-Werror,-Wmismatched-tagsNoel Grandin
Change-Id: I85f4ddb5b3c441b0fc18e3d255dded7456b69ddd
2015-07-24tdf#92018 cache native controls for X11 OpenGL backend (for now)Tomaž Vajngerl
Change-Id: I85c7cc01113bc4ac810c450a6460059463cc8e03
2015-07-10vcl: move resample kernel classes out of bitmap.hxxMichael Stahl
Since commit f31e6debfa7e330f985a0846a6ca91130d3dab20 this drags in ridiculous amounts of boost headers, for probably negigible improvemnts of sin(x)/x for tiny x values. The compile time impact was not negligible, moving this nonsense to its own header removes 1.79 GB of preprocessor input from a full build. Change-Id: Ic41b2210eac8b130726610f2dbdbb449379225d1
2015-07-09opengl: use MVP matrix in vertex shaders, pixel offsetsTomaž Vajngerl
ChangChange all vertex shaders to accept model, view, projection matrix to calculate the vertex position. So now we don't need to convert the coordinates to OpenGL coordinate space [-1.0, 1.0] anymore. Additionally make it possible to offset vertex coordinates so we can apply 0.5 px offset (to hit the pixel center) at some operations. Change-Id: I8e0a61d5fd4ab6aaa1c0c94439061725918577a0